Compare commits

...

335 Commits

Author SHA1 Message Date
Thomas Schmitt 4dc5edc565 Bug fix: -boot_image system_area=/dev/zero preserved system area of loaded ISO 2024-05-13 12:22:04 +02:00
Thomas Schmitt c8fab513c6 Issueing warning messages if -boot_image paths currently are unsuitable 2024-05-12 17:38:47 +02:00
Thomas Schmitt 87e1d67417 Mentioned in the man page that libisofs now memorizes all boot related paths at image load time. Warned of boot file manipulations after -boot_image replay. 2024-05-12 14:02:45 +02:00
Thomas Schmitt 4818eeaa5f Mentioned in the man page the increased number of appended GPT partitions in libisofs 2024-05-11 13:06:20 +02:00
Thomas Schmitt a26df9c49f Bug fix: Command -truncate_overwritable on ISO image without MD5 caused double free of memory 2024-04-27 18:53:40 +02:00
Thomas Schmitt 2af1e90639 Bug fix: Command -load "volid" did not work with constant search text 2024-04-27 18:51:22 +02:00
Thomas Schmitt ccb29eae32 Correction to commit 86261b7: Sector bitmaps could not be read any more 2024-04-27 18:41:56 +02:00
Thomas Schmitt abf4375b63 Corrected a comment about Xorriso_findi_iter() 2024-04-20 16:56:34 +02:00
Thomas Schmitt 3955462767 Mentioned in man xorrecord that write_start_address= expects bytes not blocks 2024-04-19 18:03:53 +02:00
Thomas Schmitt 7f9d140d0d Small correction of commit 646d15a 2024-04-19 12:52:57 +02:00
Thomas Schmitt fb23fe1446 Follow-up to commit ba12014: Made use of more isoburn*_v2() calls 2024-04-03 18:56:09 +02:00
Thomas Schmitt ffaa15ed53 Prevented possible overflow of struct elto_img_par.extract_size 2024-04-02 20:11:08 +02:00
Thomas Schmitt 4fe385baed Made struct xorriso_md5_state ready for long block addresses 2024-03-28 15:51:52 +01:00
Thomas Schmitt 14676ef132 Made Xorriso_format_media() ready for long block adresses 2024-03-24 10:09:54 +01:00
Thomas Schmitt fcad0813dc Made Xorriso_blank_media() ready for long block adresses 2024-03-24 09:48:04 +01:00
Thomas Schmitt c74f175972 Made struct XorrisO ready for long block adresses 2024-03-24 09:32:01 +01:00
Thomas Schmitt 5de4a8dd45 Made Xorriso_adjust_relocated_sb() ready for long block adresses 2024-03-23 22:21:43 +01:00
Thomas Schmitt 2d8678a11b Made Xorriso_adjust_session_size() ready for long block adresses 2024-03-23 19:42:37 +01:00
Thomas Schmitt 41a91dfe86 Made Xorriso_overwrite_iso_head() ready for long block adresses, part 2 2024-03-23 18:52:54 +01:00
Thomas Schmitt fa7ba62660 Made Xorriso_refresh_ts_tags() ready for long block adresses 2024-03-23 18:30:44 +01:00
Thomas Schmitt 8c61d88404 Made Xorriso_update_iso_lba0() ready for long block adresses 2024-03-22 22:32:58 +01:00
Thomas Schmitt 9377f667b5 Made Xorriso_overwrite_iso_head() ready for long block adresses 2024-03-22 17:59:56 +01:00
Thomas Schmitt f1e00c3e4c Made Xorriso_burn_track() ready for long block adresses 2024-03-22 17:19:00 +01:00
Thomas Schmitt ce3f23b75d Made Xorriso_pacifier_loop() ready for long block adresses 2024-03-22 14:34:45 +01:00
Thomas Schmitt c8788712fc Made Xorriso_write_session() ready for long block adresses 2024-03-21 22:25:31 +01:00
Thomas Schmitt d635037661 Made Xorriso_set_system_area() ready for long block adresses 2024-03-21 21:34:11 +01:00
Thomas Schmitt fb780b59cb Made Xorriso_sanitize_image_size() ready for long block adresses 2024-03-21 20:42:23 +01:00
Thomas Schmitt 2d3302db51 Made Xorriso__file_start_lba() ready for long block adresses 2024-03-21 19:28:34 +01:00
Thomas Schmitt 698bee2621 Made Xorriso__start_end_lbas() ready for long block adresses 2024-03-21 17:52:51 +01:00
Thomas Schmitt ec7ab520ba Made Xorriso_path_from_lba() ready for long block adresses 2024-03-21 16:07:16 +01:00
Thomas Schmitt 458b0cb3de Made Xorriso_obtain_indev_readsize() ready for long block adresses 2024-03-21 09:44:51 +01:00
Thomas Schmitt 5e03c659e3 Updated copyright date in various recently changed files 2024-03-20 22:52:07 +01:00
Thomas Schmitt 4c7cfe96d9 Made Xorriso_assert_volid() ready for long block adresses 2024-03-20 22:38:23 +01:00
Thomas Schmitt cdffa4efee Made struct ExprtesT test -lba_range ready for long block adresses 2024-03-20 16:05:35 +01:00
Thomas Schmitt 435521a2c9 Made Xorriso_tell_media_space() ready for long block adresses 2024-03-20 12:45:09 +01:00
Thomas Schmitt c64e48d588 Made Xorriso_tell_media_space() ready for long block adresses 2024-03-19 21:54:14 +01:00
Thomas Schmitt 662b305d12 Made Xorriso_toc() ready for long block adresses 2024-03-19 19:59:06 +01:00
Thomas Schmitt 82deb547c0 Made Xorriso_aquire_drive() ready for long block adresses 2024-03-19 12:24:00 +01:00
Thomas Schmitt d24634af3d Bug fix: -outdev holding an ISO filesystem could get attached wrong start LBA 2024-03-19 10:02:06 +01:00
Thomas Schmitt e6e93a9803 Made Xorriso_make_read_options() ready for long block adresses 2024-03-18 22:43:29 +01:00
Thomas Schmitt b8b0f41320 Made Xorriso_make_mount_cmd() ready for long block adresses 2024-03-18 21:40:38 +01:00
Thomas Schmitt 949a4c3bd0 Updated copyright date in read_run.c 2024-03-18 21:20:17 +01:00
Thomas Schmitt 19e1ceec26 Made Xorriso_check_media() ready for long block adresses 2024-03-18 18:38:53 +01:00
Thomas Schmitt 969ee9d6f5 Made struct CheckmediajoB ready for long block adresses 2024-03-18 09:44:24 +01:00
Thomas Schmitt ba12014d46 Made structs SpotlistiteM and SpotlisT ready for long block adresses 2024-03-17 22:07:23 +01:00
Thomas Schmitt 86261b7972 Introduced xorriso sector bitmap v3 with 8-byte N and S 2024-03-17 17:09:00 +01:00
Thomas Schmitt 73b3923f72 Made struct SectorbitmaP ready for long block adresses 2024-03-17 16:26:38 +01:00
Thomas Schmitt a07addd083 Replaced non-API isoburn_get_track_lba() by isoburn_get_track_lba_v2() 2024-03-10 12:30:44 +01:00
Thomas Schmitt bae9516439 Made isoburn_make_iso_read_opts() ready for long block adresses 2024-03-10 12:24:09 +01:00
Thomas Schmitt d0682a17b9 Made isoburn_set_msc1() ready for long block adresses 2024-03-10 12:13:20 +01:00
Thomas Schmitt aebd2b92ca Made isoburn_welcome_media() ready for large block adresses 2024-03-10 11:57:58 +01:00
Thomas Schmitt fbeec724d7 Made use of _v2 calls when creating an isoburn_imgen_opts object 2024-03-10 11:12:26 +01:00
Thomas Schmitt bdc9164787 Made isoburn_prepare_disc_aux ready for unsigned 32 bit 2024-03-10 08:59:06 +01:00
Thomas Schmitt 9003e477e7 Made off_t sized burn_toc_entry fields valid in fabricated entries 2024-03-10 08:55:44 +01:00
Thomas Schmitt 8d33881cd6 New API call isoburn_prepare_blind_grow_v2() 2024-03-10 08:26:09 +01:00
Thomas Schmitt dd92a6e0d7 New API calls isoburn_attach_start_lba_v2(), isoburn_disc_get_msc1_v2(), isoburn_disc_track_lba_nwa_v2() 2024-03-09 23:37:12 +01:00
Thomas Schmitt 646d15af46 New API call isoburn_get_attached_start_lba_v2() 2024-03-09 22:21:18 +01:00
Thomas Schmitt 423c14828c New API calls isoburn_igopt_get_effective_lba_v2(), isoburn_igopt_get_data_start_v2() 2024-03-09 22:05:18 +01:00
Thomas Schmitt e7326e0e6c New API calls isoburn_read_iso_head_v2(), isoburn_get_mount_params_v2() 2024-03-09 21:49:26 +01:00
Thomas Schmitt a86d1378ff New API calls isoburn_toc_disc_get_sectors_v2, isoburn_toc_session_get_sectors_v2, isoburn_toc_track_get_emul_v2 2024-03-09 19:31:19 +01:00
Thomas Schmitt c1e563341d Augmented structs isoburn, isoburn_toc_entry, isoburn_imgen_opts for long block addresses 2024-03-09 19:08:11 +01:00
Thomas Schmitt 280c78a2a6 Demanding libburn 1.5.7 2024-03-09 18:03:13 +01:00
Thomas Schmitt 92c4d5b45a Updated change log and web page 2023-11-21 11:50:57 +01:00
Thomas Schmitt aace531ca8 Improved handling of hidden boot images in -boot_image cmd/as_mkisofs/replay 2023-11-21 11:32:38 +01:00
Thomas Schmitt 651f42955d New -as mkisofs options -cut_out and -hide_iso_path 2023-11-20 11:50:38 +01:00
Thomas Schmitt e383d3adbe Updated change log and web page 2023-08-08 19:32:31 +02:00
Thomas Schmitt 2de0667393 Using Xorriso_change_is_pending() bit1 at end of program 2023-08-08 13:45:38 +02:00
Thomas Schmitt ab0bfdb04f New bit1 with API call Xorriso_change_is_pending() issues a note if return is 0 and indev and outdev point to different drives 2023-08-08 13:43:51 +02:00
Thomas Schmitt 0b7e4f934e New -append_partition pseudo partition_number "all" und pseudo type_code "revoke" 2023-08-07 15:26:51 +02:00
Thomas Schmitt aaaa0a99c4 Let -boot_image show_status display info about -append_partition status 2023-08-06 15:31:25 +02:00
Thomas Schmitt f3af549e92 Bug fix: -boot_image and -append_partition were not perceived as image manipulation which makes production of an ISO image worthwhile. Thanks Cameron Seader. 2023-08-06 15:24:28 +02:00
Thomas Schmitt 1a44cbda91 Silenced some harmless warnings of Fedora build process 2023-07-21 09:00:53 +02:00
Thomas Schmitt 11c5f6585a Enabled recognition of multi-session emulation with partition offset 16 and GPT 2023-07-12 20:32:56 +02:00
Thomas Schmitt 9b17a8a24a Updated change log and web page 2023-06-20 19:43:06 +02:00
Thomas Schmitt 1807f04f4d Updated change log and web page 2023-06-12 21:46:04 +02:00
Thomas Schmitt a22f6b8391 Documented changes and release timestamp 2023-06-07 23:17:20 +02:00
Thomas Schmitt 5a869b17a9 Version leap to libisoburn-1.5.7 2023-06-07 22:46:21 +02:00
Thomas Schmitt 919c82385b Documented changes and release timestamp 2023-06-07 18:40:27 +02:00
Thomas Schmitt 79997c2b31 Updated xorriso-dd-target.sig and merge_debian_isos.sig 2023-06-07 18:38:21 +02:00
Thomas Schmitt be8f86ded2 Version leap to libisoburn-1.5.6 2023-06-07 18:37:00 +02:00
Thomas Schmitt ad1b9bfe03 Added -joliet "on" to xorriso run in merge_debian_isos 2023-04-14 18:20:33 +02:00
Thomas Schmitt d0ff0a381a Updated change log and web page 2023-03-19 16:40:06 +01:00
Thomas Schmitt fc03217d91 Emitting SORRY event for dangling symbolic links if -follow is set to "link" 2023-03-15 20:49:32 +01:00
Thomas Schmitt 72ef04a9e1 Enabled -check_media with pseudo-blank overwritable media 2023-02-28 16:08:41 +01:00
Thomas Schmitt 1844014a64 Fixed error in format of LBA-0-superblock created by prevous commit 2023-02-28 15:45:03 +01:00
Thomas Schmitt b837ff30fc Let -truncate "sbsector" "new" work even if LBA-0-superblock is damaged 2023-02-24 17:28:41 +01:00
Thomas Schmitt 6a921c7411 New flag bit12 with isoburn_read_iso_head() 2023-02-24 09:01:04 +01:00
Thomas Schmitt 163129ca6a Added missing help text for -assess_indev_features 2023-02-08 21:09:32 +01:00
Thomas Schmitt 5600508ab0 Updated copright year in output of -version 2023-01-22 16:22:22 +01:00
Thomas Schmitt 1a1d31f36c Corrected argument count classification of -setfattr_list 2023-01-22 16:21:15 +01:00
Thomas Schmitt b4e10ced99 New -compliance rules max_ce_entries=, max_ce_drop= 2023-01-22 16:19:28 +01:00
Thomas Schmitt 9a578a657f New API calls isoburn_igopt_set_max_ce_entries(), isoburn_igopt_get_max_ce_entries() 2023-01-22 16:13:57 +01:00
Thomas Schmitt c310e2abc1 Bug fix: -find test -has_xattr matched "isofs." attributes in -xattr mode "any" 2023-01-10 19:03:10 +01:00
Thomas Schmitt 3afa1d5191 Bug fix: -toc reported wrong track LBA with overwritable media with unrecognized content (pseudo-closed) 2023-01-09 15:45:00 +01:00
Thomas Schmitt 1a39dc6903 Enabled effect of -rom_toc_scan "off:emul_off" for -mount entity "auto" 2022-12-28 09:42:22 +01:00
Thomas Schmitt 36daf52a79 Updated change log and web page 2022-12-18 19:52:52 +01:00
Thomas Schmitt 098d4f8ff5 Bug fix: Data files named /boot.catalog or ./boot.cat could be left out of the emerging ISO if the boot catalog was set to be hidden 2022-12-17 20:43:24 +01:00
Thomas Schmitt 4eb98d7911 Reacted on (in the end harmless) warning of valgrind 2022-12-11 19:23:48 +01:00
Thomas Schmitt 017363ee34 Updated change log and web page 2022-12-02 10:57:32 +01:00
Thomas Schmitt 008620e19c New -find test -size 2022-11-10 10:51:21 +01:00
Thomas Schmitt a28040df18 Added test/merge_debian_isos and its docs to GNU xorriso tarball 2022-11-05 15:01:45 +01:00
Thomas Schmitt 1ff12c26d9 Bug fix: Partition offset was preserved from -indev rather than from -outdev 2022-11-05 14:38:03 +01:00
Thomas Schmitt 09de0f1743 Demanding (belated) libburn and libisofs versions 1.5.5 2022-10-29 10:50:31 +02:00
Thomas Schmitt 0d3d9d7a92 Updated change log and web page 2022-10-27 18:07:15 +02:00
Thomas Schmitt c62ae86d27 Corrected the BUGS section of merge_debian_isos.texi 2022-10-19 15:51:59 +02:00
Thomas Schmitt 7d618ef060 Enabled production of .info and .1 from merge_debian_isos.texi 2022-10-19 15:50:25 +02:00
Thomas Schmitt fd195504ae Created manual pages for merge_debian_iso 2022-10-19 13:23:47 +02:00
Thomas Schmitt 847afc0095 Updated change log and web page 2022-10-08 15:43:12 +02:00
Thomas Schmitt 82dc9b6b42 Reporting some relaxation commands with -report_el_torito modes "cmd" and "mkisofs" if CHRP is detected. Performing them with -boot_image any "replay". 2022-10-07 11:55:10 +02:00
Thomas Schmitt e594ba293a New command -assess_indev_features 2022-09-20 10:28:25 +02:00
Thomas Schmitt d2fd48fcbc New API call isoburn_assess_written_features() 2022-09-20 10:14:10 +02:00
Thomas Schmitt 3318fa47a3 New environment variable MKRESCUE_SED_UNPACK_EFI_TO_ISO 2022-08-06 16:22:32 +02:00
Thomas Schmitt 9e79f64cae Automatically creating mount parent directory in merge_debian_isos 2022-07-19 15:57:29 +02:00
Thomas Schmitt f205e4294a Added a sentence to help text of merge_debian_isos 2022-07-16 19:34:44 +02:00
Thomas Schmitt 821628ae91 Made adjustments in merge_debian_isos 2022-07-15 17:05:34 +02:00
Thomas Schmitt bdc563a98b Updated change log and web page 2022-07-14 22:00:44 +02:00
Thomas Schmitt 71f6ba15c3 Updated the gpg --verify procedure after demise of keys.gnupg.net 2022-07-14 21:58:29 +02:00
Thomas Schmitt 62700a98e1 Enabled writing by merge_debian_isos to USB sticks and optical media 2022-07-14 21:32:20 +02:00
Thomas Schmitt 4ff9f8eedf Returning non-zero exit value if releng/run_all_auto fails. Proposal by Alexandre Ghiti. 2022-07-02 09:03:43 +02:00
Thomas Schmitt 0e8227e76a Improved speed of md5sum.txt processing by a proposal of Zhang Boyang 2022-06-26 10:58:16 +02:00
Thomas Schmitt 072c4e5ab9 Listing /firmware/dep11/README.txt in md5sum.txt if all its MD5 lines are equal 2022-06-24 09:40:12 +02:00
Thomas Schmitt a94f22d92b Properly announced and checked md5sum as new dependency of merge_debian_isos 2022-06-23 18:51:21 +02:00
Thomas Schmitt 0bc397c02c Removing duplicates from md5sum.txt and computing new MD5 for changed files 2022-06-23 18:17:41 +02:00
Thomas Schmitt 87aab73058 Corrected sorting of /md5sum.txt by merge_debian_isos 2022-06-20 22:09:24 +02:00
Thomas Schmitt 68c4a39c37 Merging Debian /firmware directories like the /pool directories 2022-06-18 21:20:42 +02:00
Thomas Schmitt 5897c706a4 Improved signal handling, removing result ISO if xorriso exits with error, redirected a few messages from stdout to stderr 2022-06-18 17:14:11 +02:00
Thomas Schmitt 34981b1278 Switched test/merge_debian_isos to /bin/sh, added signal handling, fixed harmless flaws found by shellcheck, added more sanity checks, enabled XORRISO=dummy for test runs without ISO production 2022-06-17 10:22:27 +02:00
Thomas Schmitt 65c63cc1cf Changed permissions of test/merge_debian_isos to a+x 2022-06-15 22:08:51 +02:00
Thomas Schmitt 9b4c082f84 New experimental script test/merge_debian_isos. Deprecated merge_2_debian_isos. 2022-06-15 12:25:05 +02:00
Thomas Schmitt 3eef0411d5 Warning if EFI boot equipment is present but no /EFI/BOOT directory is in ISO 2022-06-13 22:56:17 +02:00
Thomas Schmitt 5aac3dd80f Bug fix: Split file directories (-split_size) were created with wrong permissions 2022-06-02 16:10:21 +02:00
Thomas Schmitt 865115f779 Allowed lseekable device files with -paste_in 2022-05-30 18:48:05 +02:00
Thomas Schmitt 0c0d542591 Widened the lseek capacity determination to SEEK_SET with wanted size 2022-05-30 18:45:49 +02:00
Thomas Schmitt ddfe5098d8 New experimental script test/merge_2_debian_isos 2022-05-23 20:07:50 +02:00
Thomas Schmitt 0cb2e15190 Allowed to override by variable CC the use of g++ in releng/auto_cxx . Proposal by Tom Stellard. 2022-05-10 17:16:38 +02:00
Thomas Schmitt fc587966d3 Allowed lseekable device files with -cut_out. Proof-of-concept by Ivan Shmakov. 2022-04-26 12:17:22 +02:00
Thomas Schmitt 0ef65a7837 Updated change log and web page 2022-04-23 14:09:30 +02:00
Thomas Schmitt ac7cdfa251 Bug fix: -report_system_area cmd misperceived combination of isohybrid and appended partition in GPT 2022-04-22 13:33:52 +02:00
Thomas Schmitt 7d79692c55 Bug fix: -report_system_area cmd misperceived -part_like_isohybrid with -isohybrid-gpt-basdat 2022-04-22 13:32:25 +02:00
Thomas Schmitt e651cb5040 New -toc output line "Overburnt by :" 2021-11-24 12:52:53 +01:00
Thomas Schmitt 6b0bb9e630 Mentioned in man page the classification of BD-R POW as unsuitable medium state 2021-09-25 10:51:21 +02:00
Thomas Schmitt 0ba13965a7 Updated change log and web page 2021-09-13 17:18:34 +02:00
Thomas Schmitt b2d9384ec9 Fixed a message about -paste_bin from and to paths 2021-09-13 17:14:25 +02:00
Thomas Schmitt b5a33c3418 Bug fix: -not_leaf and -not_paths were not applied to -extract and alike 2021-09-13 17:12:34 +02:00
Thomas Schmitt 358262818e New -as cdrecord option --bdr_obs_exempt 2021-09-12 11:33:50 +02:00
Thomas Schmitt 58e7eb0877 New parameters "obs_pad" and "bdr_obs_exempt" for -dvd_obs 2021-09-12 11:27:54 +02:00
Thomas Schmitt 555048a0a1 Removed a "(" from a "dnl" comment which confused autoupdate 2021-09-04 16:22:35 +02:00
Thomas Schmitt 8a11dc6224 Reacted on compiler warning of Debian i386 buildd 2021-09-04 10:00:20 +02:00
Thomas Schmitt 562247b74f Removed unneeded configure.ac macro AC_C_BIGENDIAN 2021-09-02 19:59:27 +02:00
Thomas Schmitt d19150ad36 Updated copyright year of -version message 2021-08-30 16:52:41 +02:00
Thomas Schmitt b35c2e410f Updated change log and web page 2021-08-30 16:13:46 +02:00
Thomas Schmitt 3f2b61932b New -as cdrecord option --obs_pad. Automatic no_emul_toc with -as cdrecord. 2021-08-30 12:35:26 +02:00
Thomas Schmitt e489c877bd Bug fix: -no_rc prevented pre-scanning of arguments for stdio output and others. Introduced by mistake in a62f6af5, 2011.10.18.162119. 2021-08-30 11:50:06 +02:00
Thomas Schmitt e6f686761e Corrected wording in the API description of isoburn_conv_name_chars() 2021-08-28 18:13:35 +02:00
Thomas Schmitt 7dc45e3311 Warn of volid length for Joliet only if more than 16 characters (was: 16 bytes) 2021-08-28 18:12:15 +02:00
Thomas Schmitt 5011a5f7b0 Mentioned command -status in man page paragraph "Command processing" 2021-06-04 18:18:51 +02:00
Thomas Schmitt 49d40a4560 Corrected default expectation of -status in respect to -osirrox and -error_behavior 2021-06-04 17:52:30 +02:00
Thomas Schmitt 60dfe77a32 Updated change log and web page 2021-05-25 22:16:02 +02:00
Thomas Schmitt e9cbf38c01 Bug fix: False -status failure with -boot_image --interval:appended_partition 2021-05-25 21:59:32 +02:00
Thomas Schmitt 23d0d8e90a New -as mkisofs options --gpt-iso-bootable and --gpt-iso-not-ro 2021-05-25 21:22:43 +02:00
Thomas Schmitt db5d4eb867 New -boot_image settings gpt_iso_bootable= and gpt_iso_not_ro= 2021-05-25 21:18:48 +02:00
Thomas Schmitt a1f9d03df0 New isoburn_igopt_set_system_area() option bits 16: GPT "Legacy BIOS bootable" and 17: GPT writable 2021-05-25 21:14:23 +02:00
Thomas Schmitt e3df75772e Avoided to override EFI type GUID by output of -report_system_area as_mkisofs 2021-04-04 20:16:47 +02:00
Thomas Schmitt c9e7fe86df Fixed a man page typo found by lintian 2021-03-12 09:34:00 +01:00
Thomas Schmitt a5146807ff Made optional the use of libcam and thus SCSI passthrough on GNU/FreeBSD systems 2021-03-12 09:32:19 +01:00
Thomas Schmitt be21a6374b Updated xorriso-dd-target.sig 2021-02-07 21:02:14 +01:00
Thomas Schmitt aa1a008bb3 Updated change log 2021-02-03 13:36:18 +01:00
Thomas Schmitt 9fe4c4dbab Updated change log and web page 2021-02-01 19:29:36 +01:00
Thomas Schmitt d16ab5b86a Updated change log and web page 2021-01-30 21:18:21 +01:00
Thomas Schmitt f51499c592 Made number transition to 1.5.5 2021-01-30 21:16:25 +01:00
Thomas Schmitt ac4048d590 Documented changes and release timestamp 2021-01-30 15:29:28 +01:00
Thomas Schmitt f81eade8cd Version leap to libisoburn-1.5.4 2021-01-30 15:27:55 +01:00
Thomas Schmitt 5bc1d998f9 Omitting "ISO offers :" and "ISO loaded :" if no ISO was loaded at all 2020-12-08 13:33:09 +01:00
Thomas Schmitt 3542e8af97 New -toc lines "ISO offers :" and "ISO loaded :" 2020-12-07 19:42:46 +01:00
Thomas Schmitt b3adff1daa New API call isoburn_ropt_get_tree_loaded() 2020-12-07 19:37:31 +01:00
Thomas Schmitt 47be075c45 New command -extract_boot_images 2020-12-05 09:53:59 +01:00
Thomas Schmitt e97cd48ee0 Added the source code of Xorriso_option_joliet_map which was omitted with commit 2fbb3cf 2020-12-04 11:35:01 +01:00
Thomas Schmitt 2fbb3cfac1 New command -joliet_map 2020-11-22 14:51:26 +01:00
Thomas Schmitt 8f89ad03fc New libisoburn extension option isoburn_ropt_map_joliet_unmapped 2020-11-22 14:46:06 +01:00
Thomas Schmitt cf176eea0a New libisoburn extension option isoburn_ropt_map_joliet_stripped 2020-11-22 14:19:16 +01:00
Thomas Schmitt 9f5a6ea1a7 Added -translation-table to the list of ignroed -as mkisofs options 2020-11-18 21:03:48 +01:00
Thomas Schmitt abd65a7eb6 Documented new opportunity to use with -append_partition the HFS+ type GUID to get APM type "Apple_HFS" 2020-11-15 15:31:10 +01:00
Thomas Schmitt 266a6f47d1 Updated change log and web page 2020-11-14 09:36:46 +01:00
Thomas Schmitt d9176dfceb Added NEWS to GNU xorriso 2020-11-13 20:36:23 +01:00
Thomas Schmitt fc2a2d4646 Added a NEWS file to please automake without --foreign. Thanks Felipe Franciosi. 2020-11-13 19:48:57 +01:00
Thomas Schmitt 6fa5f97da8 Bug fix: Boot catalog could get a wrong name if cat_path= is explicitely given but not containing a slash character 2020-11-07 12:42:16 +01:00
Thomas Schmitt 05de7ec5ee New -osirrox option sparse= controls extraction into sparse files 2020-11-03 09:27:41 +01:00
Thomas Schmitt 66fe150831 Updated change log and web page 2020-10-31 20:52:48 +01:00
Thomas Schmitt 80b4d29a81 Changed --zisofs-susp-z2 to --zisofs2-susp-z2, added --zisofs2-susp-zf 2020-10-29 20:14:29 +01:00
Thomas Schmitt d2f10a1768 Added libisofs/doc/zisofs2_format.txt to GNU xorriso 2020-10-29 09:36:47 +01:00
Thomas Schmitt 5316687d31 New -as mkisofs option --zisofs-susp-z2 2020-10-29 09:34:02 +01:00
Thomas Schmitt a9d8102996 New -zisofs parameter susp_z2= 2020-10-29 09:31:48 +01:00
Thomas Schmitt 1ddb676159 Enabled recognition of zisofs by magic without zlib support. New by_magic=v2 2020-10-27 12:38:52 +01:00
Thomas Schmitt c24ffedfc7 Let ./configure --disable-zlib issue a message 2020-10-27 12:21:04 +01:00
Thomas Schmitt c1e6d3415a In case of ISO_ZISOFS_TOO_MANY_PTR remove all dispensable block pointers 2020-10-25 17:04:24 +01:00
Thomas Schmitt 396d09946e Bug fix: -report_system_areas as_mkisofs misrepresented GPT with appended partition and forced boot flag 2020-10-24 14:19:57 +02:00
Thomas Schmitt c4d66ecb19 New -zisofs parameter bpt_free_ratio= 2020-10-22 13:42:51 +02:00
Thomas Schmitt 5a6aa8a71e Added makeinfo option --no-split in make_docs.sh 2020-10-17 15:31:37 +02:00
Thomas Schmitt 3f390f2cdc New -zisofs parameters bpt_target= 2020-10-17 15:30:26 +02:00
Thomas Schmitt 2f44446d05 Let -as mkisofs --zisofs-version-2 imply -z 2020-10-16 11:18:18 +02:00
Thomas Schmitt fb0d617674 Updated change log and web page 2020-10-14 23:09:42 +02:00
Thomas Schmitt 8286468948 New -as mkisofs option --zisofs-version-2 2020-10-14 23:02:59 +02:00
Thomas Schmitt dcb13954bd New -zisofs parameters version_2=, block_size_v2=, max_bpt=, max_bpt_f= 2020-10-14 22:59:35 +02:00
Thomas Schmitt 9a7dfd7721 Requiring libisofs 1.5.3 2020-10-14 20:21:52 +02:00
Thomas Schmitt bbded29369 Updated change log and web page 2020-09-30 21:17:19 +02:00
Thomas Schmitt 588578f9a8 New -check_media option data_to="-" for standard output 2020-09-30 21:07:50 +02:00
Thomas Schmitt 56b2d88667 Mentioned that partition_entry=gpt_basdat and -isohybrid-gpt-basdat create invalid GPT but also a valid MBR partition table 2020-09-11 12:23:50 +02:00
Thomas Schmitt ffb7fe64c9 New -read_speed prefixes "soft_force:" and "soft_corr:" 2020-08-26 16:29:40 +02:00
Thomas Schmitt f23b23fd17 Updated change log and web page 2020-08-20 12:31:15 +02:00
Thomas Schmitt 04a82ce28d New command -truncate_overwritable 2020-08-06 17:39:47 +02:00
Thomas Schmitt ec49c627f9 Silenced an inappropriate note message with -check_media patch_lba0 2020-08-06 12:16:09 +02:00
Thomas Schmitt 3f6195dbe1 Mentioned in man xorriso the directory tree limitation of HFS+ 2020-08-06 11:48:08 +02:00
Thomas Schmitt 2fda271a09 Adapted faq.wiki to Gitea 2020-07-08 15:56:32 +02:00
Thomas Schmitt 8f872bab67 Updated copyright year in README 2020-07-03 18:10:31 +02:00
Thomas Schmitt af0dd1357b Corrected typo in man xorriso. Thanks Jakub Wilk. 2020-06-13 23:10:38 +02:00
Thomas Schmitt c51f3813fe Mentioned in man xorrisofs the directory tree limitation of HFS+ 2020-06-13 10:52:42 +02:00
Thomas Schmitt 89fe871067 Corrected a functionality spoiling typo in commit 1170a9b 2020-02-12 21:03:10 +01:00
Thomas Schmitt 1170a9b883 New xorriso-dd-target option -trust_lsblk_udev 2020-02-12 16:06:49 +01:00
Thomas Schmitt 49690fcac7 Added GNU Coding Style compliant versions of contact information to help texts 2020-01-20 14:29:19 +01:00
Thomas Schmitt bf0a3f015b Added contact information to help texts 2020-01-19 10:55:48 +01:00
Thomas Schmitt 086a9a69fd Corrected computation of end block for GPT erasure 2020-01-08 21:50:21 +01:00
Thomas Schmitt 5a335e5594 Erasing GPT backup header block, if expr is good enough 2020-01-07 16:47:41 +01:00
Thomas Schmitt 43d5804db3 New xorriso-dd-target option -version 2020-01-06 22:02:19 +01:00
Thomas Schmitt 557e69ada1 Using dd option status=progress if available 2020-01-06 21:44:11 +01:00
Thomas Schmitt 56238c3c6a Timestamp for 3466f23 2020-01-02 23:05:51 +01:00
Thomas Schmitt 3466f2300a New -osirrox option check_md5_on|_off|_force 2020-01-02 18:50:59 +01:00
Thomas Schmitt 71b61339e9 xorriso-dd-target returned exit value 1 if no device name is given and one of the listed devices is not advisable 2020-01-01 09:06:01 +01:00
Thomas Schmitt 80e32280aa Corrected description of command -preparer_id 2019-12-23 12:39:32 +01:00
Thomas Schmitt 239244157b Followed advice of Open Group about shell command "test" 2019-12-22 17:02:02 +01:00
Thomas Schmitt b97841b782 Shielded processing of user arguments against leading dashes 2019-12-21 11:07:39 +01:00
Thomas Schmitt 42df8f913c Fixed the test for mounted devices after umount. Regression by 8fee0fc. 2019-12-16 13:11:55 +01:00
Thomas Schmitt 93ebe301f7 Removed the work copy xorriso-dd-target.xdt 2019-12-15 19:49:57 +01:00
Thomas Schmitt 39163b64c8 Replaced xorriso-dd-target by xorriso-dd-target.xdt 2019-12-15 19:47:38 +01:00
Thomas Schmitt 8fee0fce40 Created function xdt_unmount from xdt_write_image 2019-12-14 17:13:01 +01:00
Thomas Schmitt b8a2a0bdd3 Created function xdt_predict_su_power from end of xdt_arg_interpreter 2019-12-14 15:21:27 +01:00
Thomas Schmitt a3a351bb59 Improved handling of dd failure 2019-12-12 23:26:04 +01:00
Thomas Schmitt f6c56febbf Some corrections of the previous commit 2019-12-12 20:59:09 +01:00
Thomas Schmitt ab2af1dff2 A version of xorriso-dd-target with xdt_-prefixed symbols and return instead of exit 2019-12-12 20:31:14 +01:00
Thomas Schmitt ac018842da Trying to avoid race conditions with automounters during and after -plug_test 2019-12-10 16:45:32 +01:00
Thomas Schmitt 1efa98ae40 Small fixes with help text and program message 2019-12-09 21:40:58 +01:00
Thomas Schmitt 6bfdd2f9d9 Disabled -list_long before giving device overview after rejected -DO_WRITE 2019-12-09 14:21:57 +01:00
Thomas Schmitt 27bc463332 Exchanged two-byte UTF-8 characters by ASCII lookalikes 2019-12-09 13:26:31 +01:00
Thomas Schmitt e5d86b3a13 Giving device detected by -plug_test an extra second to settle 2019-12-08 21:52:41 +01:00
Thomas Schmitt 697c8cc1f9 Forcing locale "C" to avoid grep ambiguities and locale bugs 2019-12-08 19:39:09 +01:00
Thomas Schmitt 157cb19092 Equipped xorriso-dd-target -dummy_force example with -list_long 2019-12-08 15:19:22 +01:00
Thomas Schmitt 03ae735c85 Brought xorriso-dd-target into libisoburn 2019-12-08 15:18:11 +01:00
Thomas Schmitt 2a8894a5c6 Added forgotten initialization of variable umount_cmd 2019-12-08 14:37:19 +01:00
Thomas Schmitt 1f6504f7bb Updated authorship, change log and web page 2019-12-07 22:33:17 +01:00
Thomas Schmitt 1b22aa5465 Removed option -list_long_after, changed -list_long_inline to -list_long 2019-12-07 21:28:13 +01:00
Thomas Schmitt d315b65d17 Brought xorriso-dd-target into GNU xorriso 2019-12-07 18:58:44 +01:00
Thomas Schmitt ba505e86c9 Imposing stricter checks on option parameters 2019-12-07 15:35:41 +01:00
Thomas Schmitt 51994a7571 Experimental options -list_long_inline -list_long_after 2019-12-07 09:58:55 +01:00
Thomas Schmitt fd04b110fd New reason looks_like_loopdev- 2019-12-06 13:02:43 +01:00
Thomas Schmitt 3ac5dba1c7 Excluding loop devices from being considered 2019-12-06 09:25:50 +01:00
Thomas Schmitt 98c301e7b9 Letting round_down_div_million() convert small numbers to 0 2019-12-05 20:11:19 +01:00
Thomas Schmitt a28ad87aae Clarified in man page the use of option -with_vendor_model 2019-12-05 18:27:31 +01:00
Thomas Schmitt a09ed16fc3 Tell no_bus_info- rather than not_usb- if lsblkd -o TRAN fails 2019-12-05 18:17:17 +01:00
Thomas Schmitt 5e727b43ad Rejecting zram[0-9] as candidate device 2019-12-05 18:15:55 +01:00
Thomas Schmitt c0b650bebb Simplified the pipeline which obtains the partition device files 2019-12-04 17:18:14 +01:00
Thomas Schmitt e226486172 Taking inability to determine -image_file size as reason to abort 2019-12-04 12:31:53 +01:00
Thomas Schmitt 245102072c Unwrapped the tree usages of vraiable sudo_cmd, because it can be empty 2019-12-04 12:18:57 +01:00
Thomas Schmitt f419f51f1e Rejecting device names which are not a single word 2019-12-03 22:07:34 +01:00
Thomas Schmitt 7fa1f82ed9 Removed unused variable 2019-12-03 21:47:07 +01:00
Thomas Schmitt 3bf01c109d Replaced fgrep by grep -F 2019-12-03 21:41:17 +01:00
Thomas Schmitt f7f484de20 Wrapped command path variables in double quotes 2019-12-03 20:54:45 +01:00
Thomas Schmitt 02e55a9dbc Enabled real writing in xorriso-dd-target 2019-12-03 10:58:11 +01:00
Thomas Schmitt 6de23e96de Avoided to show mount lines again after -dummy umount 2019-12-03 10:34:19 +01:00
Thomas Schmitt 74f05d33f5 Made changes to -plug_test step 3 2019-12-02 19:56:08 +01:00
Thomas Schmitt 9b711f20ec Reassured success of unmount 2019-12-02 17:13:00 +01:00
Thomas Schmitt 23bce9c669 Added info and man page for xorriso-dd-target 2019-12-02 10:59:14 +01:00
Thomas Schmitt a6ab055153 Small fixes of problems found while writing documentation 2019-12-02 10:56:15 +01:00
Thomas Schmitt 9ffb3ff2d5 Running sudo early in order to get the possible password prompt 2019-11-30 19:49:54 +01:00
Thomas Schmitt 099d24f740 Added option -dummy_force 2019-11-30 18:35:31 +01:00
Thomas Schmitt 69ce40b6d4 Added a confirmation prompt to -plug_test controlled write runs 2019-11-30 17:26:18 +01:00
Thomas Schmitt b0db123119 Added pacifier dots to the waiting loop of -plug_test 2019-11-30 15:59:28 +01:00
Thomas Schmitt b8f77670d9 Introduced option -plug_test 2019-11-30 15:18:47 +01:00
Thomas Schmitt 81272c80ca Introduced option -dummy and enabled real unmounting 2019-11-30 13:06:16 +01:00
Thomas Schmitt e36596b8d4 Assessing which partitions are really mounted. Made sure that a bus related reason is shown if bus was inquired. Improved hint and usage text. 2019-11-30 10:18:25 +01:00
Thomas Schmitt fe46a2d983 Beginning public development of xorriso-dd-target 2019-11-29 12:13:42 +01:00
Thomas Schmitt ea863307a4 Added options --md5 and --sha256 to Jigdo releng test 2019-11-26 20:38:18 +01:00
Thomas Schmitt 9028117c01 Removed some surplus blanks 2019-11-26 20:28:48 +01:00
Thomas Schmitt b35e119f15 Updated change log and web page 2019-11-24 13:57:49 +01:00
Thomas Schmitt 1557304c96 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". 2019-11-24 13:34:30 +01:00
Thomas Schmitt c4894d8ae3 Reacted on compiler warnings of Debian Sid 2019-11-23 14:31:14 +01:00
Thomas Schmitt 78a2a377dd Fixed another spelling error found by fossies.org with codespell 2019-10-30 20:40:15 +01:00
Thomas Schmitt c8b9c9a244 Fixed spelling errors found by fossies.org with codespell 2019-10-28 15:34:56 +01:00
Thomas Schmitt 5903885d45 Updated change log 2019-10-27 17:52:40 +01:00
Thomas Schmitt 614e36ff21 Made number transition to 1.5.3 2019-10-27 17:51:21 +01:00
Thomas Schmitt 74d9160401 Documented changes and release timestamp 2019-10-26 20:22:06 +02:00
Thomas Schmitt 3c8f270099 Version leap to libisoburn-1.5.2 2019-10-26 20:19:25 +02:00
Thomas Schmitt e2c71a34d0 Bug fix: -osirrox "concat_split_on" worked only together with -split_size larger than 0. Thanks William Willems. 2019-10-11 12:46:50 +02:00
Thomas Schmitt cb597ec570 Clarified the message for file paths which are much too long 2019-09-29 22:55:25 +02:00
Thomas Schmitt a6328e82fc Prevented -report_system_area as_mkisofs from combining -efi-boot-part with -e --interval:appended_partition 2019-09-29 22:54:19 +02:00
Thomas Schmitt 901939986a New command -drive_access, new -as cdrecord option --drive_not_exclusive 2019-09-08 12:30:52 +02:00
Thomas Schmitt 8828d6f465 Bug fix: -disk_pattern on -add "" -- yielded SIGSEGV 2019-09-01 09:25:03 +02:00
Thomas Schmitt 7066fd4e2f Improved rejection message in case case of local root directory as input file 2019-09-01 09:22:38 +02:00
Thomas Schmitt 4db0aab0cb Bug fix: -disk_pattern on -add ./ -- mistook "./" for the root directory 2019-09-01 09:18:05 +02:00
Thomas Schmitt fe5fd8eefa Changed strncpy() to memcpy() in order to please static analyzers 2019-08-14 16:48:23 +02:00
Thomas Schmitt 06346c1e98 Prevented potential string overruns. Thanks Eliska Svobodova. 2019-08-14 16:18:48 +02:00
Thomas Schmitt 3eba8cc921 Closed potential memory leaks. Thanks Eliska Svobodova. 2019-08-14 11:40:53 +02:00
Thomas Schmitt b356291700 Added a missing pointer initialization. Thanks Eliska Svobodova. 2019-08-13 18:19:33 +02:00
Thomas Schmitt e17db6aa3e Avoided potential dereference of NULL. Thanks Eliska Svobodova. 2019-08-13 18:04:59 +02:00
Thomas Schmitt 56a596208c Changed all occurences of (1<<31) to (1u<<31). Thanks Eliska Svobodova. 2019-08-12 21:08:41 +02:00
Thomas Schmitt fb61be034f Fixed a comparation report text problem with files of 4 GiB or larger. Thanks Eliska Svobodova. 2019-08-12 17:29:05 +02:00
Thomas Schmitt e3ff5a971f Enabled verbous error reporting of iso_node_set_acl_text() 2019-07-24 16:16:23 +02:00
Thomas Schmitt 321a0476fa Bug fix: Very large ACL texts led to SIGSEGV with -setfacl* commands. Thanks Eliska Svobodova. 2019-07-24 09:38:28 +02:00
Thomas Schmitt 397551f9d4 With report_system_area of iso_mbr_part_type: give MBR precedence over GPT 2019-07-22 20:14:53 +02:00
Thomas Schmitt 3b0abc14c0 Improved -toc summary of sessions with multiple tracks or non-data sessions 2019-07-13 17:30:47 +02:00
Thomas Schmitt c0ad17b2d0 Updated change log and web page 2019-07-06 15:40:28 +02:00
Thomas Schmitt 31450dcc93 Updated year in copyright message texts 2019-05-02 19:56:01 +02:00
Thomas Schmitt aa50f5cc2f Re-assessing drive status after automatic formatting by a write run 2019-05-02 19:54:45 +02:00
Thomas Schmitt 1eb51f44da grub-mkrescue-sed.sh: MKRESCUE_SED_IN_EFI_NO_PT="extra" to erase MBR signature 2019-04-22 20:38:37 +02:00
Thomas Schmitt 95c2e7cbda Correction of default output of command -status about -iso_nowtime 2019-04-22 10:22:48 +02:00
Thomas Schmitt 3a2a3ba737 New control variable for grub-mkrescue-sed.sh: MKRESCUE_SED_IN_EFI_NO_PT 2019-04-22 10:21:23 +02:00
Thomas Schmitt 5b62c55d12 Bug fix: Environment variable SOURCE_DATE_EPOCH did not affect synthetic files 2019-04-18 11:30:34 +02:00
Thomas Schmitt 1f8d9c7a44 New command -iso_nowtime to set fixed timestamp for synthetic files 2019-04-18 11:28:35 +02:00
Thomas Schmitt e9a424add1 Displaying directory tree sizes with -update and -update_r 2019-04-08 13:55:58 +02:00
Thomas Schmitt 1ff09139d4 Disabled autotools macro AM_MAINTAINER_MODE on advise of Ross Burton 2019-04-07 10:28:19 +02:00
Thomas Schmitt 720d28940c Made GNU xorriso ready for building out-of-source. Thanks Ross Burton. 2019-04-05 19:25:02 +02:00
Thomas Schmitt 0722502075 Made libisoburn ready for building out-of-source. Thanks Ross Burton. 2019-04-05 18:23:32 +02:00
Thomas Schmitt 7a1cac338f Updated xorriso timestamp 2019-02-18 13:21:02 +01:00
Thomas Schmitt fc71cec8f7 Enabled GPT type GUIDs with -append_partition, -boot_image any iso_mbr_part_type=, and -as mkisofs -iso_mbr_part_type 2019-02-18 13:19:32 +01:00
Thomas Schmitt caf38e81ae 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() 2019-02-18 13:03:37 +01:00
Thomas Schmitt 122e43da86 Updated change log and web page 2019-01-10 20:44:28 +01:00
Thomas Schmitt c56842e9a6 Improved recognizability of copyright and license statements in various files 2019-01-10 20:34:25 +01:00
Thomas Schmitt b8ee16af4a Changed prescription for safe loading of tray before xorrisofs add-on session 2018-11-11 14:43:43 +01:00
Thomas Schmitt ff68bda006 Re-enabled unconditional reporting of MD5 tags with -check_media 2018-11-01 11:04:13 +01:00
Thomas Schmitt 9cfd466b8f Silenced gcc warning about printf target buffer 2018-10-21 13:09:16 +02:00
Thomas Schmitt 22aa52ba17 Silenced gcc warnings about printf target buffer 2018-10-12 12:42:52 +02:00
Thomas Schmitt 1002df950d Displaying data file sizes with -update and -update_r 2018-10-10 13:48:51 +02:00
Thomas Schmitt 05732a210b Corrected typo in documentation (found by younger lintian) 2018-10-10 13:46:55 +02:00
Thomas Schmitt 1efe7aaea6 Corrected typo in documentation (found by lintian) 2018-09-24 12:13:38 +02:00
Thomas Schmitt c338597dd7 Updated change log and web page 2018-09-16 17:11:23 +02:00
Thomas Schmitt c2b33f4d64 Updated copyright messages 2018-09-16 17:09:36 +02:00
Thomas Schmitt 08355f7246 Made number transition to 1.5.1 2018-09-16 17:08:20 +02:00
100 changed files with 19036 additions and 3240 deletions

View File

@ -1,3 +1,4 @@
Thomas Schmitt
Vreixo Formoso Lopes
Nio Wiklund alias sudodus

108
ChangeLog
View File

@ -1,3 +1,111 @@
git clone git@dev.lovelyhq.com:libburnia/libisoburn.git
(to become libisoburn-1.5.8 or higher)
===============================================================================
* Bug fix: -boot_image and -append_partition were not perceived as image
manipulation which makes production of an ISO image worthwhile.
Thanks Cameron Seader.
* New -append_partition pseudo partition_number "all" and
pseudo type_code "revoke"
* New bit1 with API call Xorriso_change_is_pending() issues a note if
return is 0 and indev and outdev point to different drives
* New -as mkisofs options -cut_out and -hide_iso_path
* Improved handling of hidden boot images in -boot_image cmd/as_mkisofs/replay
GNU xorriso-1.5.6.pl02.tar.gz Wed Jun 14 2023
===============================================================================
* Bug fix: On non-GNU/Linux systems ssize_t was not defined in libisofs file
rockridge.h . Report and fix proposal by Rui Chen.
GNU xorriso-1.5.6.pl01.tar.gz Mon Jun 12 2023
===============================================================================
(A failed attempt to create a tarball with a fixed libisofs/rockridge.h)
libisoburn-1.5.6.tar.gz Wed Jun 07 2023
===============================================================================
* Bug fix: False -status failure with -boot_image --interval:appended_partition
* Bug fix: -no_rc prevented pre-scanning of arguments for stdio output and
others. Introduced by mistake in a62f6af5, 2011.10.18.162119.
* Bug fix: -not_leaf and -not_paths were not applied to -extract and alike
* Bug fix: -report_system_area cmd misperceived -part_like_isohybrid with
-isohybrid-gpt-basdat
* Bug fix: -report_system_area cmd misperceived combination of isohybrid and
appended partition in GPT
* Bug fix: -as mkisofs option -part_like_isohybrid did not cause a MBR
partition table if the partitions are data files in the ISO
rather than appended
* Bug fix: Split file directories (-split_size) were created with wrong
permissions
* Bug fix: libisofs did not mark clones of imported files as imported.
This could cause that original and clone occupy data storage
in the newly written session. Thanks to Ivan Shmakov.
* Bug fix: Partition offset was preserved from -indev rather than from -outdev
* Bug fix: libisofs could misrepresent Rock Ridge information if many
symbolic links or AAIP data were recorded in a directory
* Bug fix: Data files named /boot.catalog or ./boot.cat could be left out of
the emerging ISO if the boot catalog was set to be hidden
* Bug fix: -toc reported wrong track LBA with overwritable media with
unrecognized content (pseudo-closed)
* Bug fix: -find test -has_xattr matched "isofs." attributes
in -xattr mode "any"
* New API call isoburn_assess_written_features()
* New API calls isoburn_igopt_set_max_ce_entries(),
isoburn_igopt_get_max_ce_entries()
* New flag bit12 with isoburn_read_iso_head():
Read even if start of multi-session emulation is damaged
* New -boot_image settings gpt_iso_bootable= and gpt_iso_not_ro=
* New -as mkisofs options --gpt-iso-bootable and --gpt-iso-not-ro
* New -as cdrecord option --obs_pad. Automatic no_emul_toc with -as cdrecord.
* New parameters "obs_pad" and "bdr_obs_exempt" for -dvd_obs
* New -as cdrecord option --bdr_obs_exempt
* New command -assess_indev_features
* New -find test -size
* New -compliance rules max_ce_entries=, max_ce_drop=
* Allowed lseekable device files with -cut_out.
Proof-of-concept by Ivan Shmakov on bugs.debian.org. (Closes: #1010098)
libisoburn-1.5.4.tar.gz Sat Jan 30 2021
===============================================================================
* Bug fix: -report_system_area as_mkisofs misrepresented GPT with appended
partition and forced boot flag as -part_like_isohybrid
* Bug fix: Boot catalog could get a wrong name if cat_path= is explicitely
given but not containing a slash character
* New helper script xorriso-dd-target
* New command -truncate_overwritable
* Switched to usage of libjte-2.0.0
* New -jigdo parameters "checksum_algorithm", "demand_checksum",
"-checksum-list"
* New -as mkisofs options "-jigdo-checksum-algorithm", "-checksum-list",
"-jigdo-force-checksum"
* New -read_speed prefixes "soft_force:" and "soft_corr:"
* New -check_media option data_to="-" for standard output
* New -zisofs parameters version_2=, block_size_v2=, max_bpt=, max_bpt_f=,
bpt_target=, bpt_free_ratio=, by_magic=v2, susp_z2=
* New -as mkisofs options --zisofs-version-2, --zisofs2-susp-z2,
--zisofs2-susp-zf
* Enabled recognition of zisofs by magic without zlib support
* New -osirrox option sparse= controls extraction into sparse files
* New libisoburn extension options isoburn_ropt_map_joliet_stripped and
isoburn_ropt_map_joliet_unmapped
* New command -joliet_map
* New command -extract_boot_images
* New API call isoburn_ropt_get_tree_loaded()
libisoburn-1.5.2.tar.gz Sat Oct 26 2019
===============================================================================
* Bug fix: -disk_pattern on -add ./ -- mistook "./" for the root directory
Thanks JBThiel.
* Bug fix: -disk_pattern on -add "" -- yielded SIGSEGV
* Bug fix: -osirrox "concat_split_on" worked only together with -split_size
larger than 0. Thanks William Willems.
* New command -drive_access, new -as cdrecord option --drive_not_exclusive
* New API calls isoburn_igopt_set_part_type_guid(),
isoburn_igopt_get_part_type_guid(), isoburn_igopt_set_iso_type_guid(),
isoburn_igopt_get_iso_type_guid()
* Enabled GPT type GUIDs with -append_partition,
-boot_image any iso_mbr_part_type=, and -as mkisofs -iso_mbr_part_type
* Made libisoburn and GNU xorriso ready for building out-of-source.
Thanks Ross Burton.
libisoburn-1.5.0.tar.gz Sat Sep 15 2018
===============================================================================
* Bug fix: Multi-session emulation was not recognized with non-zero partition

View File

@ -1,4 +1,8 @@
# Copyright (C) 2006 - 2008 Vreixo Formoso <metalpain2002@yahoo.es>
# Copyright (C) 2008 - 2019 Thomas Schmitt <scdbackup@gmx.net>
# Provided under GPL version 2 or later.
# ts A90315 : LIBBURNIA_PKGCONFDIR is defined OS specific in acinclude.m4
# was: pkgconfigdir=$(libdir)/pkgconfig
pkgconfigdir=$(LIBBURNIA_PKGCONFDIR)
@ -176,9 +180,12 @@ 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
# A Proof-of-concept for frontends, and xorriso-dd-target if on Linux kernel
bin_SCRIPTS = \
frontend/xorriso-tcltk
frontend/xorriso-tcltk \
$(XORRISO_DD_TARGET)
EXTRA_SCRIPTS = xorriso-dd-target/xorriso-dd-target
## ========================================================================= ##
@ -238,13 +245,25 @@ man_MANS = \
xorriso/xorriso.1 \
xorriso/xorrisofs.1 \
xorriso/xorrecord.1 \
xorriso/xorriso-tcltk.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/xorriso-tcltk.texi \
xorriso-dd-target/xorriso-dd-target.texi
# xorriso-dd-target.texi is hardcoded for now because of
# Makefile.am: error: texinfo file '@XORRISO_DD_TARGET_TEXI@' has
# unrecognized extension
# $(XORRISO_DD_TARGET_TEXI)
#
# EXTRA_TEXINFOS = xorriso-dd-target/xorriso-dd-target.texi
# To have a file in releng_generated_data. If the directory itself is listed
# in Makefile.am EXTRA_DIST, then its .svn subdir gets into the tarball.
@ -266,6 +285,7 @@ EXTRA_DIST = \
frontend/sh_on_named_pipes.sh \
frontend/xorriso_broker.sh \
frontend/grub-mkrescue-sed.sh \
xorriso-dd-target/xorriso-dd-target \
README \
AUTHORS \
CONTRIBUTORS \

2
NEWS Normal file
View File

@ -0,0 +1,2 @@
Please see ChangeLog for bug fixes and novelties.

38
README
View File

@ -4,9 +4,9 @@
libisoburn and xorriso. By Vreixo Formoso <metalpain2002@yahoo.es>
and Thomas Schmitt <scdbackup@gmx.net>
Integrated sub project of libburnia-project.org.
http://files.libburnia-project.org/releases/libisoburn-1.5.0.tar.gz
http://files.libburnia-project.org/releases/libisoburn-1.5.6.tar.gz
Copyright (C) 2006-2009 Vreixo Formoso,
Copyright (C) 2006-2018 Thomas Schmitt.
Copyright (C) 2006-2023 Thomas Schmitt.
Provided under GPL version 2 or later.
------------------------------------------------------------------------------
@ -36,17 +36,17 @@ By using this software you agree to the disclaimer at the end of this text:
Compilation, First Glimpse, Installation
Dynamic library and compile time header requirements for libisoburn-1.5.0 :
- libburn.so.4 , version libburn-1.5.0 or higher
- libisofs.so.6 , version libisofs-1.5.0 or higher
Dynamic library and compile time header requirements for libisoburn-1.5.6 :
- libburn.so.4 , version libburn-1.5.6 or higher
- libisofs.so.6 , version libisofs-1.5.6 or higher
libisoburn and xorriso will not start with libraries which are older than their
include headers seen at compile time.
Obtain libisoburn-1.5.0.tar.gz, take it to a directory of your choice
Obtain libisoburn-1.5.6.tar.gz, take it to a directory of your choice
and do:
tar xzf libisoburn-1.5.0.tar.gz
cd libisoburn-1.5.0
tar xzf libisoburn-1.5.6.tar.gz
cd libisoburn-1.5.6
Within that directory execute:
@ -250,6 +250,23 @@ 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
@ -306,7 +323,7 @@ libburnia-project.org
By Mario Danic <mario.danic@gmail.com>,
Vreixo Formoso <metalpain2002@yahoo.es>
Thomas Schmitt <scdbackup@gmx.net>
Copyright (C) 2006-2018 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
@ -322,3 +339,6 @@ Libburn. By Derek Foreman <derek@signalmarketing.com> and
Copyright (C) 2002-2006 Derek Foreman and Ben Jansens
libisoburn does not stem from their code.
The libisoburn release contains xorriso-dd-target
Copyright (C) 2019 Nio Wiklund alias sudodus, Thomas Schmitt

View File

@ -1,3 +1,8 @@
dnl Copyright (C) 2008 - 2019 Thomas Schmitt <scdbackup@gmx.net>
dnl Copyright (C) 2000-2002, 2007-2009 Free Software Foundation, Inc.
dnl Provided under GPL version 2 or later.
AC_DEFUN([LIBBURNIA_SET_FLAGS],
[
case $target_os in
@ -22,6 +27,7 @@ AC_DEFUN([TARGET_SHIZZLE],
AC_MSG_CHECKING([target operating system])
libburn_check_libcam=
LIBBURNIA_SUPP_ACL=none
LIBBURNIA_SUPP_FATTR=none
LIBBURNIA_LDCONFIG_CMD="echo 'No ldconfig run performed. If needed, configure manually for:'"
@ -45,6 +51,7 @@ AC_DEFUN([TARGET_SHIZZLE],
*-kfreebsd*-gnu*)
ARCH=freebsd
LIBBURN_ARCH_LIBS=-lcam
libburn_check_libcam=yes
;;
*-solaris*)
ARCH=solaris
@ -56,8 +63,12 @@ AC_DEFUN([TARGET_SHIZZLE],
# AC_ERROR([You are attempting to compile for an unsupported platform])
;;
esac
AC_MSG_RESULT([$ARCH])
if test x"$libburn_check_libcam" = xyes
then
LIBBURNIA_CHECK_LIBCAM
fi
])
@ -267,12 +278,12 @@ dnl It tests whether -Wl,--version-script=... works with the compiler
AC_DEFUN([LIBISOBURN_ASSERT_VERS_LIBS],
[
libburnia_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -Wl,--version-script=libisoburn/libisoburn.ver"
LDFLAGS="$LDFLAGS -Wl,--version-script=$srcdir/libisoburn/libisoburn.ver"
AC_TRY_LINK([#include <stdio.h>], [printf("Hello\n");],
[vers_libs_test="yes"], [vers_libs_test="no"])
if test x$vers_libs_test = xyes
then
LIBLDFLAGS="-Wl,--version-script=libisoburn/libisoburn.ver"
LIBLDFLAGS="-Wl,--version-script=$srcdir/libisoburn/libisoburn.ver"
fi
LDFLAGS="$libburnia_save_LDFLAGS"
AC_SUBST(LIBLDFLAGS)
@ -347,6 +358,7 @@ dnl It tests whether the OS dependent libraries are available.
dnl With libisoburn they are needed only for the case that indirect linking
dnl does not work. So it is worth a try to omit them.
dnl $1 = "mandatory" or "optional" define the action if test linking fails.
dnl "silent" is like "optional" but without message.
AC_DEFUN([LIBBURNIA_CHECK_ARCH_LIBS],
[
libburnia_save_LIBS="$LIBS"
@ -367,11 +379,19 @@ AC_DEFUN([LIBBURNIA_CHECK_ARCH_LIBS],
echo >&2
(exit 1); exit 1;
else
echo "disabled linking with $LIBBURN_ARCH_LIBS (because not found)"
if test x"$1" = xoptional
then
echo "disabled linking with $LIBBURN_ARCH_LIBS (because not found)"
fi
LIBBURN_ARCH_LIBS=""
fi
else
echo "enabled linking with $LIBBURN_ARCH_LIBS"
if test x"$1" = xsilent
then
dummy=dummy
else
echo "enabled linking with $LIBBURN_ARCH_LIBS"
fi
fi
fi
])
@ -382,18 +402,72 @@ 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([
libburn_scsi_disabled=
if test x"$ARCH" = xlinux
then
AH_TEMPLATE([Libburn_use_sg_dummY],
[Define to compile without OS specific SCSI features])
AC_MSG_CHECKING([for missing scsi/scsi.h on Linux])
AC_TRY_COMPILE([
#ifdef __linux
#include <scsi/scsi.h>
#endif
],
[;],
[AC_MSG_RESULT([no])],
[AC_DEFINE([Libburn_use_sg_dummY], [yes])
AC_MSG_RESULT([yes])]
)
],
[;],
[AC_MSG_RESULT([no])],
[AC_DEFINE([Libburn_use_sg_dummY], [yes])
libburn_scsi_disabled=yes
AC_MSG_RESULT([yes])]
)
fi
if test x"$libburn_scsi_disabled" = xyes
then
echo "disabled operation of optical drives via SCSI"
fi
])
dnl LIBBURNIA_CHECK_LIBCAM is by Thomas Schmitt, libburnia project
dnl
AC_DEFUN([LIBBURNIA_CHECK_LIBCAM],
[
dnl Check whether libcam is requested for FreeBSD kernel but missing
libburn_scsi_disabled=
if test x"$LIBBURN_ARCH_LIBS" = x"-lcam"
then
AH_TEMPLATE([Libburn_use_sg_dummY],
[Define to compile without OS specific SCSI features])
AC_MSG_CHECKING([for missing libcam for SCSI on FreeBSD kernel])
dnl If libcam is not available, LIBBURN_ARCH_LIBS will be made empty
LIBBURNIA_CHECK_ARCH_LIBS(silent)
if test x"$LIBBURN_ARCH_LIBS" = x
then
AC_DEFINE([Libburn_use_sg_dummY], [yes])
libburn_scsi_disabled=yes
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
fi
if test x"$LIBBURN_ARCH_LIBS" = x"-lcam"
then
AC_MSG_CHECKING([for missing libcam headers])
AC_TRY_COMPILE([
#include <stdio.h>
#include <camlib.h>
#include <cam/scsi/scsi_message.h>
#include <cam/scsi/scsi_pass.h>
],
[;],
[AC_MSG_RESULT([no])],
[AC_DEFINE([Libburn_use_sg_dummY], [yes])
libburn_scsi_disabled=yes
AC_MSG_RESULT([yes])]
)
fi
if test x"$libburn_scsi_disabled" = xyes
then
echo "disabled operation of optical drives via SCSI"
fi
])

View File

@ -1,6 +1,6 @@
AC_INIT([libisoburn], [1.5.0], [http://libburnia-project.org])
AC_INIT([libisoburn], [1.5.7], [http://libburnia-project.org])
AC_PREREQ([2.50])
dnl AC_CONFIG_HEADER([config.h])
dnl AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
@ -11,7 +11,7 @@ AM_INIT_AUTOMAKE([subdir-objects])
AC_CONFIG_MACRO_DIR([./])
dnl Hint: Search list for version code aspects:
dnl /AC_INIT(
dnl /AC_INIT
dnl /ISOBURN_.*_VERSION
dnl /LT_.*
dnl /LIB.*_REQUIRED
@ -24,7 +24,7 @@ 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=0
ISOBURN_MICRO_VERSION=7
dnl ISOBURN_VERSION=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION.$ISOBURN_MICRO_VERSION
@ -37,16 +37,16 @@ dnl Libtool versioning
dnl Generate libisoburn.so.1.x.y
dnl SONAME will become LT_CURRENT - LT_AGE
dnl
dnl ts B80915
dnl This is the release version 1.5.0 = libisoburn.so.1.107.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 ts C30607
dnl ### This is the release version 1.5.6 = libisoburn.so.1.113.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 = 108 - 107 = 1 . Library name = libisoburn.so.1.107.0
dnl SONAME = 115 - 114 = 1 . Library name = libisoburn.so.1.114.0
LT_RELEASE=$ISOBURN_MAJOR_VERSION.$ISOBURN_MINOR_VERSION
LT_CURRENT=108
LT_AGE=107
LT_CURRENT=115
LT_AGE=114
LT_REVISION=0
LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
@ -59,12 +59,12 @@ AC_SUBST(LT_CURRENT_MINUS_AGE)
AC_PREFIX_DEFAULT([/usr/local])
test "$prefix" = "NONE" && prefix=$ac_default_prefix
AM_MAINTAINER_MODE
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
@ -133,6 +133,23 @@ 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)
@ -275,11 +292,11 @@ AC_SUBST(ZLIB_DEF)
dnl ts B00928
AC_ARG_ENABLE(libjte,
[ --enable-libjte Enable use of libjte by xorriso, default=yes],
[ --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_new, , LIBJTE_DEF= ), LIBJTE_DEF= )
AC_CHECK_HEADER(libjte/libjte.h, AC_CHECK_LIB(jte, libjte_set_checksum_algorithm, , LIBJTE_DEF= ), LIBJTE_DEF= )
else
LIBJTE_DEF=
fi
@ -442,8 +459,8 @@ 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.0
LIBISOFS_REQUIRED=1.5.0
LIBBURN_REQUIRED=1.5.7
LIBISOFS_REQUIRED=1.5.6
PKG_CHECK_MODULES(LIBBURN, libburn-1 >= $LIBBURN_REQUIRED)
PKG_CHECK_MODULES(LIBISOFS, libisofs-1 >= $LIBISOFS_REQUIRED)
if test x$LIBCDIO_DEF = x; then

View File

@ -9,47 +9,47 @@ Please post your questions to
Google favorites:
[xorriso not found](#xorriso_not_found)
[xorriso not found](FAQ#xorriso_not_found)
[xorriso tutorial](#xorriso_tutorial)
[xorriso tutorial](FAQ#xorriso_tutorial)
[xorriso create ISO image](#xorriso_create_iso)
[xorriso create ISO image](FAQ#xorriso_create_iso)
Burning:
[What is the difference between cdrskin and xorriso ?](#diff_cdrskin_xorriso)
[What is the difference between cdrskin and xorriso ?](FAQ#diff_cdrskin_xorriso)
[What does that SCSI error message mean ?](#scsi_error)
[What does that SCSI error message mean ?](FAQ#scsi_error)
[Why is simultaneous burning with multiple drives so slow ?](#concurrent_burn)
[Why is simultaneous burning with multiple drives so slow ?](FAQ#concurrent_burn)
Imaging:
[Is there a way to edit files inside the ISO image ?](#edit_files)
[Is there a way to edit files inside the ISO image ?](FAQ#edit_files)
[For which architectures xorriso is able to create bootable images ?](#boot_arch)
[For which architectures xorriso is able to create bootable images ?](FAQ#boot_arch)
[How to enable booting from USB stick ?](#isohybrid)
[How to enable booting from USB stick ?](FAQ#isohybrid)
[What is partition offset feature all about?](#partition_offset)
[What is partition offset feature all about?](FAQ#partition_offset)
[Partition offset bad on Apple ?](#partition_offset_apple)
[Partition offset bad on Apple ?](FAQ#partition_offset_apple)
Development:
[Where are the APIs of libburnia libraries described ?](#api_specs)
[Where are the APIs of libburnia libraries described ?](FAQ#api_specs)
[I want to write a GUI on the top of libburnia libraries. Any pointers or recommendations ?](#gui_advise)
[I want to write a GUI on the top of libburnia libraries. Any pointers or recommendations ?](FAQ#gui_advise)
Miscellaneous:
[Where to see examples ?](#example_links)
[Where to see examples ?](FAQ#example_links)
[What personalities are supported by xorriso ?](#xorriso_aliases)
[What personalities are supported by xorriso ?](FAQ#xorriso_aliases)
[What is xorriso dialog mode useful for ?](#xorriso_dialog_mode)
[What is xorriso dialog mode useful for ?](FAQ#xorriso_dialog_mode)
[Why is every second release missing ?](#version_numbers)
[Why is every second release missing ?](FAQ#version_numbers)
------------------------------------------------------------------------
@ -84,7 +84,7 @@ Volunteers are wanted who make a collection of use cases, ask at bug-xorriso
for xorriso instructions to fulfill the needs, and describe both in a
user-readable manner.
Up to then, the GUI demo [xorriso-tcltk](https://dev.lovelyhq.com/libburnia/libisoburn/raw/HEAD/frontend/README-tcltk)
Up to then, the GUI demo [xorriso-tcltk](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/frontend/README-tcltk)
[(screenshot)](http://www.gnu.org/software/xorriso/xorriso-tcltk-screen.gif)
may serve as interactive exploration tool. It needs `xorriso` >= 1.2.6, `Tcl`,
`Tk` >= 8.4, optionally Tcl / Tk package `BWidget`.
@ -232,12 +232,12 @@ supported for systems with EFI firmware with x86 or ARM processor.
Further it supports machines with MIPS processor from SGI (Big Endian)
and DEC (Little Endian), and SUN SPARC machines.
(See [libisofs/doc/boot_sectors.txt](https://dev.lovelyhq.com/libburnia/libisofs/raw/HEAD/doc/boot_sectors.txt)
(See [libisofs/doc/boot_sectors.txt](https://dev.lovelyhq.com/libburnia/libisofs/raw/branch/master/doc/boot_sectors.txt)
for technical details.)
Examples how to get an impression of the boot equipment of existing ISO 9660
images are on the wiki page about xorriso
[commands -report_system_area and -report_el_torito](Reportsystemarea).
[commands -report_system_area and -report_el_torito](ReportSystemArea).
##### How to enable booting from USB stick ? <A NAME="isohybrid">
@ -327,10 +327,10 @@ The decisive references are the inclusion headers of the libraries
and `<libisoburn/xorriso.h>`.
Current git versions of these files:
[libburn/libburn.h](https://dev.lovelyhq.com/libburnia/libburn/raw/HEAD/libburn/libburn.h) ,
[libisofs/libisofs.h](https://dev.lovelyhq.com/libburnia/libisofs/raw/HEAD/libisofs/libisofs.h) ,
[libisoburn/libisoburn.h](https://dev.lovelyhq.com/libburnia/libisoburn/raw/HEAD/libisoburn/libisoburn.h) ,
[libisoburn/xorriso.h](https://dev.lovelyhq.com/libburnia/libisoburn/raw/HEAD/xorriso/xorriso.h)
[libburn/libburn.h](https://dev.lovelyhq.com/libburnia/libburn/raw/branch/master/libburn/libburn.h) ,
[libisofs/libisofs.h](https://dev.lovelyhq.com/libburnia/libisofs/raw/branch/master/libisofs/libisofs.h) ,
[libisoburn/libisoburn.h](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/libisoburn/libisoburn.h) ,
[libisoburn/xorriso.h](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/xorriso/xorriso.h)
##### I want to write a GUI on the top of libburnia libraries. Any pointers or recommendations ? <A NAME="gui_advise">
@ -341,16 +341,16 @@ versa. The xorriso implementation is located inside libisoburn.
Each option that is described in
[man 1 xorriso](http://www.gnu.org/software/xorriso/man_1_xorriso.html)
can be performed by a corresponding C function that is defined in
[xorriso.h](https://dev.lovelyhq.com/libburnia/libisoburn/raw/HEAD/xorriso/xorriso.h)
[xorriso.h](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/xorriso/xorriso.h)
Further there are calls for library startup and shutdown, for problem
handling, and for the interpreters of xorriso's command line interface.
The xorriso API encapsulates calls to libisofs, libburn, and libisoburn.
An alternative to the xorriso C API is xorriso dialog mode.
[See below](#xorriso_dialog_mode).
[See below](FAQ#xorriso_dialog_mode).
The script
[xorriso-tcltk](https://dev.lovelyhq.com/libburnia/libisoburn/raw/HEAD/frontend/xorriso-tcltk)
[xorriso-tcltk](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/frontend/xorriso-tcltk)
demonstrates this approach. It is part of the
libisoburn release tarball and of the GNU xorriso tarball.
@ -370,7 +370,7 @@ here.)
[xorriso examples](http://www.gnu.org/software/xorriso/man_1_xorriso.html#EXAMPLES) ,
[cdrskin examples](http://scdbackup.sourceforge.net/man_1_cdrskin_devel.html#EXAMPLES) ,
[libburner.c a minimal but complete burn program](https://dev.lovelyhq.com/libburnia/libburn/raw/HEAD/test/libburner.c).
[libburner.c a minimal but complete burn program](https://dev.lovelyhq.com/libburnia/libburn/raw/branch/master/test/libburner.c).
##### What personalities are supported by xorriso ? <A NAME="xorriso_aliases">
@ -405,7 +405,7 @@ every now and then to perform various commands in order to complete
complex tasks like image size prediction.
The script
[xorriso-tcltk](https://dev.lovelyhq.com/libburnia/libisoburn/raw/HEAD/frontend/xorriso-tcltk)
[xorriso-tcltk](https://dev.lovelyhq.com/libburnia/libisoburn/raw/branch/master/frontend/xorriso-tcltk)
demonstrates this approach. It is part of the
libisoburn release tarball and of the GNU xorriso tarball.

View File

@ -295,7 +295,7 @@ static int await_all_replies(struct boss_state *boss)
return(-1);
}
if (count == 0) {
fprintf(stderr, "+++ EOF encounterd by Master process\n");
fprintf(stderr, "+++ EOF encountered by Master process\n");
return(-2);
}
for (npt = buf + remainder; npt < buf + count; npt++) {

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (C) 2015 - 2016
# Copyright (C) 2015 - 2022
# Thomas Schmitt <scdbackup@gmx.net>, libburnia-project.org
# Provided under BSD license: Use, modify, and distribute as you like.
@ -117,6 +117,34 @@ fi
# command line.)
# Each argument must be a single word. No whitespace. No quotation marks.
# "yes" in MKRESCUE_SED_IN_EFI_NO_PT overwrites the MBR partition table area
# in the EFI boot image by zeros. Some EFI implementations get stuck when
# seeing in the EFI partition a partition table entry which begins at LBA 0.
# "extra" not only zeros the partition table but also the MBR signature.
efi_zero_inner_pt=no
if test -n "$MKRESCUE_SED_IN_EFI_NO_PT"
then
efi_zero_inner_pt="$MKRESCUE_SED_IN_EFI_NO_PT"
fi
# "yes" in MKRESCUE_SED_UNPACK_EFI_TO_ISO causes the file tree from the FAT
# image efi.img to be unpacked by mcopy to a directory in /tmp which then
# gets mapped into the root directory of the emerging ISO 9660 filesystem.
# This enables a way of installing the result image onto a USB stick with
# FAT filesystem by simply copying its full file tree from ISO to FAT.
# Whether the payload files of the ISO will be able to work from FAT depends
# on their expectation towards file names and attributes.
# WARNING: Make sure that the files in efi.img do not collide with your
# payload files or with files added to the ISO by GRUB. Before using
# MKRESCUE_SED_UNPACK_EFI_TO_ISO, make a vanilla grub-mkrescue ISO
# with your payload, mount it and then its /efi.img file, then use
# program "find" on the mount point of efi.img to see all its files.
# Compare this with the output of "find" on the ISO mount point.
efi_unpack_to_iso=no
if test -n "$MKRESCUE_SED_UNPACK_EFI_TO_ISO"
then
efi_unpack_to_iso="$MKRESCUE_SED_UNPACK_EFI_TO_ISO"
fi
#
# Do the work
@ -180,15 +208,99 @@ done
if test x"$debug" = xextra
then
# Show files on disk
find "$dir"
find "$dir" 2>&1
echo 2>&1
fi
if test x"$efi_zero_inner_pt" = xyes -o x"$efi_zero_inner_pt" = xextra
then
did_dd=0
if test -e "$dir"/efi.img
then
# Look for 0x55 0xAA in bytes 510 and 511
magic=$(dd bs=1 skip=510 count=2 if="$dir"/efi.img 2>/dev/null | \
od -c | head -1 | awk '{print $2 " " $3}')
if test "$magic" = "U 252"
then
echo "Performing actions for MKRESCUE_SED_IN_EFI_NO_PT=$efi_zero_inner_pt" >&2
dd if=/dev/zero bs=1 seek=446 count=64 conv=notrunc of="$dir"/efi.img
did_dd=1
if test "$efi_zero_inner_pt" = extra
then
dd if=/dev/zero bs=1 seek=510 count=2 conv=notrunc of="$dir"/efi.img
fi
echo >&2
fi
fi
if test "$did_dd" = 0
then
echo >&2
echo "$0 : NOTE : No EFI image found or no MBR signature in it." >&2
echo "$0 : NOTE : Will not obey MKRESCUE_SED_IN_EFI_NO_PT=$efi_zero_inner_pt" >&2
echo >&2
fi
fi
efi_temp_tree=
if test x"$efi_unpack_to_iso" = xyes
then
if test -e "$dir"/efi.img
then
temp_tree=/tmp/grub-mkrescue-sed-et."$$"
# The mcopy command is the inverse of what grub-mkrescue does to pack it up
if mcopy -s -i "$dir"/efi.img ::/ "$temp_tree"
then
efi_temp_tree="$temp_tree"
if test x"$debug" = xyes -o x"$debug" = xextra
then
echo "Temporarily extracted $dir/efi.img to $temp_tree" >&2
echo >&2
if test x"$debug" = xextra
then
# Show extracted files
find "$temp_tree" >&2
echo >&2
fi
fi
elif test -e "$temp_tree"
then
rm -r "$temp_tree"
fi
if test -z "$efi_temp_tree"
then
echo >&2
echo "$0 : NOTE : Could not extract efi.img to $temp_tree" >&2
echo "$0 : NOTE : Thus cannot obey MKRESCUE_SED_UNPACK_EFI_TO_ISO." >&2
echo >&2
fi
fi
fi
efi_tmp_name=
if test x"$mode" = xmjg \
-o x"$mode" = xmbr_only \
-o x"$mode" = xgpt_appended \
-o x"$mode" = xmbr_hfs
then
# Move EFI partition image file out of the "$dir" tree, i.e. out of the ISO
efi_tmp_name=grub-mkrescue-sed-ei.$$
if test -e "$dir"/efi.img
then
mv "$dir"/efi.img /tmp/$efi_tmp_name
if test x"$debug" = xyes -o x"$debug" = xextra
then
echo "Temporarily moved $dir/efi.img to /tmp/$efi_tmp_name" >&2
echo >&2
fi
elif test -e /tmp/$efi_tmp_name
then
rm /tmp/$efi_tmp_name
fi
fi
if test x"$mode" = xmjg
then
# Exchange arguments for the experimental GRUB2 mjg layout
efi_tmp_name=grub-mkrescue-sed-efi-img.$$
mv "$dir"/efi.img /tmp/$efi_tmp_name
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition $partno 0xef \/tmp\/$efi_tmp_name/" \
-e "s/--efi-boot efi\.img/-eltorito-alt-boot -e --interval:appended_partition_${partno}:all:: -no-emul-boot -isohybrid-gpt-basdat/" \
@ -207,8 +319,6 @@ then
elif test x"$mode" = xmbr_only
then
# Exchange arguments for no-HFS MBR-only layout
efi_tmp_name=grub-mkrescue-sed-efi-img.$$
mv "$dir"/efi.img /tmp/$efi_tmp_name
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/$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/" \
@ -228,8 +338,6 @@ then
elif test x"$mode" = xmbr_hfs
then
# Exchange arguments for MBR and HFS+ layout
efi_tmp_name=grub-mkrescue-sed-efi-img.$$
mv "$dir"/efi.img /tmp/$efi_tmp_name
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/$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/" \
@ -247,8 +355,6 @@ then
elif test x"$mode" = xgpt_appended
then
# Exchange arguments for no-HFS MBR-only layout
efi_tmp_name=grub-mkrescue-sed-efi-img.$$
mv "$dir"/efi.img /tmp/$efi_tmp_name
x=$(echo " $*" | sed \
-e "s/-efi-boot-part --efi-boot-image/-no-pad -append_partition 2 0xef \/tmp\/$efi_tmp_name -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/" \
@ -275,6 +381,27 @@ else
exit 1
fi
if echo "$efi_temp_tree" | grep '^/tmp/' >/dev/null
then
# Does the xorriso run end in native command mode ?
separator_seen=0
for i in "$@"
do
if test x"$i" = x--
then
separator_seen=1
fi
done
if test "$separator_seen" = 1
then
# Native mode possible: Enable it for sure and then use -map
x=" $x -- -map $efi_temp_tree /"
else
# Hopefully nobody finds a way to leave mkisofs emulation without "--" arg
x=" $x -graft-points /=$efi_temp_tree"
fi
fi
if test x"$debug" = xyes -o x"$debug" = xextra
then
echo "+ converted xorriso arguments:" >&2
@ -302,5 +429,11 @@ then
mv /tmp/$efi_tmp_name "$dir"/efi.img
fi
# Remove possible extracted EFI partition tree
if echo "$efi_temp_tree" | grep '^/tmp/' >/dev/null
then
rm -r "$efi_temp_tree"
fi
exit $ret

Binary file not shown.

View File

@ -43,7 +43,7 @@ export normal_end=0
# ---------------- An interpreter for quoted xorriso replies ----------------
# xorriso commands like -lsl wrap filenames into quotation marks in order
# to unambigously represent any character byte except the 0-byte.
# 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

View File

@ -1,7 +1,7 @@
#!/usr/bin/wish
#
# xorriso-tcltk
# Copyright (C) 2012 - 2018
# Copyright (C) 2012 - 2023
# Thomas Schmitt <scdbackup@gmx.net>, libburnia project.
# Provided under BSD license: Use, modify, and distribute as you like.
#
@ -23,7 +23,7 @@
# And, well, a graphical widget set would be nice.
set own_version "1.5.0"
set own_version "1.5.7"
# Minimum version of xorriso to be used as backend process.
# Older versions of xorriso do not offer commands -msg_op and -launch_frontend
@ -108,7 +108,7 @@ set reply_pipe_adr ""
# The command to send (or the command most recently sent)
set cmdline ""
# Wether to clear the cmdline after sending
# Whether to clear the cmdline after sending
set cmdline_clear true
# Command counter
set cmd_sent 0
@ -182,7 +182,7 @@ set pre_msglist ""
# Whether overwriting of files in the ISO model is allowed
set overwrite_iso_files 1
# If overwrite_iso_files is 1: Wether overwriting of ISO directories is allowed
# 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
@ -248,7 +248,7 @@ proc init_frontend_named_pipes {cmd_pipe reply_pipe} {
set cmd_conn [open $cmd_pipe w]
set reply_conn [open $reply_pipe r]
# Note: disencouraged flags would be necessary for opening idle fifo
# Note: dissuaded flags would be necessary for opening idle fifo
# set reply_conn [open $reply_pipe {RDONLY NONBLOCK}]
}
@ -920,7 +920,7 @@ proc effectuate_permission_policy {} {
# 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 unambigously in one or more text lines.
# 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.
@ -3519,7 +3519,7 @@ set isolist_lines 8
# Whether the message box shall export its selection to the whole X display
set export_msg_selection true
# Wether the item lists shall export their selection
# Whether the item lists shall export their selection
set export_selection false
# The number of lines in the display of the help texts
@ -4333,7 +4333,7 @@ proc bind_help {to_what help_name} {
}
# Create a "/" button and wire it with variable, fileystem type, and help text.
# 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
@ -4609,7 +4609,7 @@ 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 verbous.
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
@ -5396,7 +5396,7 @@ proc make_text_shellsafe {text} {
}
# Count the number of newline chracters in text.
# Count the number of newline characters in text.
#
proc count_newlines {text} {
set rest $text

View File

@ -6,7 +6,7 @@
*/
/* libburn wrappers for libisoburn
Copyright 2007 - 2017 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007 - 2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -99,7 +99,7 @@ int isoburn_initialize(char msg[1024], int flag)
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 indendation is an advise of man gcc to help old compilers ignoring */
/* 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
@ -136,7 +136,7 @@ LIBISOFS_MISCONFIGURATION_ = 0;
error: 'LIBBURN_MISCONFIGURATION_' undeclared (first use in this function)
*/
/* The indendation is an advise of man gcc to help old compilers ignoring */
/* 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
@ -161,7 +161,7 @@ LIBBURN_MISCONFIGURATION_ = 0;
So the requirement is defined in libisofs/libisofs.h :
iso_libjte_req_major , iso_libjte_req_minor , iso_libjte_req_micro
*/
/* The indendation is an advise of man gcc to help old compilers ignoring */
/* 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
@ -333,10 +333,10 @@ int isoburn_is_intermediate_dvd_rw(struct burn_drive *d, int flag)
/** Examines the medium and sets appropriate emulation if needed.
@param flag bit0= pretent blank on overwriteable media
@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 overwriteable media
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
@ -362,7 +362,7 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
enum burn_disc_status s;
#ifndef Hardcoded_cd_rW
int lba, nwa;
off_t lba, nwa;
#endif
s= burn_disc_get_status(d);
@ -401,7 +401,7 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
random_access= caps->start_adr || role == 4;
if(random_access)
(*o)->emulation_mode= 1;
if(random_access && !readonly) { /* set emulation to overwriteable */
if(random_access && !readonly) { /* set emulation to overwritable */
ret= isoburn_is_intermediate_dvd_rw(d, 0);
if(ret>0) {
(*o)->min_start_byte= 0;
@ -437,14 +437,14 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
*/
(*o)->fabricated_disc_status= BURN_DISC_FULL;
/* This might be an overwriteable medium in a -ROM drive.
/* This might be an overwritable medium in a -ROM drive.
Pitfall:
Multi-session media which bear a xorriso image for overwriteables
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 overwriteables. But as soon as the medium
bears 2 logical tracks it cannot be overwriteable.
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);
@ -463,7 +463,7 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
isoburn_msgs_submit(*o, 0x00060000, msg, 0, "DEBUG", 0);
if((flag & 16) || track_count >= 2) {
ret= 0; /* toc emulation off, or not overwriteable */
ret= 0; /* toc emulation off, or not overwritable */
} else {
ret= isoburn_start_emulation(*o, 1);
if(ret<=0) {
@ -505,7 +505,7 @@ static int isoburn_welcome_media(struct isoburn **o, struct burn_drive *d,
#ifdef Hardcoded_cd_rW
(*o)->nwa= Hardcoded_cd_rw_nwA;
#else
ret= burn_disc_track_lba_nwa(d, NULL, 0, &lba, &nwa);
ret= burn_disc_track_lba_nwa_v2(d, NULL, 0, &lba, &nwa);
if(ret>0)
(*o)->nwa= nwa;
if((*o)->nwa < (*o)->zero_nwa)
@ -524,14 +524,14 @@ ex:
/**
@param flag bit0= load
bit1= regard overwriteable media as blank
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 overwriteable media
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
@ -786,7 +786,7 @@ off_t isoburn_disc_available_space(struct burn_drive *d,
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);
burn_write_opts_set_start_byte(eff_opts, o->nwa * (off_t) 2048);
}
avail= burn_disc_available_space(d, eff_opts);
if(local_opts!=NULL)
@ -796,9 +796,9 @@ off_t isoburn_disc_available_space(struct burn_drive *d,
}
int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba)
int isoburn_disc_get_msc1_v2(struct burn_drive *d, off_t *start_lba)
{
int ret;
int ret, int_lba;
struct isoburn *o;
#ifdef Hardcoded_cd_rW
@ -824,13 +824,35 @@ int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba)
*start_lba= 0;
return(1);
}
return(burn_disc_get_msc1(d, start_lba));
ret= burn_disc_get_msc1(d, &int_lba);
if(ret <= 0)
return(ret);
*start_lba= int_lba;
return(ret);
}
int isoburn_disc_track_lba_nwa(struct burn_drive *d,
struct burn_write_opts *opts,
int trackno, int *lba, int *nwa)
int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba)
{
int ret;
off_t long_lba;
ret= isoburn_disc_get_msc1_v2(d, &long_lba);
if(ret <= 0)
return(ret);
if(long_lba > 0x7fffffff) {
*start_lba= 0x7fffffff;
ret= 0;
} else {
*start_lba= long_lba;
}
return(ret);
}
int isoburn_disc_track_lba_nwa_v2(struct burn_drive *d,
struct burn_write_opts *opts,
int trackno, off_t *lba, off_t *nwa)
{
int ret;
struct isoburn *o;
@ -858,19 +880,45 @@ int isoburn_disc_track_lba_nwa(struct burn_drive *d,
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));
return(burn_disc_track_lba_nwa_v2(d, opts, trackno, lba, nwa));
}
int isoburn_disc_track_lba_nwa(struct burn_drive *d,
struct burn_write_opts *opts,
int trackno, int *lba, int *nwa)
{
int ret;
off_t long_lba, long_nwa;
ret= isoburn_disc_track_lba_nwa_v2(d, opts, trackno, &long_lba, &long_nwa);
if(ret <= 0)
return(ret);
if(long_lba > 0x7fffffff) {
*lba= 0x7fffffff;
} else {
*lba= long_lba;
}
if(long_nwa > 0x7fffffff) {
*nwa= 0x7fffffff;
ret= 0;
} else {
*nwa= long_nwa;
}
return(ret);
}
int isoburn_get_msc2(struct isoburn *o,
struct burn_write_opts *opts, int *msc2, int flag)
struct burn_write_opts *opts, off_t *msc2, int flag)
{
int ret, lba, nwa;
int ret;
off_t lba, nwa;
if(o->fabricated_msc2>=0)
*msc2= o->fabricated_msc2;
else {
ret= isoburn_disc_track_lba_nwa(o->drive, opts, 0, &lba, &nwa);
ret= isoburn_disc_track_lba_nwa_v2(o->drive, opts, 0, &lba, &nwa);
if(ret<=0)
return(ret);
*msc2= nwa;
@ -878,6 +926,7 @@ int isoburn_get_msc2(struct isoburn *o,
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
@ -1251,7 +1300,7 @@ int isoburn_report_iso_error(int iso_error_code, char msg_text[], int os_errno,
@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)
off_t *image_blocks, char *info, int flag)
{
int i, info_mode;
@ -1284,13 +1333,15 @@ int isoburn_read_iso_head_parse(unsigned char *data,
}
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)
bit12= read even if the start of multi-session emulation
yielded a read error
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
@ -1298,11 +1349,12 @@ int isoburn_read_iso_head_parse(unsigned char *data,
@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)
int isoburn_read_iso_head_v2(struct burn_drive *d, off_t lba,
off_t *image_blocks, char *info, int flag)
{
unsigned char *buffer= NULL;
int ret, info_mode, capacity, role;
int ret, info_mode, role;
off_t capacity;
off_t data_count, to_read;
struct isoburn *o;
@ -1322,22 +1374,22 @@ int isoburn_read_iso_head(struct burn_drive *d, int lba,
/* >>> ??? return always 0 ? */
{ret= (-1*!!(flag&(1<<15))); goto ex;}
ret = burn_get_read_capacity(d, &capacity, 0);
ret = burn_get_read_capacity_v2(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;
capacity = 0x7fffffffffffffff;
ret = 1;
}
to_read= (off_t) capacity * ((off_t) 2048);
to_read= 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)
if(o->media_read_error && !(flag & (1 << 12)))
{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,
ret = burn_read_data(d, lba * (off_t) 2048, (char *) buffer,
to_read, &data_count, 32); /* error messages as DEBUG */
} else
ret= 0;
@ -1366,8 +1418,23 @@ ex:;
}
int isoburn_make_toc_entry(struct isoburn *o, int *session_count, int lba,
int track_blocks, char *volid, int flag)
int isoburn_read_iso_head(struct burn_drive *d, int lba,
int *image_blocks, char *info, int flag)
{
int ret;
off_t long_image_blocks;
ret= isoburn_read_iso_head_v2(d, (off_t) lba, &long_image_blocks, info, flag);
if(ret <= 0)
return(ret);
/* The old behavior was to return negative numbers on overflow */
*image_blocks= (int) long_image_blocks;
return(ret);
}
int isoburn_make_toc_entry(struct isoburn *o, int *session_count, off_t lba,
off_t track_blocks, char *volid, int flag)
{
int ret;
struct isoburn_toc_entry *item;
@ -1404,9 +1471,10 @@ no_memory:;
*/
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;
int ret, session_count= 0, read_flag= 0;
int probe_minus_16= 0, role, with_enclosure= 0;
off_t image_size= 0, lba, track_blocks, scan_start= 0, scan_count= 0;
off_t growisofs_nwa, 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;
@ -1425,13 +1493,13 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
if(o->emulation_mode<=0 && !(flag&1))
{ret= 0; goto ex;}
ret= burn_get_read_capacity(d, &readable_blocks, 0);
ret= burn_get_read_capacity_v2(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 */
readable_blocks= 0x7fffffffffffffff; /* try to read anyway */
else
readable_blocks= -1;
}
@ -1442,11 +1510,11 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
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);
ret= isoburn_read_iso_head_v2(d, 32, &image_size, NULL, 0);
if(ret > 0)
lba= 32;
} else {
ret= isoburn_read_iso_head(d, lba, &image_size, NULL, 0);
ret= isoburn_read_iso_head_v2(d, lba, &image_size, NULL, 0);
if(ret<=0)
{ret= 0; goto failure;}
lba= o->target_iso_head_size / 2048;
@ -1473,8 +1541,8 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
read_flag|= (1<<15)|((session_count>0)<<14);
else {
/* growisofs aligns to 16 rather than 32. Overwriteable TOC emulation
relies on not accidentially seeing inter-session trash data.
/* 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
@ -1486,7 +1554,7 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
probe_minus_16= 0;
}
ret= isoburn_read_iso_head(d, lba, &track_blocks, volid, read_flag);
ret= isoburn_read_iso_head_v2(d, lba, &track_blocks, volid, read_flag);
if(ret > 0) {
volid_pt= volid;
} else {
@ -1503,8 +1571,8 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
break;
}
sprintf(msg,
"Chain of ISO session headers broken at #%d, LBA %ds",
session_count+1, lba);
"Chain of ISO session headers broken at #%d, LBA %.fs",
session_count+1, (double) lba);
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
if(with_enclosure) {
@ -1521,8 +1589,8 @@ int isoburn_emulate_toc(struct burn_drive *d, int flag)
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);
sprintf(msg, "ISO image size %.fs larger than readable size %.fs",
(double) (lba + track_blocks), (double) readable_blocks);
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
track_blocks= readable_blocks - lba;
}
@ -1560,8 +1628,8 @@ 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);
sprintf(msg, "ISO image size %.fs larger than readable size %.fs",
(double) image_size, (double) readable_blocks);
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
image_size= readable_blocks;
}
@ -1725,10 +1793,11 @@ failure:;
}
int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc)
off_t isoburn_toc_disc_get_sectors_v2(struct isoburn_toc_disc *disc)
{
struct isoburn_toc_entry *t;
int ret= 0, num_sessions, num_tracks, open_sessions= 0, session_idx= -1;
int num_sessions, num_tracks, open_sessions= 0, session_idx= -1;
off_t ret= 0;
struct burn_session **sessions;
struct burn_track **tracks;
struct burn_toc_entry entry;
@ -1759,7 +1828,9 @@ int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc)
}
if(num_tracks > 0) {
burn_track_get_entry(tracks[num_tracks - 1], &entry);
if(entry.extensions_valid & 1)
if(entry.extensions_valid & 8)
ret= entry.long_start_lba + entry.long_track_blocks;
else if(entry.extensions_valid & 1)
ret= entry.start_lba + entry.track_blocks;
}
}
@ -1771,6 +1842,17 @@ int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc)
}
int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc)
{
off_t ret;
ret= isoburn_toc_disc_get_sectors_v2(disc);
if(ret > 0x7fffffff)
return((int) 0x7fffffff);
return((int) ret);
}
struct isoburn_toc_session **isoburn_toc_disc_get_sessions(
struct isoburn_toc_disc *disc, int *num)
{
@ -1785,10 +1867,11 @@ int isoburn_toc_disc_get_incmpl_sess(struct isoburn_toc_disc *disc)
}
int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s)
off_t isoburn_toc_session_get_sectors_v2(struct isoburn_toc_session *s)
{
struct isoburn_toc_entry *t;
int count= 0, i;
int i;
off_t count= 0;
if(s==NULL)
return(0);
@ -1799,17 +1882,28 @@ int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s)
t= t->next;
}
} else if(s->session!=NULL)
count= burn_session_get_sectors(s->session);
count= burn_session_get_sectors_v2(s->session);
return(count);
}
int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s)
{
off_t ret;
ret= isoburn_toc_session_get_sectors_v2(s);
if(ret > 0x7fffffff)
return((int) 0x7fffffff);
return((int) ret);
}
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->extensions_valid= 1 | 8;
entry->adr= 1;
entry->control= 4;
entry->session= session_no & 255;
@ -1817,7 +1911,13 @@ int isoburn_toc_entry_finish(struct burn_toc_entry *entry,
entry->point= track_no & 255;
entry->point_msb= (track_no >> 8) & 255;
burn_lba_to_msf(entry->start_lba, &pmin, &psec, &pframe);
if(entry->start_lba < 0) {
pmin= 255;
psec= 59;
pframe=74;
} else {
burn_lba_to_msf(entry->start_lba, &pmin, &psec, &pframe);
}
if(pmin<=255)
entry->pmin= pmin;
else
@ -1842,7 +1942,13 @@ void isoburn_toc_session_get_leadout_entry(struct isoburn_toc_session *s,
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->long_start_lba= t->toc_entry->start_lba + t->toc_entry->track_blocks;
if(entry->long_start_lba > 0x7fffffff) {
entry->start_lba= -1;
} else {
entry->start_lba= entry->long_start_lba;
}
entry->long_track_blocks= 0;
entry->track_blocks= 0;
isoburn_toc_entry_finish(entry, s->toc_entry->session, t->toc_entry->track_no,
0);
@ -1868,15 +1974,26 @@ void isoburn_toc_track_get_entry(struct isoburn_toc_track *t,
}
if(t->toc_entry==NULL)
return;
entry->start_lba= t->toc_entry->start_lba;
entry->track_blocks= t->toc_entry->track_blocks;
entry->long_start_lba= t->toc_entry->start_lba;
if(entry->long_start_lba > 0x7fffffff) {
entry->start_lba= -1;
} else {
entry->start_lba= entry->long_start_lba;
}
entry->long_track_blocks= t->toc_entry->track_blocks;
if(entry->long_track_blocks > 0x7fffffff) {
entry->track_blocks= -1;
} else {
entry->track_blocks= entry->long_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)
int isoburn_toc_track_get_emul_v2(struct isoburn_toc_track *t,
off_t *start_lba, off_t *image_blocks,
char volid[33], int flag)
{
if(t->toc_entry == NULL)
return(0);
@ -1890,6 +2007,32 @@ int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba,
}
int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba,
int *image_blocks, char volid[33], int flag)
{
int ret;
off_t long_lba, long_image_blocks;
ret= isoburn_toc_track_get_emul_v2(t, &long_lba, &long_image_blocks, volid,
flag);
if(ret <= 0)
return(ret);
if(long_lba > 0x7fffffff) {
*start_lba= 0x7fffffff;
ret= 0;
} else {
*start_lba= long_lba;
}
if(long_image_blocks > 0x7fffffff) {
*image_blocks= 0x7fffffff;
ret= 0;
} else {
*image_blocks= long_image_blocks;
}
return(ret);
}
void isoburn_toc_disc_free(struct isoburn_toc_disc *d)
{
if(d->disc!=NULL)
@ -1899,15 +2042,19 @@ void isoburn_toc_disc_free(struct isoburn_toc_disc *d)
}
int isoburn_get_track_lba(struct isoburn_toc_track *track, int *lba, int flag)
int isoburn_get_track_lba(struct isoburn_toc_track *track, off_t *lba,
int flag)
{
struct burn_toc_entry entry;
isoburn_toc_track_get_entry(track, &entry);
if (entry.extensions_valid & 1)
if (entry.extensions_valid & 8) {
*lba= entry.long_start_lba;
} else if (entry.extensions_valid & 1) {
*lba= entry.start_lba;
else
} else {
*lba= burn_msf_to_lba(entry.pmin, entry.psec, entry.pframe);
}
return(1);
}
@ -1938,8 +2085,10 @@ int isoburn_drive_set_msgs_submit(struct burn_drive *d,
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;
int ret, num_sessions= 0, num_tracks, i, j, total_tracks;
int re_valid= 0, track_count= 0;
off_t adr_num, lba, best_lba, size;
double adr_double;
time_t start_time= 0, last_pacifier= 0, now;
char volid[33], *msg= NULL;
struct isoburn *o;
@ -1963,7 +2112,11 @@ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value,
{ret= -1; goto ex;}
start_time= last_pacifier= time(NULL);
adr_num= atoi(adr_value);
adr_num= -1;
adr_double= -1.0;
sscanf(adr_value, "%lf", &adr_double);
if(adr_double >= -1.0e16 && adr_double <= 1.0e16) /* ~ 2 exp 53 */
adr_num= adr_double;
if(adr_mode!=3 || (flag & 2)) {
disc= isoburn_toc_drive_get_disc(d);
if(disc==NULL) {
@ -2025,7 +2178,8 @@ not_found:;
}
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));
ret= isoburn_read_iso_head_v2(d, o->fabricated_msc1, &size, volid,
1 | (1 << 14));
if(ret==2)
o->fabricated_msc1-= 16;
}
@ -2053,12 +2207,12 @@ not_found:;
isoburn_msgs_submit(o, 0x00060000, msg, 0, "UPDATE", 0);
}
track_count++;
ret= isoburn_toc_track_get_emul(tracks[0], &lba, &size, volid, 0);
ret= isoburn_toc_track_get_emul_v2(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);
ret= isoburn_read_iso_head_v2(d, lba, &size, volid, 1);
if(ret<=0)
continue;
}
@ -2102,13 +2256,13 @@ ex:;
}
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 isoburn_get_mount_params_v2(struct burn_drive *d,
int adr_mode, char *adr_value,
off_t *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;
int ret, total_tracks, num_sessions, num_tracks, i, j, is_iso= 0;
off_t msc1_mem, track_lba, size;
struct isoburn *o;
struct isoburn_toc_disc *disc= NULL;
struct isoburn_toc_session **sessions= NULL;
@ -2145,7 +2299,7 @@ int isoburn_get_mount_params(struct burn_drive *d,
}
}
}
ret= isoburn_read_iso_head(d, *lba, &size, volid, 1);
ret= isoburn_read_iso_head_v2(d, *lba, &size, volid, 1);
if(ret <= 0)
volid[0]= 0;
else
@ -2159,3 +2313,24 @@ ex:;
}
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 ret;
off_t long_lba;
ret= isoburn_get_mount_params_v2(d, adr_mode, adr_value, &long_lba,
track, session, volid, flag);
if(ret <= 0)
return(ret);
if(long_lba > 0x7fffffff) {
*lba= 0x7fffffff;
ret= 0;
} else {
*lba= long_lba;
}
return(ret);
}

View File

@ -6,8 +6,8 @@
/*
Class core of libisoburn.
Copyright 2007 - 2017 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Thomas Schmitt <scdbackup@gmx.net>
Copyright 2007 - 2009 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Copyright 2007 - 2023 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -405,7 +405,8 @@ int isoburn_make_iso_write_opts(struct isoburn *out_o,
IsoWriteOpts *wopts,
int flag)
{
int ret, rec_mtime, new_img, lba, nwa, i, guid_mode;
int ret, rec_mtime, new_img, i, guid_mode;
off_t lba, nwa;
struct burn_drive *out_d;
new_img= flag&1;
@ -481,6 +482,13 @@ int isoburn_make_iso_write_opts(struct isoburn *out_o,
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);
ret = iso_write_opts_set_max_ce_entries(wopts, opts->max_ce_entries,
opts->max_ce_entries_flag);
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot set limit for number of CE entries",
0, "FAILURE", 0);
{ret= -1; goto ex;}
}
iso_write_opts_attach_jte(wopts, opts->libjte_handle);
iso_write_opts_set_hfsp_serial_number(wopts, opts->hfsp_serial_number);
@ -501,7 +509,7 @@ int isoburn_make_iso_write_opts(struct isoburn *out_o,
out_o->min_start_byte= 0;
}
}
ret = isoburn_disc_track_lba_nwa(out_d, NULL, 0, &lba, &nwa);
ret = isoburn_disc_track_lba_nwa_v2(out_d, NULL, 0, &lba, &nwa);
opts->effective_lba= nwa;
ret= isoburn_get_msc2(out_o, NULL, &nwa, 0);
if (ret != 1) {
@ -554,11 +562,16 @@ int isoburn_make_iso_write_opts(struct isoburn *out_o,
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;
@ -583,7 +596,7 @@ int isoburn_prepare_disc_aux(struct burn_drive *in_d, struct burn_drive *out_d,
IsoWriteOpts *wopts= NULL;
enum burn_disc_status state;
int ret, fifo_chunks, i, new_img, early_indev_release;
uint32_t data_start= -1;
uint32_t data_start= 0xffffffff;
size_t buffer_size= 0, buffer_free= 0;
char *msg= NULL;
@ -681,10 +694,10 @@ int isoburn_prepare_disc_aux(struct burn_drive *in_d, struct burn_drive *out_d,
ret= iso_write_opts_get_data_start(wopts, &data_start, 0);
opts->data_start_lba= -1;
if(ret > 0 && data_start <= 0x7FFFFFFF)
if(ret > 0)
opts->data_start_lba= data_start;
/* TODO check return values for failure. propertly clean-up on error */
/* TODO check return values for failure. properly clean-up on error */
out_o->iso_source= wsrc;
@ -730,10 +743,11 @@ int isoburn_prepare_new_image(struct burn_drive *d, struct burn_disc **disc,
}
/* 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)
/* API since 1.5.8 */
int isoburn_prepare_blind_grow_v2(struct burn_drive *d,
struct burn_disc **disc,
struct isoburn_imgen_opts *opts,
struct burn_drive *out_drive, off_t nwa)
{
int ret;
struct isoburn *o= NULL;
@ -755,6 +769,18 @@ int isoburn_prepare_blind_grow(struct burn_drive *d, struct burn_disc **disc,
}
/* 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;
ret= isoburn_prepare_blind_grow_v2(d, disc, opts, out_drive, (off_t) nwa);
return(ret);
}
/* API @since 0.1.0
@param flag bit0= this is a regular end, not an abort
give up source reference
@ -851,6 +877,8 @@ int isoburn_ropt_new(struct isoburn_read_opts **new_o, int flag)
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;
@ -953,6 +981,8 @@ int isoburn_ropt_set_extensions(struct isoburn_read_opts *o, int ext)
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);
}
@ -963,7 +993,8 @@ int isoburn_ropt_get_extensions(struct isoburn_read_opts *o, int *ext)
((!!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_ecma119_map) << 11) | ((o->map_mode & 3) << 12) |
((!!o->do_joliet_map) << 14) | ((!!o->joliet_map_mode) << 15);
return(1);
}
@ -1096,6 +1127,15 @@ int isoburn_ropt_get_size_what(struct isoburn_read_opts *o,
}
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.
@ -1176,6 +1216,8 @@ int isoburn_igopt_new(struct isoburn_imgen_opts **new_o, int flag)
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;
@ -1183,6 +1225,8 @@ int isoburn_igopt_new(struct isoburn_imgen_opts **new_o, int flag)
o->iso_mbr_part_type= -1;
memset(o->gpt_guid, 0, 16);
o->gpt_guid_mode= 0;
o->max_ce_entries= 31; /* Linux hates >= RR_MAX_CE_ENTRIES = 32 */
o->max_ce_entries_flag= 2; /* omit non-isofs fattr and ACL if needed */
memset(o->hfsp_serial_number, 0, 8);
o->hfsp_block_size= 0;
o->apm_block_size= 0;
@ -1472,20 +1516,57 @@ int isoburn_igopt_get_fifo_size(struct isoburn_imgen_opts *o, int *fifo_size)
}
int isoburn_igopt_get_effective_lba(struct isoburn_imgen_opts *o, int *lba)
int isoburn_igopt_get_effective_lba_v2(struct isoburn_imgen_opts *o,
off_t *lba)
{
*lba= o->effective_lba;
return(1);
}
int isoburn_igopt_get_data_start(struct isoburn_imgen_opts *o, int *lba)
int isoburn_igopt_get_effective_lba(struct isoburn_imgen_opts *o, int *lba)
{
int ret;
off_t long_lba;
ret= isoburn_igopt_get_effective_lba_v2(o, &long_lba);
if(ret <= 0)
return(ret);
if(long_lba > 0x7fffffff) {
*lba= 0x7fffffff;
ret= 0;
} else {
*lba= long_lba;
}
return(ret);
}
int isoburn_igopt_get_data_start_v2(struct isoburn_imgen_opts *o, off_t *lba)
{
*lba= o->data_start_lba;
return(1);
}
int isoburn_igopt_get_data_start(struct isoburn_imgen_opts *o, int *lba)
{
int ret;
off_t long_lba;
ret= isoburn_igopt_get_data_start_v2(o, &long_lba);
if(ret <= 0)
return(ret);
if(long_lba > 0x7fffffff) {
*lba= 0x7fffffff;
ret= 0;
} else {
*lba= long_lba;
}
return(ret);
}
int isoburn_igopt_set_scdbackup_tag(struct isoburn_imgen_opts *o, char *name,
char *timestamp, char *tag_written)
{
@ -1528,7 +1609,7 @@ int isoburn_igopt_set_system_area(struct isoburn_imgen_opts *opts,
}
memcpy(opts->system_area_data, data, 32768);
}
opts->system_area_options = options & 0xffff;
opts->system_area_options = options & 0x3ffff;
return(1);
}
@ -1781,6 +1862,48 @@ int isoburn_igopt_get_appended_as_gpt(struct isoburn_imgen_opts *opts,
}
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;
@ -1830,6 +1953,24 @@ int isoburn_igopt_get_iso_mbr_part_type(struct isoburn_imgen_opts *opts,
}
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)
{
@ -1856,6 +1997,32 @@ int isoburn_igopt_get_gpt_guid(struct isoburn_imgen_opts *opts,
}
int isoburn_igopt_set_max_ce_entries(struct isoburn_imgen_opts *opts,
uint32_t num, int flag)
{
if(num > 100000) {
isoburn_msgs_submit(NULL, 0x00060000,
"Too many CE entries enabled for single file (max 100000)",
0, "SORRY", 0);
return(0);
}
if(num == 0)
num= 1;
opts->max_ce_entries= num;
opts->max_ce_entries_flag= (flag & 15);
return(1);
}
int isoburn_igopt_get_max_ce_entries(struct isoburn_imgen_opts *opts,
uint32_t *num, int *max_ce_flag)
{
*num= opts->max_ce_entries;
*max_ce_flag= opts->max_ce_entries_flag;
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);

View File

@ -2,8 +2,9 @@
/*
Class struct of libisoburn.
Copyright 2007 - 2017 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
and Thomas Schmitt <scdbackup@gmx.net>
Copyright 2007 - 2009 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Copyright 2007 - 2024 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -20,15 +21,15 @@
#endif
#endif
/* For emulated TOC of overwriteable media.
/* 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 overwriteables */
off_t start_lba;
off_t track_blocks;
char *volid; /* For caching a volume id from emulated toc on overwritables */
struct isoburn_toc_entry *next;
};
@ -81,26 +82,26 @@ struct isoburn {
/* If >= 0, this address is used as reply for isoburn_disc_get_msc1()
*/
int fabricated_msc1;
off_t 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;
off_t fabricated_msc2;
/* The nwa to be used for a first session on the present kind of overwriteable
/* 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;
off_t 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;
off_t nwa;
/* Truncate to .nwa an eventual regular file serving as output drive */
@ -117,11 +118,11 @@ struct isoburn {
int media_read_error;
/* Eventual emulated table of content read from the chain of ISO headers
on overwriteable media.
on overwritable media.
*/
struct isoburn_toc_entry *toc;
/* Indicator wether the most recent burn run worked :
/* Indicator whether the most recent burn run worked :
-1 = undetermined, ask libburn , 0 = failure , 1 = success
To be inquired by isoburn_drive_wrote_well()
*/
@ -141,7 +142,7 @@ struct isoburn {
IsoImage *image;
/* The start LBA of the image */
int image_start_lba;
off_t image_start_lba;
/* The block data source from which the existing image is read.
*/
@ -255,7 +256,7 @@ int isoburn_set_start_byte(struct isoburn *o, off_t value, int flag);
@return <=0 is failure , >0 success
*/
int isoburn_get_msc2(struct isoburn *o,
struct burn_write_opts *opts, int *msc2, int flag);
struct burn_write_opts *opts, off_t *msc2, int flag);
/** Get a data source suitable for read from a drive using burn_read_data()
function.
@ -325,6 +326,9 @@ struct isoburn_read_opts {
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 */
@ -384,6 +388,11 @@ struct isoburn_read_opts {
uint32_t size; /**< Will be filled with the size (in 2048 byte block) of
* the image, as reported in the PVM. */
int tree_loaded; /* from iso_read_image_features_tree_loaded() */
int rr_loaded; /* from iso_read_image_features_rr_loaded */
unsigned int pretend_blank:1; /* always create empty image */
uint32_t displacement;
@ -426,7 +435,7 @@ struct isoburn_imgen_opts {
*/
unsigned int file_md5 :2;
/* On overwriteable media or random access files do not write the first
/* 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;
@ -620,14 +629,14 @@ struct isoburn_imgen_opts {
If <0 : Invalid
If >=0: Valid block number. Block size is always 2 KiB.
*/
int effective_lba;
off_t 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;
off_t data_start_lba;
/**
* If not empty: Parameters "name" and "timestamp" for a scdbackup stream
@ -691,12 +700,19 @@ struct isoburn_imgen_opts {
char *efi_boot_partition;
int efi_boot_part_flag;
/* Eventual disk file paths of prepared images which shall be appended
after the ISO image and described by partiton table entries in a MBR.
/* 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
*/
@ -714,6 +730,13 @@ struct isoburn_imgen_opts {
*/
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];
@ -746,10 +769,13 @@ struct isoburn_imgen_opts {
/* Whether to fsync() stdio_drives after isoburn_activate_session() */
int do_fsync;
/* See libisoburn.h isoburn_igopt_set_max_ce_entries() */
uint32_t max_ce_entries;
int max_ce_entries_flag;
};
/* Alignment for session starts on overwriteable media.
/* Alignment for session starts on overwritable media.
(Increased from 16 to 32 blocks for aligning to BD-RE clusters.)
*/
#define Libisoburn_nwa_alignemenT 32
@ -789,7 +815,7 @@ struct isoburn_imgen_opts {
((off_t) (Libisoburn_target_head_sizE/2048))
/* Wrappers for emulation of TOC on overwriteable media */
/* Wrappers for emulation of TOC on overwritable media */
struct isoburn_toc_track {
/* Either track or toc_entry are supposed to be NULL */

View File

@ -6,8 +6,8 @@
/*
libisofs related functions of libisoburn.
Copyright 2007 - 2017 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Thomas Schmitt <scdbackup@gmx.net>
Copyright 2007 - 2009 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Copyright 2007 - 2024 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -87,6 +87,18 @@ uint32_t iso_read_lsb(const uint8_t *buf, int bytes)
}
static
uint64_t iso_read_lsb64(const uint8_t *buf)
{
int i;
uint64_t ret = 0;
for (i=0; i < 8; i++)
ret += ((uint64_t) buf[i]) << (i * 8);
return ret;
}
/* API function. See libisoburn.h
*/
IsoImage *isoburn_get_attached_image(struct burn_drive *d)
@ -106,7 +118,7 @@ IsoImage *isoburn_get_attached_image(struct burn_drive *d)
/* API */
int isoburn_get_attached_start_lba(struct burn_drive *d)
off_t isoburn_get_attached_start_lba_v2(struct burn_drive *d)
{
int ret;
struct isoburn *o= NULL;
@ -120,6 +132,17 @@ int isoburn_get_attached_start_lba(struct burn_drive *d)
}
int isoburn_get_attached_start_lba(struct burn_drive *d)
{
off_t ret;
ret= isoburn_get_attached_start_lba_v2(d);
if(ret >= 0 && ret <= 0x7fffffff)
return((int) ret);
return(-1);
}
static void isoburn_idle_free_function(void *ignored)
{
return;
@ -137,16 +160,113 @@ int isoburn_root_defaults(IsoImage *image, int flag)
}
/* @return <=0 = error , 1 = ok , 2 = no ISO filesystem found
*/
int isoburn_make_iso_read_opts(struct burn_drive *d,
struct isoburn *o,
struct isoburn_read_opts *read_opts,
IsoReadOpts **ropts)
{
int ret, int_num;
off_t off_t_num, dummy;
uint32_t ms_block;
char *msg= NULL;
msg= calloc(1, 160);
*ropts= NULL;
ret = isoburn_disc_get_msc1_v2(d, &off_t_num);
if (ret <= 0)
{ret= -2; goto ex;}
if(off_t_num > 0xffffffff) {
sprintf(msg, "Start address is outside 32 bit range.");
isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
ms_block= off_t_num;
if (o != NULL)
o->image_start_lba= ms_block;
ret = isoburn_read_iso_head_v2(d, off_t_num, &dummy, NULL, 0);
if (ret <= 0) {
sprintf(msg, "No ISO 9660 image at LBA %lu.",
(unsigned long int) ms_block);
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
{ret= 2; goto ex;}
}
if(read_opts->displacement != 0 && abs(read_opts->displacement_sign) == 1) {
/* Apply reverse displacement to session start */
if(read_opts->displacement_sign == -1) {
if(ms_block+ read_opts->displacement < ms_block) {
displacement_rollover:;
sprintf(msg, "Displacement offset leads outside 32 bit range.");
isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
ms_block+= read_opts->displacement;
} else {
if(ms_block < read_opts->displacement)
goto displacement_rollover;
ms_block-= read_opts->displacement;
}
}
ret = iso_read_opts_new(ropts, 0);
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot create write opts", 0, "FATAL", 0);
goto ex;
}
iso_read_opts_set_start_block(*ropts, ms_block);
iso_read_opts_set_no_rockridge(*ropts, read_opts->norock);
iso_read_opts_set_no_aaip(*ropts, read_opts->noaaip);
if(read_opts->nomd5 == 2)
int_num= 2;
else if(read_opts->nomd5 == 1)
int_num= 1;
else
int_num= 0;
iso_read_opts_set_no_md5(*ropts, int_num);
if(read_opts->do_ecma119_map)
iso_read_opts_set_ecma119_map(*ropts, read_opts->map_mode);
if(read_opts->do_joliet_map)
iso_read_opts_set_joliet_map(*ropts, read_opts->joliet_map_mode);
iso_read_opts_set_new_inos(*ropts, read_opts->noino);
iso_read_opts_set_no_joliet(*ropts, read_opts->nojoliet);
iso_read_opts_set_no_iso1999(*ropts, read_opts->noiso1999);
iso_read_opts_set_preferjoliet(*ropts, read_opts->preferjoliet);
iso_read_opts_set_default_permissions(*ropts,
read_opts->mode, read_opts->dirmode);
iso_read_opts_set_default_uid(*ropts, read_opts->uid);
iso_read_opts_set_default_gid(*ropts, read_opts->gid);
iso_read_opts_set_input_charset(*ropts, read_opts->input_charset);
iso_read_opts_auto_input_charset(*ropts, read_opts->auto_input_charset);
iso_read_opts_load_system_area(*ropts, 1);
iso_read_opts_keep_import_src(*ropts, 1);
ret= 1;
ex:;
if(ret <= 0) {
if(*ropts != NULL)
iso_read_opts_free(*ropts);
*ropts= NULL;
}
if(msg != NULL)
free(msg);
return(ret);
}
/* API function. See libisoburn.h
*/
int isoburn_read_image(struct burn_drive *d,
struct isoburn_read_opts *read_opts,
IsoImage **image)
{
int ret, int_num, dummy, ignore_aclea= 0;
int ret, 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;
@ -223,71 +343,19 @@ create_blank_image:;
{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);
/* create the data source */
ret= isoburn_make_iso_read_opts(d, o, read_opts, &ropts);
if(ret <= 0)
goto ex;
if(ret == 2) {
sprintf(msg, "Creating blank image.");
isoburn_msgs_submit(o, 0x00060000, msg, 0, "WARNING", 0);
goto create_blank_image;
}
if(read_opts->displacement != 0 && abs(read_opts->displacement_sign) == 1) {
/* Apply reverse displacement to session start */
if(read_opts->displacement_sign == -1) {
if(ms_block+ read_opts->displacement < ms_block) {
displacement_rollover:;
sprintf(msg, "Displacement offset leads outside 32 bit range.");
isoburn_msgs_submit(o, 0x00060000, msg, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
ms_block+= read_opts->displacement;
} else {
if(ms_block < read_opts->displacement)
goto displacement_rollover;
ms_block-= read_opts->displacement;
}
}
/* create the data source */
ret = iso_read_opts_new(&ropts, 0);
if (ret < 0) {
isoburn_report_iso_error(ret, "Cannot create write opts", 0, "FATAL", 0);
goto ex;
}
/* Important: do not return until iso_read_opts_free() */
iso_read_opts_set_start_block(ropts, ms_block);
iso_read_opts_set_no_rockridge(ropts, read_opts->norock);
iso_read_opts_set_no_aaip(ropts, read_opts->noaaip);
if(read_opts->nomd5 == 2)
int_num= 2;
else if(read_opts->nomd5 == 1)
int_num= 1;
else
int_num= 0;
iso_read_opts_set_no_md5(ropts, int_num);
if(read_opts->do_ecma119_map)
iso_read_opts_set_ecma119_map(ropts, read_opts->map_mode);
iso_read_opts_set_new_inos(ropts, read_opts->noino);
iso_read_opts_set_no_joliet(ropts, read_opts->nojoliet);
iso_read_opts_set_no_iso1999(ropts, read_opts->noiso1999);
iso_read_opts_set_preferjoliet(ropts, read_opts->preferjoliet);
iso_read_opts_set_default_permissions(ropts,
read_opts->mode, read_opts->dirmode);
iso_read_opts_set_default_uid(ropts, read_opts->uid);
iso_read_opts_set_default_gid(ropts, read_opts->gid);
iso_read_opts_set_input_charset(ropts, read_opts->input_charset);
iso_read_opts_auto_input_charset(ropts, read_opts->auto_input_charset);
iso_read_opts_load_system_area(ropts, 1);
iso_read_opts_keep_import_src(ropts, 1);
ret= iso_image_set_truncate_mode(o->image, read_opts->truncate_mode,
read_opts->truncate_length);
if(ret < 0)
@ -330,6 +398,8 @@ displacement_rollover:;
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)
@ -342,6 +412,170 @@ ex:;
}
/* API function. See libisoburn.h
*/
int isoburn_assess_written_features(struct burn_drive *d,
struct isoburn_read_opts *read_opts,
IsoReadImageFeatures **features,
struct isoburn_imgen_opts **imgen_opts,
int flag)
{
int ret, type, ext;
int64_t num_value;
void *pt_value;
size_t pt_size;
IsoReadOpts *ropts= NULL;
char *msg= NULL;
enum burn_disc_status status= BURN_DISC_BLANK;
IsoDataSource *ds= NULL;
struct isoburn *o= NULL;
IsoWriteOpts *write_opts= NULL;
msg= calloc(1, 160);
if(d != NULL) {
ret = isoburn_find_emulator(&o, d, 0);
if (ret < 0 || o == NULL)
{ret= 0; goto ex;}
status = isoburn_disc_get_status(d);
o->image_start_lba= -1;
}
if(read_opts==NULL) {
isoburn_msgs_submit(o, 0x00060000,
"Program error: isoburn_read_image: read_opts==NULL",
0, "FATAL", 0);
{ret= -1; goto ex;}
}
if (d == NULL || read_opts->pretend_blank ||
(status != BURN_DISC_APPENDABLE && status != BURN_DISC_FULL)) {
isoburn_msgs_submit(o, 0x00060000,
"Empty drive, unsuitable medium state, or read option 'pretend_blank'",
0, "FAILURE", 0);
{ret= 0; goto ex;}
}
ret= isoburn_make_iso_read_opts(d, o, read_opts, &ropts);
if(ret <= 0)
goto ex;
if(ret == 2)
{ret= 0; goto ex;}
/* ??? Only if o->iso_data_source == NULL ? */
ds = isoburn_data_source_new(d, read_opts->displacement,
read_opts->displacement_sign,
read_opts->cache_tiles, read_opts->cache_tile_blocks);
if (ds == NULL) {
isoburn_report_iso_error(ret, "Cannot create IsoDataSource object", 0,
"FATAL", 0);
ret= -1; goto ex;
}
if(o->iso_data_source != NULL)
iso_data_source_unref(o->iso_data_source);
o->iso_data_source= ds;
ret= iso_assess_written_features(ds, ropts, features, &write_opts);
if(ret < 0) {
isoburn_report_iso_error(ret, "Failed to assess ISO filesystem features",
0, "FAILURE", 0);
ret= 0; goto ex;
}
ret= isoburn_igopt_new(imgen_opts, 0);
if(ret <= 0)
goto ex;
/* Convert features to imgen_opts */
if(iso_read_image_feature_named(*features, "iso_level", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
isoburn_igopt_set_level(*imgen_opts, num_value);
ext= 0;
if(iso_read_image_feature_named(*features, "rock_ridge", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_rockridge * !!num_value;
if(iso_read_image_feature_named(*features, "joliet", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_joliet * !!num_value;
if(iso_read_image_feature_named(*features, "iso1999", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_iso1999 * !!num_value;
if(iso_read_image_feature_named(*features, "aaip", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_aaip * !!num_value;
if(iso_read_image_feature_named(*features, "record_md5_session", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_session_md5 * !!num_value;
if(iso_read_image_feature_named(*features, "record_md5_files", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_file_md5 * !!num_value;
isoburn_igopt_set_extensions(*imgen_opts, ext);
ext= 0;
if(iso_read_image_feature_named(*features, "omit_version_numbers", NULL, &type,
&num_value, &pt_value, &pt_size) == 1) {
if((num_value & 3) == 2)
ext|= isoburn_igopt_only_iso_versions;
else if(num_value & 3)
ext|= isoburn_igopt_omit_version_numbers;
}
if(iso_read_image_feature_named(*features, "allow_deep_paths", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_allow_deep_paths * !!num_value;
if(iso_read_image_feature_named(*features, "allow_longer_paths", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_allow_longer_paths * !!num_value;
if(iso_read_image_feature_named(*features, "max_37_char_filenames", NULL,
&type, &num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_max_37_char_filenames * !!num_value;
if(iso_read_image_feature_named(*features, "no_force_dots", NULL, &type,
&num_value, &pt_value, &pt_size) == 1) {
if(num_value & 1)
ext|= isoburn_igopt_only_iso_versions;
if(num_value & 2)
ext|= isoburn_igopt_no_force_dots;
}
if(iso_read_image_feature_named(*features, "allow_lowercase", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_allow_lowercase * !!num_value;
if(iso_read_image_feature_named(*features, "allow_full_ascii", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_allow_full_ascii * !!num_value;
if(iso_read_image_feature_named(*features, "joliet_longer_paths", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_joliet_longer_paths * !!num_value;
if(iso_read_image_feature_named(*features, "rrip_version_1_10", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_rrip_version_1_10 * !!num_value;
if(iso_read_image_feature_named(*features, "aaip_susp_1_10", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_aaip_susp_1_10 * !!num_value;
if(iso_read_image_feature_named(*features, "allow_dir_id_ext", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_allow_dir_id_ext * !!num_value;
if(iso_read_image_feature_named(*features, "joliet_long_names", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_joliet_long_names * !!num_value;
if(iso_read_image_feature_named(*features, "joliet_utf16", NULL, &type,
&num_value, &pt_value, &pt_size) == 1)
ext|= isoburn_igopt_joliet_utf16 * !!num_value;
isoburn_igopt_set_relaxed(*imgen_opts, ext);
if(iso_read_image_feature_named(*features, "untranslated_name_len", NULL,
&type, &num_value, &pt_value, &pt_size) == 1)
isoburn_igopt_set_untranslated_name_len(*imgen_opts, num_value);
ret= 1;
ex:;
if(msg != NULL)
free(msg);
if(ropts != NULL)
iso_read_opts_free(ropts);
if(write_opts != NULL)
iso_write_opts_free(write_opts);
return(ret);
}
/* API function. See libisoburn.h
*/
int isoburn_attach_image(struct burn_drive *d, IsoImage *image)
@ -367,7 +601,7 @@ int isoburn_attach_image(struct burn_drive *d, IsoImage *image)
/* API */
int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag)
int isoburn_attach_start_lba_v2(struct burn_drive *d, off_t lba, int flag)
{
int ret;
struct isoburn *o;
@ -384,6 +618,14 @@ int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag)
}
int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag)
{
int ret;
ret= isoburn_attach_start_lba_v2(d, (off_t) lba, flag);
return(ret);
}
/* API function. See libisoburn.h
*/
int isoburn_activate_session(struct burn_drive *drive)
@ -436,6 +678,42 @@ int isoburn_get_img_partition_offset(struct burn_drive *drive,
}
/* Try to read partition start and size block number from given GPT entry */
int isoburn_get_gpt_entry(struct isoburn *o, int partno,
uint64_t *start_lba, uint64_t *size, int flag)
{
uint32_t part_start, entry_count, entry_size, part_lba, end_lba;
uint8_t *gpt, *part;
/* Check for GPT header block */
gpt = o->target_iso_head + 512;
if(memcmp(gpt, "EFI PART", 8) != 0)
return(0);
if(gpt[8] != 0x00 || gpt[9] != 0x00 || gpt[10] != 0x01 || gpt[11] != 0x00)
return(0);
part_start = iso_read_lsb64(gpt + 72);
entry_count = iso_read_lsb64(gpt + 80);
entry_size = iso_read_lsb64(gpt + 84);
/* Read partition entry */
if(partno < 1)
return(0);
if(((uint64_t) partno) > entry_count)
return(0);
if(part_start * 512 + partno * entry_size > 32768)
return(0);
part = o->target_iso_head + part_start * 512 + (partno - 1) * entry_size;
part_lba = iso_read_lsb64(part + 32);
end_lba = iso_read_lsb64(part + 40);
if(end_lba < part_lba)
return(0);
*start_lba = part_lba;
*size = end_lba - part_lba + 1;
return(1);
}
/* 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.
@ -445,6 +723,7 @@ static int isoburn_inspect_partition(struct isoburn *o, uint32_t img_size,
{
uint8_t *mbr, *part, *buf= NULL;
uint32_t offst, numsec;
uint64_t gpt_start_lba, gpt_size;
struct ecma119_pri_vol_desc *pvm;
off_t data_count;
int ret;
@ -467,9 +746,20 @@ static int isoburn_inspect_partition(struct isoburn *o, uint32_t img_size,
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);
/* Is it GPT ? */
if(part[4] == 0xee && offst == 1) {
ret= isoburn_get_gpt_entry(o, 1, &gpt_start_lba, &gpt_size, 0);
if(ret > 0 && gpt_start_lba < ((uint64_t) 1) << 32 &&
gpt_size < ((uint64_t) 1) << 32) {
offst= gpt_start_lba;
numsec= gpt_size;
}
}
/* Does it match the normal ISO image ? */
if(offst < 64)
{ret= 2; goto ex;} /* Zero or unusably small partition start */
if((offst % 4) || (numsec % 4))
@ -532,7 +822,8 @@ ex:;
*/
int isoburn_start_emulation(struct isoburn *o, int flag)
{
int ret, i, capacity = -1, role, dummy;
int ret, i, role;
off_t capacity = -1, dummy;
off_t data_count, to_read;
struct burn_drive *drive;
struct ecma119_pri_vol_desc *pvm;
@ -560,13 +851,13 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
The data there point to the most recent session.
*/
role = burn_drive_get_drive_role(drive);
ret = burn_get_read_capacity(drive, &capacity, 0);
ret = burn_get_read_capacity_v2(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));
burn_disc_track_lba_nwa_v2(drive, NULL, 0, &dummy, &(o->nwa));
if(o->nwa < o->zero_nwa)
o->zero_nwa= 0;
{ret= 1; goto ex;}
@ -575,8 +866,8 @@ int isoburn_start_emulation(struct isoburn *o, int flag)
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;
if(capacity > 0 && capacity * (off_t) 2048 < to_read)
to_read = 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) {
@ -675,22 +966,22 @@ int isoburn_invalidate_iso(struct isoburn *o, int flag)
/*
* replace CD001 with CDXX1 in PVM.
*/
strncpy(head + 16 * 2048 + 1, "CDXX1", 5);
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)
strncpy(head + i + 1, "BEAX1", 5);
memcpy(head + i + 1, "BEAX1", 5);
else if(head[i] == 0 && strncmp(head + i + 1, "NSR", 3) == 0)
strncpy(head + i + 1, "NSRX", 4);
memcpy(head + i + 1, "NSRX", 4);
else if(head[i] == 0 && strncmp(head + i + 1, "TEA", 3) == 0)
strncpy(head + i + 1, "TEAX", 4);
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;
strncpy(head + i + 3, "XX", 2);
memcpy(head + i + 3, "XX", 2);
}
}

View File

@ -5,8 +5,8 @@
/*
Lower level API definition of libisoburn.
Copyright 2007-2018 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
and Thomas Schmitt <scdbackup@gmx.net>
Copyright 2007-2009 Vreixo Formoso Lopes <metalpain2002@yahoo.es>
Copyright 2007-2024 Thomas Schmitt <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -93,13 +93,13 @@ 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 overwriteable
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 overwriteable without a valid ISO image, then one may produce a consolidated
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.
@ -173,6 +173,8 @@ This can be achieved either:
/* Important: If you add a public API function then add its name to file
libisoburn/libisoburn.ver
in the node LIBISOBURN1_Major.Minor.Micro with the numbers of
the next release version.
*/
@ -206,7 +208,7 @@ int isoburn_initialize(char msg[1024], int flag);
@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 libray
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);
@ -237,8 +239,6 @@ int isoburn_is_compatible(int major, int minor, int micro, int flag);
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);
@ -249,7 +249,7 @@ void isoburn_version(int *major, int *minor, int *micro);
*/
#define isoburn_libisofs_req_major 1
#define isoburn_libisofs_req_minor 5
#define isoburn_libisofs_req_micro 0
#define isoburn_libisofs_req_micro 6
/** The minimum version of libburn to be used with this version of libisoburn
at compile time.
@ -257,7 +257,7 @@ void isoburn_version(int *major, int *minor, int *micro);
*/
#define isoburn_libburn_req_major 1
#define isoburn_libburn_req_minor 5
#define isoburn_libburn_req_micro 0
#define isoburn_libburn_req_micro 7
/** The minimum compile time requirements of libisoburn towards libjte are
the same as of a suitable libisofs towards libjte.
@ -312,7 +312,7 @@ int isoburn_libburn_req(int *major, int *minor, int *micro);
*/
#define isoburn_header_version_major 1
#define isoburn_header_version_minor 5
#define isoburn_header_version_micro 0
#define isoburn_header_version_micro 7
/** Note:
Above version numbers are also recorded in configure.ac because libtool
wants them as parameters at build time.
@ -322,7 +322,7 @@ int isoburn_libburn_req(int *major, int *minor, int *micro);
/** Usage discussion:
Some developers of the libburnia project have differing
opinions how to ensure the compatibility of libaries
opinions how to ensure the compatibility of libraries
and applications.
It is about whether to use at compile time and at runtime
@ -429,7 +429,7 @@ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
to a file object.
@param flag bit0= attempt to load the disc tray.
Else: failure if not loaded.
bit1= regard overwriteable media as blank
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
@ -437,7 +437,7 @@ int isoburn_drive_scan_and_grab(struct burn_drive_info *drive_infos[],
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 overwriteable media
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)
@ -548,7 +548,7 @@ void isoburn_disc_erase(struct burn_drive *drive, int fast);
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
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
@ -568,9 +568,9 @@ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value,
/* ----------------------------------------------------------------------- */
/*
Wrappers for emulation of TOC on overwriteable media
Wrappers for emulation of TOC on overwritable media
Media which match the overwriteable usage model lack of a history of sessions
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.
@ -579,7 +579,7 @@ int isoburn_set_msc1(struct burn_drive *d, int adr_mode, char *adr_value,
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 overwriteables if the first session
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
@ -615,6 +615,11 @@ struct isoburn_toc_disc *isoburn_toc_drive_get_disc(struct burn_drive *d);
*/
int isoburn_toc_disc_get_sectors(struct isoburn_toc_disc *disc);
/** Like isoburn_toc_disc_get_sectors(), but with off_t return value.
@since 1.5.8
*/
off_t isoburn_toc_disc_get_sectors_v2(struct isoburn_toc_disc *disc);
/** Get the array of session handles and the number of complete sessions
from the table of content.
@ -649,6 +654,11 @@ int isoburn_toc_disc_get_incmpl_sess(struct isoburn_toc_disc *disc);
*/
int isoburn_toc_session_get_sectors(struct isoburn_toc_session *s);
/** Like isoburn_toc_session_get_sectors(), but with off_t return value.
@since 1.5.8
*/
off_t isoburn_toc_session_get_sectors_v2(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()
@ -701,6 +711,12 @@ void isoburn_toc_track_get_entry(struct isoburn_toc_track *t,
int isoburn_toc_track_get_emul(struct isoburn_toc_track *t, int *start_lba,
int *image_blocks, char volid[33], int flag);
/** Like isoburn_toc_track_get_emul() but with off_t reply type.
@since 1.5.8
*/
int isoburn_toc_track_get_emul_v2(struct isoburn_toc_track *t,
off_t *start_lba, off_t *image_blocks,
char volid[33], int flag);
/** Release the memory associated with a master handle of a medium.
@ -719,12 +735,15 @@ void isoburn_toc_disc_free(struct isoburn_toc_disc *disc);
@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 eventual info reply
@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)
bit12= @since 1.5.6 :
Read even if the start of multi-session emulation
yielded a read error
bit13= @since 0.2.2:
Do not read head from medium but use first 64 kB from
info.
@ -737,6 +756,12 @@ void isoburn_toc_disc_free(struct isoburn_toc_disc *disc);
int isoburn_read_iso_head(struct burn_drive *d, int lba,
int *image_blocks, char *info, int flag);
/** Like isoburn_read_iso_head() but with off_t block address and count.
@since 1.5.8
*/
int isoburn_read_iso_head_v2(struct burn_drive *d, off_t lba,
off_t *image_blocks, char *info, int flag);
/** Try to convert the given entity address into various entity addresses
which would describe it.
@ -766,6 +791,14 @@ int isoburn_get_mount_params(struct burn_drive *d,
int *lba, int *track, int *session,
char volid[33], int flag);
/** Like isoburn_get_mount_params() but with off_t block address type.
@since 1.5.8
*/
int isoburn_get_mount_params_v2(struct burn_drive *d,
int adr_mode, char *adr_value,
off_t *lba, int *track, int *session,
char volid[33], int flag);
/* ----------------------------------------------------------------------- */
/*
@ -888,11 +921,11 @@ int isoburn_ropt_get_data_cache(struct isoburn_read_opts *o,
written into an ISO image.
bit9= nomd5
@since 0.4.2
Do not load the eventual MD5 checksum array.
Do not check eventual session_md5 tags.
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 eventual session_md5 tags although bit9
Do not check session_md5 tags although bit9
is not set.
bit11= do_ecma119_map
@since 1.4.2
@ -909,6 +942,18 @@ int isoburn_ropt_get_data_cache(struct isoburn_read_opts *o,
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
@ -926,6 +971,8 @@ int isoburn_ropt_get_data_cache(struct isoburn_read_opts *o,
#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);
@ -950,7 +997,7 @@ int isoburn_ropt_get_default_perms(struct isoburn_read_opts *o,
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 independend permissions for directories,
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
@ -1005,9 +1052,9 @@ int isoburn_ropt_get_auto_incharset(struct isoburn_read_opts *o, int *mode);
@since 0.6.6
@param o The option set to work on
@param displacement 0 or a positive number
@param displacement_sign Determines wether to add or subtract displacement
to block addresses before applying them to the
storage object for reading:
@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,
@ -1033,7 +1080,7 @@ int isoburn_ropt_get_displacement(struct isoburn_read_opts *o,
is longer than parameter length.
1= Truncate to length and overwrite the last
32 bytes of that length by the hex
representation of ithe MD5 of the whole
representation of the MD5 of the whole
oversized name.
Potential incomplete UTF-8 characters will
get their leading bytes replaced by '_'.
@ -1048,8 +1095,9 @@ int isoburn_ropt_get_truncate_mode(struct isoburn_read_opts *o,
int *mode, int *length);
/** After calling function isoburn_read_image() there are informations
available in the option set.
/** 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
@ -1057,12 +1105,13 @@ int isoburn_ropt_get_truncate_mode(struct isoburn_read_opts *o,
@param size Number of image data blocks, 2048 bytes each.
@param has_what Bitfield:
bit0= has_rockridge
RockRidge extension info is available (POSIX filesystem)
RockRidge extension info is available in the ISO 9660 tree
(POSIX filesystem)
bit1= has_joliet
Joliet extension info is available (suitable for MS-Windows)
Joliet tree is available (suitable for MS-Windows)
bit2= has_iso1999
ISO version 2 Enhanced Volume Descriptor is available.
This is rather exotic.
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
@ -1082,6 +1131,19 @@ int isoburn_ropt_get_size_what(struct isoburn_read_opts *o,
*/
/** 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 */
@ -1172,7 +1234,7 @@ int isoburn_igopt_get_level(struct isoburn_imgen_opts *o, int *level);
See also libisofs.h iso_write_opts_set_record_md5()
bit9= no_emul_toc
@since 0.5.8
On overwriteable media or random access files do not write
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.
@ -1281,7 +1343,7 @@ int isoburn_igopt_get_extensions(struct isoburn_imgen_opts *o, int *ext);
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
bit12= only_iso_versions
Same as bit1 omit_version_number but restricted to the names
in the eventual Joliet tree.
@since 0.5.4
@ -1472,7 +1534,7 @@ 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 charcter set to use for representing RR filenames in the image.
/** 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.
@ -1513,6 +1575,12 @@ int isoburn_igopt_get_fifo_size(struct isoburn_imgen_opts *o, int *fifo_size);
*/
int isoburn_igopt_get_effective_lba(struct isoburn_imgen_opts *o, int *lba);
/** Like isoburn_igopt_get_effective_lba(), but with off_t block addresses.
@since 1.5.8
*/
int isoburn_igopt_get_effective_lba_v2(struct isoburn_imgen_opts *o,
off_t *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,
@ -1527,6 +1595,11 @@ int isoburn_igopt_get_effective_lba(struct isoburn_imgen_opts *o, int *lba);
*/
int isoburn_igopt_get_data_start(struct isoburn_imgen_opts *o, int *lba);
/** Like isoburn_igopt_get_data_start(), but with off_t block addresses.
@since 1.5.8
*/
int isoburn_igopt_get_data_start_v2(struct isoburn_imgen_opts *o, off_t *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
@ -1556,8 +1629,10 @@ int isoburn_igopt_get_scdbackup_tag(struct isoburn_imgen_opts *o,
/** 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
If system area data are given or options bit0 is set, then bit1 of
el_torito_set_isolinux_options() is automatically disabled.
(For the meaning of options see also in libisofs.h
iso_write_opts_set_system_area() parameter "options".)
@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 !
@ -1626,6 +1701,20 @@ int isoburn_igopt_get_scdbackup_tag(struct isoburn_imgen_opts *o,
Little-endian 8-byte.
Should be combined with options bit0.
Will not be in effect if options bit1 is set.
bit15= Only with System area type MBR but not with CHRP
@since 1.4.4
Enforce MBR "bootable/active" flag. In worst case by
dummy partition of type 0x00 which occupies block 0.
bit16= "Legacy BIOS bootable" in GPT
@since 1.5.6
If this bit is set and a GPT partition for the
ISO 9660 filesystem gets written, then set the GPT
partition flags bit 2 "Legacy BIOS bootable".
bit17= ISO not read-only
@since 1.5.6
Do not set GPT partition flag bit 60 "read-only" for
the ISO 9660 filesystem partition, if such a
partition gets written.
@return 1 success, 0 no data to get, <0 failure
*/
int isoburn_igopt_set_system_area(struct isoburn_imgen_opts *o,
@ -1898,7 +1987,6 @@ int isoburn_igopt_set_part_flag(struct isoburn_imgen_opts *opts,
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
@ -1929,6 +2017,50 @@ int isoburn_igopt_set_appended_as_gpt(struct isoburn_imgen_opts *opts,
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 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.
@ -2018,6 +2150,39 @@ int isoburn_igopt_set_iso_mbr_part_type(struct isoburn_imgen_opts *opts,
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
@ -2026,7 +2191,10 @@ int isoburn_igopt_get_iso_mbr_part_type(struct isoburn_imgen_opts *opts,
@param opts
The option set to be manipulated.
@param guid
16 bytes of user supplied 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
@ -2059,6 +2227,48 @@ int isoburn_igopt_set_gpt_guid(struct isoburn_imgen_opts *opts,
int isoburn_igopt_get_gpt_guid(struct isoburn_imgen_opts *opts,
uint8_t guid[16], int *mode);
/** Set the maximum number of SUSP CE entries and thus continuation areas.
Each continuation area can hold at most 2048 bytes of SUSP data (Rock Ridge
or AAIP). The first area can be smaller. There might be some waste at the
end of each area.
When the maximum number is exceeded during ISO filesystem production
then possibly xattr and ACL get removed or error ISO_TOO_MANY_CE gets
reported and filesystem production is prevented.
Files with 32 or more CE entries do not show up in mounted filesystems on
Linux. So the default setting is 31 with drop mode 2. If a higher limit is
chosen and 31 gets surpassed, then a warning message gets reported.
@since 1.5.6
@param opts
The option set to be inquired.
@param num
The maximum number of CE entries per file.
Not more than 100000 may be set here.
0 gets silently mapped to 1,because the root directory needs one CE.
@param flag
bit0-bit3 = Drop mode: What to do with AAIP data on too many CE:
0 = throw ISO_TOO_MANY_CE, without dropping anything
1 = permanently drop non-isofs fattr from IsoNode and
retry filesystem production
2 = drop ACL if dropping non-isofs fattr does not suffice
@return
<=0 = error, 1 = success
*/
int isoburn_igopt_set_max_ce_entries(struct isoburn_imgen_opts *opts,
uint32_t num, int flag);
/** Inquire the current setting of isoburn_igopt_().
@since 1.5.6
@param opts
The option set to be inquired.
@param num
Returns the current setting
@param max_ce_flag
Returns the current flag setting
@return
<=0 = error, 1 = success
*/
int isoburn_igopt_get_max_ce_entries(struct isoburn_imgen_opts *opts,
uint32_t *num, int *max_ce_flag);
/** 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().
@ -2221,13 +2431,13 @@ int isoburn_igopt_get_stdio_endsync(struct isoburn_imgen_opts *opts,
@param flag
Bitfield for control purposes.
bit0-bit7= Name space
0= generic (to_charset is valid,
0= generic (out_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
1= Rock Ridge (out_charset is valid)
2= Joliet (out_charset gets overridden by UCS-2 or UTF-16)
3= ECMA-119 (out_charset gets overridden by the
dull ISO 9660 subset of ASCII)
4= HFS+ (to_charset gets overridden by UTF-16BE)
4= HFS+ (out_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
@ -2258,6 +2468,11 @@ IsoImage *isoburn_get_attached_image(struct burn_drive *d);
*/
int isoburn_get_attached_start_lba(struct burn_drive *d);
/** Like isoburn_get_attached_start_lba(), but with off_t return value.
@since 1.5.8
*/
off_t isoburn_get_attached_start_lba_v2(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
@ -2323,6 +2538,30 @@ int isoburn_set_read_pacifier(struct burn_drive *drive,
int isoburn_get_img_partition_offset(struct burn_drive *drive,
uint32_t *block_offset_2k);
/** Assess features of the importable directory trees and an estimation of the
write options which would cause the recognized features.
@since 1.5.6
@param d The drive with the ISO filesystem
@param read_opts The read options which would be used by
isoburn_read_image()
@param features Returned information which may be inquired by
iso_read_image_features_*() or by
iso_read_image_feature_named().
Dispose by iso_read_image_features_destroy() when
no longer needed.
@param imgen_opts Returned set of write options which were derived
from the features.
Dispose by isoburn_igopt_destroy when no longer
needed.
@param flag Bitfield for control purposes, submit 0 for now.
@return 1= success, <= 0 = error
*/
int isoburn_assess_written_features(struct burn_drive *d,
struct isoburn_read_opts *read_opts,
IsoReadImageFeatures **features,
struct isoburn_imgen_opts **imgen_opts,
int flag);
/** Set the IsoImage to be used with a drive. This eventually releases
the reference to the old IsoImage attached to the drive.
@ -2353,6 +2592,11 @@ int isoburn_attach_image(struct burn_drive *d, IsoImage *image);
*/
int isoburn_attach_start_lba(struct burn_drive *d, int lba, int flag);
/** Like isoburn_attach_start_lba(), but with off_t result value.
@since 1.5.8
*/
int isoburn_attach_start_lba_v2(struct burn_drive *d, off_t 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
@ -2386,6 +2630,11 @@ off_t isoburn_disc_available_space(struct burn_drive *d,
*/
int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba);
/** Like isoburn_disc_get_msc1(), but with off_t result value.
@since 1.5.8
*/
int isoburn_disc_get_msc1_v2(struct burn_drive *d, off_t *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.
@ -2401,9 +2650,16 @@ int isoburn_disc_get_msc1(struct burn_drive *d, int *start_lba);
int isoburn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
int trackno, int *lba, int *nwa);
/** Like isoburn_disc_track_lba_nwa(), but with off_t result value.
@since 1.5.8
*/
int isoburn_disc_track_lba_nwa_v2(struct burn_drive *d,
struct burn_write_opts *o,
int trackno, off_t *lba, off_t *nwa);
/** Obtain the size which was attributed to an emulated appendable on actually
overwriteable media. This value is supposed to be <= 2048 * nwa as of
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.
@ -2512,6 +2768,14 @@ int isoburn_prepare_blind_grow(struct burn_drive *in_drive,
struct isoburn_imgen_opts *opts,
struct burn_drive *out_drive, int nwa);
/** Like isoburn_prepare_blind_grow(), but with off_t nwa value.
@since 1.5.8
*/
int isoburn_prepare_blind_grow_v2(struct burn_drive *in_drive,
struct burn_disc **disc,
struct isoburn_imgen_opts *opts,
struct burn_drive *out_drive, off_t nwa);
/**
Revoke isoburn_prepare_*() instead of running isoburn_disc_write().
@ -2549,7 +2813,7 @@ int isoburn_set_truncate(struct burn_drive *drive, int flag);
/** Start writing of the new session.
This call is asynchrounous. I.e. it returns quite soon and the progress has
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()
@ -2648,7 +2912,7 @@ void isoburn_finish(void);
*/
/** Inquire wether the medium needs emulation or would be suitable for
/** 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

View File

@ -1,6 +1,7 @@
LIBISOBURN1 {
global:
isoburn_activate_session;
isoburn_assess_written_features;
isoburn_attach_image;
isoburn_attach_start_lba;
isoburn_conv_name_chars;
@ -40,12 +41,15 @@ isoburn_igopt_get_gpt_guid;
isoburn_igopt_get_hfsp_block_size;
isoburn_igopt_get_hfsp_serial_number;
isoburn_igopt_get_iso_mbr_part_type;
isoburn_igopt_get_iso_type_guid;
isoburn_igopt_get_level;
isoburn_igopt_get_max_ce_entries;
isoburn_igopt_get_out_charset;
isoburn_igopt_get_over_mode;
isoburn_igopt_get_over_ugid;
isoburn_igopt_get_part_flags;
isoburn_igopt_get_part_like_isohybrid;
isoburn_igopt_get_part_type_guid;
isoburn_igopt_get_partition_img;
isoburn_igopt_get_prep_partition;
isoburn_igopt_get_pvd_times;
@ -69,12 +73,15 @@ isoburn_igopt_set_gpt_guid;
isoburn_igopt_set_hfsp_block_size;
isoburn_igopt_set_hfsp_serial_number;
isoburn_igopt_set_iso_mbr_part_type;
isoburn_igopt_set_iso_type_guid;
isoburn_igopt_set_level;
isoburn_igopt_set_max_ce_entries;
isoburn_igopt_set_out_charset;
isoburn_igopt_set_over_mode;
isoburn_igopt_set_over_ugid;
isoburn_igopt_set_part_flag;
isoburn_igopt_set_part_like_isohybrid;
isoburn_igopt_set_part_type_guid;
isoburn_igopt_set_partition_img;
isoburn_igopt_set_prep_partition;
isoburn_igopt_set_pvd_times;
@ -107,6 +114,7 @@ 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;
@ -167,6 +175,7 @@ Xorriso_option_application_id;
Xorriso_option_application_use;
Xorriso_option_as;
Xorriso_option_assert_volid;
Xorriso_option_assess_indev_features;
Xorriso_option_auto_charset;
Xorriso_option_backslash_codes;
Xorriso_option_ban_stdio_write;
@ -205,6 +214,7 @@ 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;
@ -216,6 +226,7 @@ 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;
@ -230,9 +241,11 @@ 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;
@ -350,3 +363,18 @@ Xorriso_stop_msg_watcher;
local: *;
};
LIBISOBURN1_1.5.8 {
isoburn_attach_start_lba_v2;
isoburn_disc_get_msc1_v2;
isoburn_disc_track_lba_nwa_v2;
isoburn_get_attached_start_lba_v2;
isoburn_get_mount_params_v2;
isoburn_igopt_get_data_start_v2;
isoburn_igopt_get_effective_lba_v2;
isoburn_prepare_blind_grow_v2;
isoburn_read_iso_head_v2;
isoburn_toc_disc_get_sectors_v2;
isoburn_toc_session_get_sectors_v2;
isoburn_toc_track_get_emul_v2;
} LIBISOBURN1;

View File

@ -5,7 +5,8 @@ libisoburn/releng. By George Danchev <danchev@spnet.net>
and Thomas Schmitt <scdbackup@gmx.net>
Test suite for xorriso and libburnia libraries.
Copyright (C) 2011 - 2012 George Danchev, Thomas Schmitt
Copyright (C) 2011 - 2012 George Danchev
Copyright (C) 2011, 2012, 2019 Thomas Schmitt
Provided under GPL version 2 or later.
------------------------------------------------------------------------------
@ -33,7 +34,7 @@ can be configured and built. It is not mandatory that libisoburn is already
installed. The tests may use an installed xorriso program as well as a
freshly built one.
The test scripts explicitely demand /bin/bash as interpreter, although they
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.
@ -120,17 +121,18 @@ the user or require sysadmin considerations before they are run:
as one single argument. On Solaris use:
--priv_cmd pfexec
./manual_isojigdo -x ../xorriso/xorriso
./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 270 MB,
extracts its content and composes a new image. Thus it needs about 850 MB
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.2 GB.
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.18, available at:
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.
@ -139,8 +141,9 @@ 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.
in C++ programs and linking of the libraries. It is possible to override the
use of g++ as compiler by shell variable CC. It might be necessary to set
compiler options by shell variable CFLAGS before running the test.
It might be necessary to hand over the install directory of libburn and
libisofs in shell variable LD_LIBRARY_PATH.
E.g. if on FreeBSD the include headers libisofs.h , libburn.h are not found:
@ -188,7 +191,7 @@ Known to be suitable are the following shells
Solaris: /bin/bash , /bin/i86/ksh93
In general, the shell should have Bourne shell ancestry.
The script does not choose an interpreter explicitely and is safe to be run
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

View File

@ -29,7 +29,7 @@ fi
# xorriso binary is not needed for that particular test
SAMPLE_CODE_DIR=codesamples
CC=g++
CC=${CC:-g++}
# check compiler
if ! which "${CC}" >/dev/null 2>&1; then

View File

@ -1,16 +1,18 @@
#!/bin/sh
# Copyright (c) 2010, 2011 George Danchev <danchev@spnet.net>
# Copyright (c) 2010, 2011 Thomas Schmitt <scdbackup@gmx.net>
# Copyright (c) 2010, 2011, 2019 Thomas Schmitt <scdbackup@gmx.net>
# This script is distributed according to the terms of the GNU GPL v2.
# This should be better rewritten in C at some future point. Ref: pwd code.
# Create a list of MD5sums encoded in hexidecimal format and print to standard output
# 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 MD5 checksum of the file content must be encoded in 32 hex digits
# The checksum of the file content must be encoded in the aprropriate number
# of hex digits.
# [0-9afAF]
#
# Next come two blanks.
@ -37,35 +39,61 @@
# text, like "Debian:".
# A simple strategy to cope with this is to write absolute paths into the
# .md5 file, and to use matching absolute paths in the -jigdo-map
# 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.2
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.
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
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
@ -100,12 +128,18 @@ md5list() {
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 : No MD5 program found" >&2
echo "$0 : Internal error : Checksum mode unknown : $md5_cmd" >&2
exit 2
fi
SIZ=`ls -ld "$item" | awk '{print $5}'`
printf '%32s %12s %s\n' "$MD5" "$SIZ" "$item"
printf '%'"$hex_length"'s %12s %s\n' "$MD5" "$SIZ" "$item"
}
walkdir() {
@ -123,7 +157,17 @@ if test "$1" = "" ; then
exit 1
fi
case "$1" in
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;
@ -147,12 +191,15 @@ case "$1" in
# usage
# exit 1
# ;;
esac
esac
done
choose_checksum_cmd
for i in "$@"
do
if test -d "$i" ; then
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

View File

@ -1,7 +1,7 @@
.\" 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 hexidecimal format and print to standard output
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

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Copyright 2011 Thomas Schmitt <scdbackup@gmx.net>
# Copyright 2011, 2019 Thomas Schmitt <scdbackup@gmx.net>
# Copyright 2011 George Danchev <danchev@spnet.net>
# Licensed under GNU GPL version 2 or later
@ -16,7 +16,8 @@ not_in_releng_exit() {
print_specific_help() {
cat << HLP
Specific options:
none yet.
--md5 use MD5 checksums (default)
--sha256 use SHA256 checksums
Overview:
Match the resulting ISO image representation
against the jigdo representation.
@ -28,6 +29,33 @@ if test "$SPECIFIC_HELP" = 1; then
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"
@ -87,7 +115,10 @@ case ${RETCODE_VER_JTE} in
esac
# grab remote ISO image, to decompose
if [ ! -f "${TMP_DATA_DIR}"/"${REMOTE_IMG}" ]; then
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
@ -206,9 +237,9 @@ 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 MD5 list in hex format in ${JIGDO_GEN_MD5}..."
printf "${SELF}: Creating $checksum_type list in hex format in ${JIGDO_GEN_MD5}..."
set +e
./jigdo-gen-md5-list ${RELENG_DIR} > ${JIGDO_GEN_MD5}
./jigdo-gen-md5-list "--""$checksum_type" ${RELENG_DIR} > ${JIGDO_GEN_MD5}
ret=$?
set -e
@ -224,12 +255,13 @@ 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} \
-md5-list ${JIGDO_GEN_MD5} \
-checksum-list ${JIGDO_GEN_MD5} \
-jigdo-min-file-size 1024 \
"

View File

@ -229,16 +229,22 @@ fi
# lines, perl regex, leading tabs
grep -n -E "${LIST_KWD}" "${CLOG}"
RET_GREP="$?"
ok=0
case ${RET_GREP} in
0) # found
;;
1) # not found
echo "${SELF}: Log file looks clear." # | tee -a ${CLOG}
ok=1
;;
*) #
echo "${SELF}: grep returned EXIT CODE: ${RET_GREP}." # | tee -a ${CLOG}
;;
esac
if test "$ok" = 0 && test "$exit_value" = 0
then
exit_value=1
fi
set -e
fi
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | tee -a ${CLOG}
@ -259,5 +265,13 @@ fi
ls -lth "${GEN_DATA_DIR}" # | tee -a ${CLOG}
# Fin
if test "$exit_value" = 0
then
echo "${SELF}: +++ Test run and its log look like success."
else
echo
echo "${SELF}: --- Test run detected some failures."
echo
fi
exit $exit_value

View File

@ -103,6 +103,7 @@ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag)
int ret, differs= 0, r1, r2, fd1= -1, fd2= -1, i, done;
char buf1[4096], buf2[4096], a[4096], ttx1[40], ttx2[40];
off_t r1count= 0, r2count= 0, diffcount= 0, first_diff= -1;
double dcount;
ret= lstat(adr1, &s1);
if(ret==-1) {
@ -241,9 +242,13 @@ int Compare_2_files(char *adr1, char *adr2, char *adrc, int flag)
if(diffcount>0 || r1count!=r2count) {
if(first_diff<0)
first_diff= (r1count>r2count ? r2count : r1count);
if(r1count > r2count)
dcount= diffcount + (r1count - r2count);
else
dcount= diffcount + (r2count - r1count);
printf("%s : %s : differs by at least %.f bytes. First at %.f\n", a,
(s1.st_mtime==s2.st_mtime ? "CONTENT":"content"),
(double) (diffcount + abs(r1count-r2count)), (double) first_diff);
dcount, (double) first_diff);
differs= 1;
}
}
@ -298,8 +303,10 @@ int main(int argc, char **argv)
}
strcpy(adr1, argv[1]);
strcpy(adrc, argv[1]+strlen(argv[2]));
sprintf(adr2, "%s%s%s",
argv[3], (adrc[0]=='/' || adrc[0]==0 ? "" : "/"), adrc);
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);

370
test/merge_2_debian_isos Executable file
View File

@ -0,0 +1,370 @@
#!/bin/bash
echo >&2
echo "THIS SCRIPT IS DEPRECATED ! USE ITS SUCCESSOR: merge_debian_isos" >&2
echo >&2
echo "The script merge_2_debian_isos still exists only because it was mentioned">&2
echo "in Debian bug 1011343. The successor can merge more than two ISOs.">&2
echo "So do not edit this script to remove this warning and the 'exit 7' line.">&2
echo >&2
exit 7
usage() {
echo "usage: $(basename "$0") "'\' >&2
echo " boot_iso boot_mount add_iso add_mount result_iso [for_dist]" >&2
echo >&2
echo "Mounts by sudo the boot_iso at directory boot_mount and add_iso at" >&2
echo "add_mount, if not already mounted that way. Then both Debian pools" >&2
echo "and package lists get merged and a new ISO 9660 image result_iso" >&2
echo "is produced, which must not yet exist." >&2
echo "If boot_iso is bootable then the new image will be bootable by the" >&2
echo "same means." >&2
echo "This script creates the following temporary tree and files which" >&2
echo "must not yet exist in the current working directory:" >&2
echo " ./merged_dists , ./merged_md5sum.txt , ./merged_REAMDE.txt" >&2
echo " ./temp_file" >&2
echo "The optional sixth argument for_dist should only be given if" >&2
echo "this script refuses to work and proposes to give this argument." >&2
echo "Exported non-empty variable MERGE_DATE enforces a particular" >&2
echo "date string in the text which gets prepended to /README.txt ." >&2
echo "Exported non-empty variable XORRISO overrides command xorriso," >&2
echo "which may be needed if installed xorriso is older than 1.4.2." >&2
echo "Example using GNU xorriso-1.5.4 instead of /usr/bin/xorriso:" >&2
echo " export XORRISO="'$HOME'"/xorriso-1.5.4/xorriso/xorriso" >&2
echo " $(basename "$0") debian-11.2.0-amd64-DVD-1.iso /mnt/iso1 "'\' >&2
echo " debian-11.2.0-amd64-DVD-2.iso /mnt/iso2 merged.iso" >&2
}
if test "$#" -lt 5
then
usage
exit 1
fi
BOOT_ISO="$1"
BOOT_ISO_MOUNT="$2"
ADD_ISO="$3"
ADD_ISO_MOUNT="$4"
RESULT_ISO="$5"
# The sixth argument is optional
FOR_DIST="$6"
## Check arguments
if test -e "$RESULT_ISO"
then
echo "--- A file '""$RESULT_ISO""' is already existing." >&2
echo "--- Will not overwrite it by the resulting ISO image." >&2
exit 1
fi
if test -e merged_dists || test -e merged_md5sum.txt || test -e temp_file \
|| test -e merged_README.txt
then
echo "--- At least one of ./merged_dists, ./merged_md5sum.txt, ./temp_file," >&2
echo "--- or merged_README.txt is already existing. Will not overwrite them." >&2
exit 1
fi
if test "$BOOT_ISO" = "$RESULT_ISO" || test "$BOOT_ISO" = "$ADD_ISO" || \
test "$ADD_ISO" = "$RESULT_ISO"
then
echo "--- At least two of the three given ISO image paths are equal." >&2
echo "--- boot_iso and add_iso must exist and differ, result_iso must not exist." >&2
usage
exit 1
fi
## Mount and copy out the files which need to be changed
do_mount_1=1
x=$(mount | grep " $BOOT_ISO_MOUNT " | awk '{print $1}')
if test -n "$x"
then
i1=$(ls -i "$x" | awk '{print $1}')
i2=$(ls -i "$BOOT_ISO" | awk '{print $1}')
if test "$i1" = "$i2"
then
do_mount_1=0
echo "Note: Found $BOOT_ISO already mounted at $BOOT_ISO_MOUNT"
fi
fi
if test "$do_mount_1" = 1
then
echo "Note: sudo mount $BOOT_ISO $BOOT_ISO_MOUNT"
sudo mount "$BOOT_ISO" "$BOOT_ISO_MOUNT" || exit 3
fi
cp -a "$BOOT_ISO_MOUNT/dists" merged_dists
cp -a "$BOOT_ISO_MOUNT/md5sum.txt" merged_md5sum.txt
chmod -R u+w merged_dists
chmod u+w merged_md5sum.txt
do_mount_2=1
x=$(mount | grep " $ADD_ISO_MOUNT " | awk '{print $1}')
if test -n "$x"
then
i1=$(ls -i "$x" | awk '{print $1}')
i2=$(ls -i "$ADD_ISO" | awk '{print $1}')
if test "$i1" = "$i2"
then
do_mount_2=0
echo "Note: Found $ADD_ISO already mounted at $ADD_ISO_MOUNT"
fi
fi
if test "$do_mount_2" = 1
then
echo "Note: sudo mount $ADD_ISO $ADD_ISO_MOUNT"
if sudo mount "$ADD_ISO" "$ADD_ISO_MOUNT"
then
dummy=dummy
else
if test "$do_mount_1"
then
sudo umount "$BOOT_ISO_MOUNT"
fi
exit 3
fi
fi
## Helper functions
# Put out the list of checksummed paths as listed in /dists/$dist/Release
extract_checksum_paths() {
mode=0
cat "$1" | \
while true
do
read x || break
if test "$x" = "MD5Sum:" || test "$x" = "SHA1:" \
|| test "$x" = "SHA256:" || test "$x" = "SHA512:"
then
if test "$mode" = 0
then
mode=1
elif test "$mode" = 1
then
break
fi
elif test "$mode" = 1
then
echo "$x"
fi
done
}
# Put out the part before the first checksum field
extract_release_head() {
cat "$1" | \
while true
do
read x || break
if test "$x" = "MD5Sum:" || test "$x" = "SHA1:" \
|| test "$x" = "SHA256:" || test "$x" = "SHA512:"
then
break
fi
echo "$x"
done
}
## Determine which Debian release is on BOOT_ISO
dist=
for i in $(ls -1d "$BOOT_ISO_MOUNT"/dists/*)
do
if test -d "$i"
then
if test -L "$i"
then
continue
fi
test -n "$dist" && dist="$dist "
dist="$dist""$(basename $i)"
fi
done
if test -z "$dist"
then
if test -z "$FOR_DIST"
then
echo "--- Cannot determine Debian release from directories in /dists" >&2
echo "--- (You may provide the release name as sixth argument)" >&2
echo >&2
usage
exit 2
fi
elif test "$(echo "$dist" | wc -w)" -gt 1
then
if test -z "$FOR_DIST"
then
echo "--- More than one Debian release found in /dists: $dist" >&2
echo "--- (You may provide the release name as sixth argument)" >&2
echo >&2
usage
exit 2
fi
fi
if test -n "$FOR_DIST"
then
echo "Note: Overriding release name '$dist' by '""$FOR_DIST""'" >&2
dist="$FOR_DIST"
fi
if test -d "$BOOT_ISO_MOUNT"/dists/"$dist"
then
echo "Note: Will work along $BOOT_ISO_MOUNT"/dists/"$dist"/Release >&2
else
echo "--- Cannot find directory $BOOT_ISO_MOUNT"/dists/"$dist" >&2
exit 2
fi
## Prepend info to /README.txt
if test -z "$MERGE_DATE"
then
MERGE_DATE=$(date +'%Y%m%d-%H:%M')
fi
printf 'Result of a run of %s at %s\r\n' \
"$(basename $0)" "$MERGE_DATE" >temp_file
printf 'Package pools and Packages lists were merged.\r\n' >>temp_file
printf 'The other files stem from the first input ISO.\r\n' >>temp_file
printf '\r\n' >>temp_file
printf 'Input ISO: %s\r\n' "$BOOT_ISO" >>temp_file
head -2 "$BOOT_ISO_MOUNT"/README.txt >>temp_file
printf '\r\n' >>temp_file
printf 'Input ISO: %s\r\n' "$ADD_ISO" >>temp_file
head -2 "$ADD_ISO_MOUNT"/README.txt >>temp_file
printf '\r\n' >>temp_file
printf '%s%s\r\n' " --------------------------------------" \
"----------------------------------------" >>temp_file
printf '\r\n' >>temp_file
cat "$BOOT_ISO_MOUNT"/README.txt >>temp_file
mv temp_file merged_README.txt
## Merge package description files with those from "$ADD_ISO"
# /md5sum.txt seems to be the only overall package list
cat merged_md5sum.txt "$ADD_ISO_MOUNT"/md5sum.txt | sort >temp_file
mv temp_file merged_md5sum.txt
# Determine the files which are mentioned with checksum in main Release files
path_list=$( (extract_checksum_paths merged_dists/"$dist"/Release
extract_checksum_paths "$ADD_ISO_MOUNT"/dists/"$dist"/Release ) \
| awk '{print $3}' | sort | uniq )
# Merge .gz files (Release should not be merged. Unclear what others need.)
for i in $path_list
do
if echo "$i" | grep -v '.gz$' >/dev/null
then
continue
fi
if test -e merged_dists/"$dist"/"$i"
then
if test -e "$ADD_ISO_MOUNT"/dists/"$dist"/"$i"
then
if test "$(gunzip <merged_dists/"$dist"/"$i" | tail -1)" = ""
then
empty_line=
else
empty_line=echo
fi
( gunzip <merged_dists/"$dist"/"$i"
$empty_line
gunzip <"$ADD_ISO_MOUNT"/dists/"$dist"/"$i" ) | gzip >temp_file
mv temp_file merged_dists/"$dist"/"$i"
fi
elif test -e "$ADD_ISO_MOUNT"/dists/"$dist"/"$i"
then
if test -e $(dirname merged_dists/"$dist"/"$i")
then
dummy=dummy
else
mkdir -p $(dirname merged_dists/"$dist"/"$i")
fi
cp "$ADD_ISO_MOUNT"/dists/"$dist"/"$i" merged_dists/"$dist"/"$i"
fi
test -e temp_file && rm temp_file
done
## Update dists/"$dist"/Release
extract_release_head merged_dists/"$dist"/Release >temp_file
# Re-create "MD5Sum:", "SHA256:", "SHA512:" sections
for cmd in md5sum sha1sum sha256sum sha512sum
do
if type "$cmd" >/dev/null
then
case "$cmd" in
md5sum) echo "MD5Sum:" ;;
sha1sum) echo "SHA1:" ;;
sha256sum) echo "SHA256:" ;;
sha512sum) echo "SHA512:" ;;
esac
for i in $path_list
do
file=merged_dists/"$dist"/"$i"
if test -e "$file"
then
sum=$("$cmd" "$file" | awk '{print $1}')
size=$(stat -c '%s' "$file")
elif test -e "$file".gz
then
sum=$(gunzip <"$file".gz | "$cmd" | awk '{print $1}')
size=$(gunzip <"$file".gz | wc -c)
else
continue
fi
list_path=$(echo "$file" | sed -e 's/^merged_dists\/'"$dist"'\///')
printf ' %s %8ld %s\n' "$sum" "$size" "$list_path"
done
fi
done >>temp_file
mv temp_file merged_dists/"$dist"/Release
## Produce the new ISO image
if test -z "$XORRISO"
then
XORRISO=xorriso
fi
"$XORRISO" \
-indev "$BOOT_ISO" \
-outdev "$RESULT_ISO" \
-map "$ADD_ISO_MOUNT"/pool /pool \
-map merged_dists /dists \
-map merged_md5sum.txt /md5sum.txt \
-map merged_README.txt /README.txt \
-chown_r 0 /dists /md5sum.txt /README.txt -- \
-chgrp_r 0 /dists /md5sum.txt /README.txt -- \
-chmod_r a-w /dists /md5sum.txt -- \
-chmod_r a=r /README.txt -- \
-boot_image any replay \
-stdio_sync off \
-padding included \
-compliance no_emul_toc
## Clean up
if test "$do_mount_1" = 1
then
sudo umount "$BOOT_ISO_MOUNT"
fi
if test "$do_mount_2" = 1
then
sudo umount "$ADD_ISO_MOUNT"
fi
rm -r merged_dists merged_md5sum.txt merged_README.txt

1136
test/merge_debian_isos Executable file

File diff suppressed because it is too large Load Diff

293
test/merge_debian_isos.1 Normal file
View File

@ -0,0 +1,293 @@
.\" Hey, EMACS: -*- nroff -*-
.\"
.\" IMPORTANT NOTE:
.\"
.\" The original of this file is kept in test/merge_debian_isos.texi
.\" This here was generated by program xorriso/make_xorriso_1
.\"
.\"
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH MERGE_DEBIAN_ISOS 1 "Version 1.5.7, Jun 07, 2023"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.nh
.SH NAME
merge_debian_isos \- Program to merge multiple debian\-cd ISO images
.SH SYNOPSIS
.B merge_debian_isos
result_iso mount_template iso1 iso2 [... isoN]
.br
.SH DESCRIPTION
.PP
\fBmerge_debian_isos\fR
mounts by \fBsudo\fR the ISO 9660 images iso1 to isoN at directories
mount_template1 to mount_templateN, if not already mounted that way.
Then the Debian pools and package lists get merged and a new
ISO 9660 image result_iso is produced by a run of \fBxorriso\fR.
If iso1 is bootable then
the new image will be bootable by the same means.
.br
.PP
The file depicted by result_iso must not yet exist or has to be a
device which is acceptable for Linux\-specific helper script
\fBxorriso\-dd\-target\fR. If xorriso\-dd\-target agrees and the user
confirms by input "yes" then xorriso will be run under sudo.
.br
Exempted from this evaluation are addresses which begin by "mmc:"
for an optical drive on Linux, BSDs, Solaris, or by "stdio:/dev/"
for which the user takes full and dangerous responsibility.
.br
Special result_iso path \fBxorriso\-dd\-target\-plug\-test\fR determines
on systems with Linux kernel the target USB stick by a dialog around plugging
it in.
xorriso will be run under sudo, if xorriso\-dd\-target agrees and
the user confirms by input "yes".
.br
.PP
At least the parent directory of argument \fBmount_template\fR must already
exist or has to be given by a plain name without "/" so that it can be
created in the current directory. (I.e. without even "./".)
.br
All arguments must be single words without using quotation marks.
None of the isoN must be equal to another isoM.
.br
.PP
This script creates and finally removes the following temporary tree
and files which must not yet exist in the current working directory:
./merged_dists , ./merged_md5sum.txt , ./merged_REAMDE.txt
./temp_file
.br
Further it creates and finally removes directories mount_template*
if they are needed and do not exist when the script starts. If the
parent directory in the mount_template path does not exist and
its path contains no "/" then it gets created and finally removed.
The script depends on the following programs:
.br
awk, basename, cat, chmod, cp, date, dirname, expr, fgrep, grep,
gunzip, gzip, head, ls, md5sum, mkdir, mount, mv, rm, rmdir,
sed, sh, sha256sum, sort, stat, sudo, umount, uniq, xorriso
.br
With device writing involving helper script xorriso\-dd\-target:
.br
dd, Linux kernel, lsblk, sleep, tr, uname, wc, whoami,
xorriso\-dd\-target
.br
Recommended are: sha1sum, sha512sum
.SS
.br
.SH OPTIONS
.br
.PP
merge_debian_isos has no command line options besides the input words described
above, but it reacts on some environment variables.
.br
See section ENVIRONMENT.
.br
.PP
If less than 4 arguments are given, the script will print its help text to
standard error and exit with non\-zero value, indicating failure.
.SS
.SH EXAMPLES
.SS
.B Overview of examples:
Merge DVD images 1 to 5
.br
Use GNU xorriso instead of installed xorriso
.br
Write result directly to an optical drive
.br
Write result directly and safely to USB stick (Linux only)
.br
Write result directly and unsafely to USB stick
.SS
.B Merge DVD images 1 to 5
The resulting image will be named "merged.iso".
.br
Directory ./merge_mount/ will be created if not yet existing.
.br
merge_debian_isos merged.iso merge_mount/iso \\
debian\-11.2.0\-amd64\-DVD\-[12345].iso
.br
Expect to see some harmless warnings like
.br
xorriso : WARNING : \-volid text does not comply to ISO 9660 / ECMA 119 rules
libisofs: WARNING : Cannot add /debian to Joliet tree. Symlinks can only be added to a Rock Ridge tree.
libisofs: WARNING : Image size exceeds 1024 cylinders. Cannot align partition.
.SS
.B Use GNU xorriso instead of installed xorriso
merge_debian_isos will refuse to work if the installed version of xorriso
is older than 1.4.2. In this case consider to download and compile the
GNU xorriso tarball from
.br
https://www.gnu.org/software/xorriso/#download
.br
You may use it without installing it after compilation and thus without
disturbing your system's package management. Assumed that you unpacked the
xorriso\-1.5.6 tarball in your $HOME directory and have successfully compiled
it, do:
.br
export XORRISO="$HOME"/xorriso\-1.5.6/xorriso/xorriso
.br
merge_debian_isos merged.iso merge_mount/iso \\
debian\-11.2.0\-amd64\-DVD\-[12345].iso
.SS
.B Write result directly to an optical drive
xorriso is able to burn optical media on GNU/Linux (/dev/sr*),
Solaris (/dev/rdsk/*) , FreeBSD (/dev/cd*) , NetBSD (/dev/rcd*),
and OpenBSD (/dev/rcd*). Get a list of available optical drive devices by:
.br
xorriso \-devices
.br
It might be that you need superuser powers for this and then have to enable
access to the device file for the user who runs merge_debian_isos.
.br
In order to directly write the merged ISO image to an optical medium,
use the desired device file path with prefix "mmc:":
.br
merge_debian_isos mmc:/dev/sr0 merge_mount/iso \\
debian\-11.2.0\-amd64\-DVD\-[12345].iso
.SS
.B Write result directly and safely to USB stick (Linux only)
The Linux\-specific script \fBxorriso\-dd\-target\fR evaluates device files
whether they and their content look unimportant enough for being overwritten
by an image file.
.br
This mainly means that the storage device is attached to USB and contains
no filesystems which are not of type FAT or ISO 9660.
.br
You may get xorriso\-dd\-target by:
.br
wget \\
https://dev.lovelyhq.com/libburnia/libisoburn/raw/master/xorriso\-dd\-target/xorriso\-dd\-target
chmod u+x xorriso\-dd\-target
.br
Consider to also download xorriso\-dd\-target.sig and to verify the script by
.br
gpg \-\-verify xorriso\-dd\-target.sig xorriso\-dd\-target
.br
Announce the storage location of the downloaded xorriso\-dd\-target:
.br
export XORRISO_DD_TARGET_PATH="$(pwd)"
.br
The prepared use case in merge_debian_isos uses the xorriso\-dd\-target
option \-plug_test under \fBsudo\fR, which asks the user for first having
the desired USB stick unplugged so that the unwanted devices can get
registered. Then it asks the user to plug in the USB stick, so that it gets
recognized as desired target.
.br
xorriso\-dd\-target evaluates the content and decides whether it looks
disposable enough. If so, then it allows merge_debian_isos to write its
result to the device.
.br
merge_debian_isos xorriso\-dd\-target\-plug\-test merge_mount/iso \\
debian\-11.2.0\-amd64\-DVD\-[12345].iso
.SS
.B Write result directly and unsafely to USB stick
On operating systems other than GNU/Linux or with storage devices not
acceptable to xorriso\-dd\-target it is possible to remove all safety
precautions beyond those of xorriso, which can be overcome by "blanking"
the device.
.br
So after due evaluation of the device situation and on your very own risk
you may use the device path prefix "stdio:", possibly with superuser powers:
.br
xorriso \-outdev stdio:/dev/sdd \-blank as_needed
merge_debian_isos stdio:/dev/sdd merge_mount/iso \\
debian\-11.2.0\-amd64\-DVD\-[12345].iso
For details about "stdio:" and pseudo\-blanking non\-optical devices read
man xorriso.
.br
The xorriso run in merge_debian_isos ignores locally defined xorriso startup
files (by command \-no_rc).
.SH FILES
For now, no files are defined for configuration.
.SH ENVIRONMENT
The following environment variables influence the program behavior:
.br
Exported non\-empty variable MERGE_DATE enforces a particular
date string in the text which gets prepended to /README.txt .
.br
Exported non\-empty variable MERGE_FOR_DIST enforces the use of a
particular directory in /dists of iso1. Normally only one
such directory is found and thus no need to set MERGE_FOR_DIST.
.br
Exported non\-empty variable MERGE_KEEP_ISO prevents the removal
of result_iso after xorriso indicated failure of production.
.br
Exported non\-empty variable XORRISO gives the path to a xorriso binary,
which will be used instead of the system\-wide installed xorriso binary.
This may be needed if installed xorriso is older than 1.4.2.
.br
If XORRISO is set to "dummy" then no new ISO will emerge.
.br
Exported non\-empty variable XORRISO_DD_TARGET_PATH names the
directory where to find xorriso\-dd\-target, which evaluates the
suitability of result_iso devices or does the plug\-test dialog.
.br
.SH SEE ALSO
.BR xorriso(1),
.BR xorriso-dd-target(1),
.SH BUGS
To report bugs, request help, or suggest enhancements for
\fBmerge_debian_isos\fR,
please send electronic mail to the public list <bug\-xorriso@gnu.org>.
If more privacy is desired, mail to <scdbackup@gmx.net>.
.br
Please describe what you expect the program to do, the program arguments
which you used, the messages of \fBmerge_debian_isos\fR, and the
undesirable outcome of your program run.
.br
Expect to get asked more questions before solutions can be proposed.
.SH AUTHOR
Thomas Schmitt <scdbackup@gmx.net>
.br
for libburnia\-project.org
.SH COPYRIGHT
Copyright (c) 2023 Thomas Schmitt
.br
Permission is granted to distribute this text freely. It shall only be
modified in sync with the technical properties of merge_debian_isos.
If you make use of the license to derive modified versions of merge_debian_isos
then you are entitled to modify this text under that same license.
.SH CREDITS
\fBmerge_debian_isos\fR was originally developed with advise and testing
by Zhang Boyang in the course of Debian bug #1011343. Steve McIntyre provided
information about various file aspects of debian\-cd ISO images.

359
test/merge_debian_isos.info Normal file
View File

@ -0,0 +1,359 @@
This is merge_debian_isos.info, produced by makeinfo version 5.2 from
merge_debian_isos.texi.
merge_debian_isos - sh script to merge multiple debian-cd ISO images
Copyright (C) 2023 Thomas Schmitt
Permission is granted to distribute this text freely.
INFO-DIR-SECTION Archiving
START-INFO-DIR-ENTRY
* Merge_debian_isos: (merge_debian_isos). Merge debian-cd ISO images to a single image
END-INFO-DIR-ENTRY

File: merge_debian_isos.info, Node: Top, Next: Overview, Up: (dir)
merge_debian_isos 1.5.7
***********************
merge_debian_isos - Program to merge multiple debian-cd ISO images
* Menu:
* Overview:: Overview
* Options:: Options
* Examples:: Examples
* Files:: Files
* Environ:: Environment
* Seealso:: See also
* Bugreport:: Reporting bugs
* Legal:: Author, Copyright, Credits
* CommandIdx:: Alphabetic Option List
* ConceptIdx:: Alphabetic List of Concepts and Objects

File: merge_debian_isos.info, Node: Overview, Next: Options, Prev: Top, Up: Top
1 Overview
**********
'merge_debian_isos' mounts by *sudo* the ISO 9660 images iso1 to isoN at
directories mount_template1 to mount_templateN, if not already mounted
that way. Then the Debian pools and package lists get merged and a new
ISO 9660 image result_iso is produced by a run of *xorriso*. If iso1 is
bootable then the new image will be bootable by the same means.
The file depicted by result_iso must not yet exist or has to be a
device which is acceptable for Linux-specific helper script
*xorriso-dd-target*. If xorriso-dd-target agrees and the user confirms
by input "yes" then xorriso will be run under sudo.
Exempted from this evaluation are addresses which begin by "mmc:" for an
optical drive on Linux, BSDs, Solaris, or by "stdio:/dev/" for which the
user takes full and dangerous responsibility.
Special result_iso path *xorriso-dd-target-plug-test* determines on
systems with Linux kernel the target USB stick by a dialog around
plugging it in. xorriso will be run under sudo, if xorriso-dd-target
agrees and the user confirms by input "yes".
At least the parent directory of argument *mount_template* must
already exist or has to be given by a plain name without "/" so that it
can be created in the current directory. (I.e. without even "./".)
All arguments must be single words without using quotation marks. None
of the isoN must be equal to another isoM.
This script creates and finally removes the following temporary tree
and files which must not yet exist in the current working directory:
./merged_dists , ./merged_md5sum.txt , ./merged_REAMDE.txt ./temp_file
Further it creates and finally removes directories mount_template* if
they are needed and do not exist when the script starts. If the parent
directory in the mount_template path does not exist and its path
contains no "/" then it gets created and finally removed. The script
depends on the following programs:
awk, basename, cat, chmod, cp, date, dirname, expr, fgrep, grep, gunzip,
gzip, head, ls, md5sum, mkdir, mount, mv, rm, rmdir, sed, sh, sha256sum,
sort, stat, sudo, umount, uniq, xorriso
With device writing involving helper script xorriso-dd-target:
dd, Linux kernel, lsblk, sleep, tr, uname, wc, whoami, xorriso-dd-target
Recommended are: sha1sum, sha512sum

File: merge_debian_isos.info, Node: Options, Next: Examples, Prev: Overview, Up: Top
2 Options
*********
merge_debian_isos has no command line options besides the input words
described above, but it reacts on some environment variables.
If less than 4 arguments are given, the script will print its help
text to standard error and exit with non-zero value, indicating failure.

File: merge_debian_isos.info, Node: Examples, Next: Files, Prev: Options, Up: Top
3 Examples
**********
* Menu:
* ExPlain:: Merge DVD images 1 to 5
* ExXorriso:: Use GNU xorriso instead of installed xorriso
* ExOptical:: Write result directly to an optical drive
* ExDdTarget:: Write result directly and safely to USB stick (Linux only)
* ExStdio:: Write result directly and unsafely to USB stick

File: merge_debian_isos.info, Node: ExPlain, Next: ExXorriso, Prev: Options, Up: Examples
3.1 Merge DVD images 1 to 5
===========================
The resulting image will be named "merged.iso".
Directory ./merge_mount/ will be created if not yet existing.
merge_debian_isos merged.iso merge_mount/iso \
debian-11.2.0-amd64-DVD-[12345].iso
Expect to see some harmless warnings like
xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA
119 rules
libisofs: WARNING : Cannot add /debian to Joliet tree. Symlinks can
only be added to a Rock Ridge tree.
libisofs: WARNING : Image size exceeds 1024 cylinders. Cannot align
partition.

File: merge_debian_isos.info, Node: ExXorriso, Next: ExOptical, Prev: ExPlain, Up: Examples
3.2 Use GNU xorriso instead of installed xorriso
================================================
merge_debian_isos will refuse to work if the installed version of
xorriso is older than 1.4.2. In this case consider to download and
compile the GNU xorriso tarball from
https://www.gnu.org/software/xorriso/#download
You may use it without installing it after compilation and thus without
disturbing your system's package management. Assumed that you unpacked
the xorriso-1.5.6 tarball in your $HOME directory and have successfully
compiled it, do:
export XORRISO="$HOME"/xorriso-1.5.6/xorriso/xorriso
merge_debian_isos merged.iso merge_mount/iso \
debian-11.2.0-amd64-DVD-[12345].iso

File: merge_debian_isos.info, Node: ExOptical, Next: ExDdTarget, Prev: ExXorriso, Up: Examples
3.3 Write result directly to an optical drive
=============================================
xorriso is able to burn optical media on GNU/Linux (/dev/sr*), Solaris
(/dev/rdsk/*) , FreeBSD (/dev/cd*) , NetBSD (/dev/rcd*), and OpenBSD
(/dev/rcd*). Get a list of available optical drive devices by:
xorriso -devices
It might be that you need superuser powers for this and then have to
enable access to the device file for the user who runs
merge_debian_isos.
In order to directly write the merged ISO image to an optical medium,
use the desired device file path with prefix "mmc:":
merge_debian_isos mmc:/dev/sr0 merge_mount/iso \
debian-11.2.0-amd64-DVD-[12345].iso

File: merge_debian_isos.info, Node: ExDdTarget, Next: ExStdio, Prev: ExOptical, Up: Examples
3.4 Write result directly and safely to USB stick (Linux only)
==============================================================
The Linux-specific script *xorriso-dd-target* evaluates device files
whether they and their content look unimportant enough for being
overwritten by an image file.
This mainly means that the storage device is attached to USB and
contains no filesystems which are not of type FAT or ISO 9660.
You may get xorriso-dd-target by:
wget \
https://dev.lovelyhq.com/libburnia/libisoburn/raw/master/xorriso-dd-target/xorriso-dd-target
chmod u+x xorriso-dd-target
Consider to also download xorriso-dd-target.sig and to verify the
script by
gpg -verify xorriso-dd-target.sig xorriso-dd-target
Announce the storage location of the downloaded xorriso-dd-target:
export XORRISO_DD_TARGET_PATH="$(pwd)"
The prepared use case in merge_debian_isos uses the xorriso-dd-target
option -plug_test under *sudo*, which asks the user for first having the
desired USB stick unplugged so that the unwanted devices can get
registered. Then it asks the user to plug in the USB stick, so that it
gets recognized as desired target.
xorriso-dd-target evaluates the content and decides whether it looks
disposable enough. If so, then it allows merge_debian_isos to write its
result to the device.
merge_debian_isos xorriso-dd-target-plug-test merge_mount/iso \
debian-11.2.0-amd64-DVD-[12345].iso

File: merge_debian_isos.info, Node: ExStdio, Next: Files, Prev: ExDdTarget, Up: Examples
3.5 Write result directly and unsafely to USB stick
===================================================
On operating systems other than GNU/Linux or with storage devices not
acceptable to xorriso-dd-target it is possible to remove all safety
precautions beyond those of xorriso, which can be overcome by "blanking"
the device.
So after due evaluation of the device situation and on your very own
risk you may use the device path prefix "stdio:", possibly with
superuser powers:
xorriso -outdev stdio:/dev/sdd -blank as_needed
merge_debian_isos stdio:/dev/sdd merge_mount/iso \
debian-11.2.0-amd64-DVD-[12345].iso
For details about "stdio:" and pseudo-blanking non-optical devices
read man xorriso.
The xorriso run in merge_debian_isos ignores locally defined xorriso
startup files (by command -no_rc).

File: merge_debian_isos.info, Node: Files, Next: Environ, Prev: Examples, Up: Top
4 Files
*******
For now, no files are defined for configuration.

File: merge_debian_isos.info, Node: Environ, Next: Seealso, Prev: Files, Up: Top
5 Environ
*********
The following environment variables influence the program behavior:
Exported non-empty variable MERGE_DATE enforces a particular date string
in the text which gets prepended to /README.txt .
Exported non-empty variable MERGE_FOR_DIST enforces the use of a
particular directory in /dists of iso1. Normally only one such
directory is found and thus no need to set MERGE_FOR_DIST.
Exported non-empty variable MERGE_KEEP_ISO prevents the removal of
result_iso after xorriso indicated failure of production.
Exported non-empty variable XORRISO gives the path to a xorriso binary,
which will be used instead of the system-wide installed xorriso binary.
This may be needed if installed xorriso is older than 1.4.2.
If XORRISO is set to "dummy" then no new ISO will emerge.
Exported non-empty variable XORRISO_DD_TARGET_PATH names the directory
where to find xorriso-dd-target, which evaluates the suitability of
result_iso devices or does the plug-test dialog.

File: merge_debian_isos.info, Node: Seealso, Next: Bugreport, Prev: Environ, Up: Top
6 See also
**********
xorriso(1), xorriso-dd-target(1)

File: merge_debian_isos.info, Node: Bugreport, Next: Legal, Prev: Seealso, Up: Top
7 Reporting bugs
****************
To report bugs, request help, or suggest enhancements for
'merge_debian_isos', please send electronic mail to the public list
<bug-xorriso@gnu.org>. If more privacy is desired, mail to
<scdbackup@gmx.net>.
Please describe what you expect the program to do, the program
arguments which you used, the messages of 'merge_debian_isos', and the
undesirable outcome of your program run.
Expect to get asked more questions before solutions can be proposed.

File: merge_debian_isos.info, Node: Legal, Next: CommandIdx, Prev: Bugreport, Up: Top
8 Author, Copyright, Credits
****************************
8.1 Author
==========
Thomas Schmitt <scdbackup@gmx.net>
for libburnia-project.org
8.2 Copyright
=============
Copyright (c) 2023 Thomas Schmitt
Permission is granted to distribute this text freely. It shall only be
modified in sync with the technical properties of merge_debian_isos. If
you make use of the license to derive modified versions of
merge_debian_isos then you are entitled to modify this text under that
same license.
8.3 Credits
===========
'merge_debian_isos' was originally developed with advise and testing by
Zhang Boyang in the course of Debian bug #1011343. Steve McIntyre
provided information about various file aspects of debian-cd ISO images.

File: merge_debian_isos.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: Top
9 Alphabetic Options List
*************************

File: merge_debian_isos.info, Node: ConceptIdx, Next: Top, Prev: CommandIdx, Up: Top
10 Alphabetic List of Concepts and Objects
******************************************
[index]
* Menu:
* Bugs, reporting: Bugreport. (line 6)
* Examples: Examples. (line 6)
* merge_debian_isos, options: Options. (line 6)
* Problems, reporting: Bugreport. (line 6)

Tag Table:
Node: Top417
Node: Overview1014
Node: Options3381
Node: Examples3771
Node: ExPlain4196
Node: ExXorriso4870
Node: ExOptical5664
Node: ExDdTarget6448
Node: ExStdio7971
Node: Files8883
Node: Environ9039
Node: Seealso10104
Node: Bugreport10253
Node: Legal10838
Node: CommandIdx11666
Node: ConceptIdx11813

End Tag Table

BIN
test/merge_debian_isos.sig Normal file

Binary file not shown.

446
test/merge_debian_isos.texi Normal file
View File

@ -0,0 +1,446 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename merge_debian_isos.info
@settitle merge_debian_isos 1.5.7
@c %**end of header
@c
@c man-ignore-lines begin
@dircategory Archiving
@direntry
* Merge_debian_isos: (merge_debian_isos). Merge debian-cd ISO images to a single image
@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 test/merge_debian_isos.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 MERGE_DEBIAN_ISOS 1 "Version 1.5.7, Jun 07, 2023"
@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 <n> insert n+1 empty lines
@c man .\" for manpage-specific macros, see man(7)
@c man .nh
@c man-ignore-lines begin
@copying
merge_debian_isos - sh script to merge multiple debian-cd ISO images
Copyright @copyright{} 2023 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 merge_debian_isos 1.5.7
@author Thomas Schmitt
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@contents
@ifnottex
@node Top
@top merge_debian_isos 1.5.7
@c man-ignore-lines 1
@c man .SH NAME
merge_debian_isos - Program to merge multiple debian-cd ISO images
@end ifnottex
@menu
* Overview:: Overview
* Options:: Options
* Examples:: Examples
* Files:: Files
* Environ:: Environment
* Seealso:: See also
* Bugreport:: Reporting bugs
* Legal:: Author, Copyright, Credits
* CommandIdx:: Alphabetic Option List
* ConceptIdx:: Alphabetic List of Concepts and Objects
@end menu
@node Overview, Options, Top, Top
@chapter Overview
@c man .SH SYNOPSIS
@c man .B merge_debian_isos
@c man result_iso mount_template iso1 iso2 [... isoN]
@c man .br
@c man .SH DESCRIPTION
@c man .PP
@command{merge_debian_isos}
mounts by @strong{sudo} the ISO 9660 images iso1 to isoN at directories
mount_template1 to mount_templateN, if not already mounted that way.
Then the Debian pools and package lists get merged and a new
ISO 9660 image result_iso is produced by a run of @strong{xorriso}.
If iso1 is bootable then
the new image will be bootable by the same means.
@*
@sp 1
@c man .PP
The file depicted by result_iso must not yet exist or has to be a
device which is acceptable for Linux-specific helper script
@strong{xorriso-dd-target}. If xorriso-dd-target agrees and the user
confirms by input "yes" then xorriso will be run under sudo.
@*
Exempted from this evaluation are addresses which begin by "mmc:"
for an optical drive on Linux, BSDs, Solaris, or by "stdio:/dev/"
for which the user takes full and dangerous responsibility.
@*
Special result_iso path @strong{xorriso-dd-target-plug-test} determines
on systems with Linux kernel the target USB stick by a dialog around plugging
it in.
xorriso will be run under sudo, if xorriso-dd-target agrees and
the user confirms by input "yes".
@*
@sp 1
@c man .PP
At least the parent directory of argument @strong{mount_template} must already
exist or has to be given by a plain name without "/" so that it can be
created in the current directory. (I.e. without even "./".)
@*
All arguments must be single words without using quotation marks.
None of the isoN must be equal to another isoM.
@*
@sp 1
@c man .PP
This script creates and finally removes the following temporary tree
and files which must not yet exist in the current working directory:
./merged_dists , ./merged_md5sum.txt , ./merged_REAMDE.txt
./temp_file
@*
Further it creates and finally removes directories mount_template*
if they are needed and do not exist when the script starts. If the
parent directory in the mount_template path does not exist and
its path contains no "/" then it gets created and finally removed.
The script depends on the following programs:
@*
awk, basename, cat, chmod, cp, date, dirname, expr, fgrep, grep,
gunzip, gzip, head, ls, md5sum, mkdir, mount, mv, rm, rmdir,
sed, sh, sha256sum, sort, stat, sudo, umount, uniq, xorriso
@*
With device writing involving helper script xorriso-dd-target:
@*
dd, Linux kernel, lsblk, sleep, tr, uname, wc, whoami,
xorriso-dd-target
@*
Recommended are: sha1sum, sha512sum
@c man .SS
@node Options, Examples, Overview, Top
@chapter Options
@cindex merge_debian_isos, options
@c man .br
@c man .SH OPTIONS
@c man .br
@c man .PP
merge_debian_isos has no command line options besides the input words described
above, but it reacts on some environment variables.
@c man .br
@c man See section ENVIRONMENT.
@*
@sp 1
@c man .PP
If less than 4 arguments are given, the script will print its help text to
standard error and exit with non-zero value, indicating failure.
@c man .SS
@node Examples, Files, Options, Top
@chapter Examples
@c man .SH EXAMPLES
@c man .SS
@c man .B Overview of examples:
@c man Merge DVD images 1 to 5
@c man .br
@c man Use GNU xorriso instead of installed xorriso
@c man .br
@c man Write result directly to an optical drive
@c man .br
@c man Write result directly and safely to USB stick (Linux only)
@c man .br
@c man Write result directly and unsafely to USB stick
@cindex Examples
@menu
* ExPlain:: Merge DVD images 1 to 5
* ExXorriso:: Use GNU xorriso instead of installed xorriso
* ExOptical:: Write result directly to an optical drive
* ExDdTarget:: Write result directly and safely to USB stick (Linux only)
* ExStdio:: Write result directly and unsafely to USB stick
@end menu
@c man .SS
@c man .B Merge DVD images 1 to 5
@node ExPlain, ExXorriso, Options, Examples
@section Merge DVD images 1 to 5
The resulting image will be named "merged.iso".
@*
Directory ./merge_mount/ will be created if not yet existing.
@*
@sp 1
merge_debian_isos merged.iso merge_mount/iso \
debian-11.2.0-amd64-DVD-[12345].iso
@*
@sp 1
Expect to see some harmless warnings like
@*
@sp 1
xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules
libisofs: WARNING : Cannot add /debian to Joliet tree. Symlinks can only be added to a Rock Ridge tree.
libisofs: WARNING : Image size exceeds 1024 cylinders. Cannot align partition.
@c man .SS
@c man .B Use GNU xorriso instead of installed xorriso
@node ExXorriso, ExOptical, ExPlain, Examples
@section Use GNU xorriso instead of installed xorriso
merge_debian_isos will refuse to work if the installed version of xorriso
is older than 1.4.2. In this case consider to download and compile the
GNU xorriso tarball from
@*
https://www.gnu.org/software/xorriso/#download
@*
You may use it without installing it after compilation and thus without
disturbing your system's package management. Assumed that you unpacked the
xorriso-1.5.6 tarball in your $HOME directory and have successfully compiled
it, do:
@*
@sp 1
export XORRISO="$HOME"/xorriso-1.5.6/xorriso/xorriso
@*
@sp 1
merge_debian_isos merged.iso merge_mount/iso \
debian-11.2.0-amd64-DVD-[12345].iso
@c man .SS
@c man .B Write result directly to an optical drive
@node ExOptical, ExDdTarget, ExXorriso, Examples
@section Write result directly to an optical drive
xorriso is able to burn optical media on GNU/Linux (/dev/sr*),
Solaris (/dev/rdsk/*) , FreeBSD (/dev/cd*) , NetBSD (/dev/rcd*),
and OpenBSD (/dev/rcd*). Get a list of available optical drive devices by:
@*
@sp 1
xorriso -devices
@*
@sp 1
It might be that you need superuser powers for this and then have to enable
access to the device file for the user who runs merge_debian_isos.
@*
@sp 1
In order to directly write the merged ISO image to an optical medium,
use the desired device file path with prefix "mmc:":
@*
@sp 1
merge_debian_isos mmc:/dev/sr0 merge_mount/iso \
debian-11.2.0-amd64-DVD-[12345].iso
@c man .SS
@c man .B Write result directly and safely to USB stick (Linux only)
@node ExDdTarget, ExStdio, ExOptical, Examples
@section Write result directly and safely to USB stick (Linux only)
The Linux-specific script @strong{xorriso-dd-target} evaluates device files
whether they and their content look unimportant enough for being overwritten
by an image file.
@*
This mainly means that the storage device is attached to USB and contains
no filesystems which are not of type FAT or ISO 9660.
@*
You may get xorriso-dd-target by:
@*
@sp 1
wget \
https://dev.lovelyhq.com/libburnia/libisoburn/raw/master/xorriso-dd-target/xorriso-dd-target
chmod u+x xorriso-dd-target
@*
@sp 1
Consider to also download xorriso-dd-target.sig and to verify the script by
@*
@sp 1
gpg --verify xorriso-dd-target.sig xorriso-dd-target
@*
@sp 1
Announce the storage location of the downloaded xorriso-dd-target:
@*
@sp 1
export XORRISO_DD_TARGET_PATH="$(pwd)"
@*
@sp 1
The prepared use case in merge_debian_isos uses the xorriso-dd-target
option -plug_test under @strong{sudo}, which asks the user for first having
the desired USB stick unplugged so that the unwanted devices can get
registered. Then it asks the user to plug in the USB stick, so that it gets
recognized as desired target.
@*
xorriso-dd-target evaluates the content and decides whether it looks
disposable enough. If so, then it allows merge_debian_isos to write its
result to the device.
@*
@sp 1
merge_debian_isos xorriso-dd-target-plug-test merge_mount/iso \
debian-11.2.0-amd64-DVD-[12345].iso
@c man .SS
@c man .B Write result directly and unsafely to USB stick
@node ExStdio, Files, ExDdTarget, Examples
@section Write result directly and unsafely to USB stick
On operating systems other than GNU/Linux or with storage devices not
acceptable to xorriso-dd-target it is possible to remove all safety
precautions beyond those of xorriso, which can be overcome by "blanking"
the device.
@*
So after due evaluation of the device situation and on your very own risk
you may use the device path prefix "stdio:", possibly with superuser powers:
@*
@sp 1
xorriso -outdev stdio:/dev/sdd -blank as_needed
merge_debian_isos stdio:/dev/sdd merge_mount/iso \
debian-11.2.0-amd64-DVD-[12345].iso
For details about "stdio:" and pseudo-blanking non-optical devices read
man xorriso.
@*
The xorriso run in merge_debian_isos ignores locally defined xorriso startup
files (by command -no_rc).
@node Files, Environ, Examples, Top
@chapter Files
@c man .SH FILES
For now, no files are defined for configuration.
@c man .SH ENVIRONMENT
@node Environ, Seealso, Files, Top
@chapter Environ
The following environment variables influence the program behavior:
@*
Exported non-empty variable MERGE_DATE enforces a particular
date string in the text which gets prepended to /README.txt .
@*
Exported non-empty variable MERGE_FOR_DIST enforces the use of a
particular directory in /dists of iso1. Normally only one
such directory is found and thus no need to set MERGE_FOR_DIST.
@*
Exported non-empty variable MERGE_KEEP_ISO prevents the removal
of result_iso after xorriso indicated failure of production.
@*
Exported non-empty variable XORRISO gives the path to a xorriso binary,
which will be used instead of the system-wide installed xorriso binary.
This may be needed if installed xorriso is older than 1.4.2.
@*
If XORRISO is set to "dummy" then no new ISO will emerge.
@*
Exported non-empty variable XORRISO_DD_TARGET_PATH names the
directory where to find xorriso-dd-target, which evaluates the
suitability of result_iso devices or does the plug-test dialog.
@*
@c man .SH SEE ALSO
@c man .BR xorriso(1),
@c man .BR xorriso-dd-target(1),
@c man-ignore-lines begin
@node Seealso, Bugreport, Environ, Top
@chapter See also
xorriso(1), xorriso-dd-target(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{merge_debian_isos},
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{merge_debian_isos}, 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 <scdbackup@@gmx.net>
@*
for libburnia-project.org
@c man .SH COPYRIGHT
@section Copyright
Copyright (c) 2023 Thomas Schmitt
@*
Permission is granted to distribute this text freely. It shall only be
modified in sync with the technical properties of merge_debian_isos.
If you make use of the license to derive modified versions of merge_debian_isos
then you are entitled to modify this text under that same license.
@c man .SH CREDITS
@section Credits
@command{merge_debian_isos} was originally developed with advise and testing
by Zhang Boyang in the course of Debian bug #1011343. Steve McIntyre provided
information about various file aspects of debian-cd ISO images.
@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

View File

@ -0,0 +1,961 @@
#!/bin/sh
# Copyright (c) 2019 - 2023
# Nio Wiklund alias sudodus <nio dot wiklund at gmail dot com>
# Thomas Schmitt <scdbackup@gmx.net>
# 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.7 , 2023.06.07.200919"
}
## 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 filesystems" >&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

View File

@ -0,0 +1,575 @@
.\" 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.7, Jun 07, 2023"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.nh
.SH NAME
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 filesystems
.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 <bug\-xorriso@gnu.org>.
If more privacy is desired, mail to <scdbackup@gmx.net>.
.br
Please describe what you expect the program to do, the program arguments
which you used, the messages of \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 <scdbackup@gmx.net>
.br
for libburnia\-project.org
.SH COPYRIGHT
Copyright (c) 2019 \- 2023 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.

View File

@ -0,0 +1,578 @@
This 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) 2023 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.7
***********************
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 filesystems
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
<bug-xorriso@gnu.org>. If more privacy is desired, mail to
<scdbackup@gmx.net>.
Please describe what you expect the program to do, the program
arguments which you used, the messages of '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 <scdbackup@gmx.net>
for libburnia-project.org
14.2 Copyright
==============
Copyright (c) 2019 - 2023 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: Dowrite7956
Node: Unwise9337
Node: Reasons10959
Node: Options13540
Node: Examples17148
Node: Files17321
Node: Seealso17479
Node: Bugreport17645
Node: Legal18232
Node: CommandIdx18943
Node: ConceptIdx20282

End Tag Table

Binary file not shown.

View File

@ -0,0 +1,754 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename xorriso-dd-target.info
@settitle GNU xorriso-dd-target 1.5.7
@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.7, Jun 07, 2023"
@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 <n> 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{} 2023 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.7
@author Thomas Schmitt
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage
@contents
@ifnottex
@node Top
@top xorriso-dd-target 1.5.7
@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 filesystems
@*
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 <scdbackup@@gmx.net>
@*
for libburnia-project.org
@c man .SH COPYRIGHT
@section Copyright
Copyright (c) 2019 - 2023 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

View File

@ -11,5 +11,6 @@ Ulrich Drepper
Richard Atterer
Steve McIntyre
George Danchev
Nio Wiklund alias sudodus
and possibly others who gave their copyright to Free Software Foundation, Inc.

View File

@ -4,7 +4,7 @@
GNU xorriso. By Thomas Schmitt <scdbackup@gmx.net>
Derived from and supported by libburnia-project.org, published via:
http://www.gnu.org/software/xorriso/xorriso_eng.html
http://www.gnu.org/software/xorriso/xorriso-1.5.0.tar.gz
http://www.gnu.org/software/xorriso/xorriso-1.5.7.tar.gz
Provided under GPL version 3 or later. No warranty.
------------------------------------------------------------------------------
@ -49,10 +49,10 @@ Optional at compile time are:
If they were present at compile time, then the optional libraries have to
be present at runtime, too.
Obtain xorriso-1.5.0.tar.gz, take it to a directory of your choice and do:
Obtain xorriso-1.5.7.tar.gz, take it to a directory of your choice and do:
tar xzf xorriso-1.5.0.tar.gz
cd xorriso-1.5.0
tar xzf xorriso-1.5.7.tar.gz
cd xorriso-1.5.7
Within that directory execute:
@ -99,7 +99,7 @@ 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 explictely allow only the use of libedit, then do
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:
@ -263,6 +263,23 @@ 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
@ -306,14 +323,17 @@ 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.
newline character. The first 25 say "xorriso sector bitmap v2 " or
"xorriso sector bitmap v3 ". 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
After the info text there are two signed integers, most significant byte
first. The number of bytes per integer is 4 for "v2" and 8 for "v3".
In both cases, the highest bit of the integers must be 0.
The first integer, N, gives the number of bits in the following bitmap.
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.
@ -342,7 +362,7 @@ Tag_id distinguishes the following tag types
"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 overwriteable media (e.g. DVD+RW, BD-RE).
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
@ -366,7 +386,7 @@ 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 overwriteable media
- Emulation of ISO 9660 multi-session on overwritable media
or random access files.
- Implementation of the xorriso API.
@ -378,9 +398,9 @@ 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.0 :
- libburn.so.4 , version libburn-1.5.0 or higher
- libisofs.so.6 , version libisofs-1.5.0 or higher
Dynamic library and compile time header requirements for libisoburn-1.5.6 :
- libburn.so.4 , version libburn-1.5.6 or higher
- libisofs.so.6 , version libisofs-1.5.6 or higher
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.
@ -504,7 +524,7 @@ By Mario Danic <mario.danic@gmail.com>, libburn, libisofs
Vreixo Formoso <metalpain2002@yahoo.es>, libisofs, libisoburn
Thomas Schmitt <scdbackup@gmx.net>, libburn, libisofs,
libisoburn, xorriso
Copyright (C) 2006-2018 Mario Danic, Vreixo Formoso, Thomas Schmitt.
Copyright (C) 2006-2024 Mario Danic, Vreixo Formoso, Thomas Schmitt.
libburnia-project.org is inspired by and in libburn still containing parts
of old
@ -517,10 +537,13 @@ 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 - 2018 Thomas Schmitt <scdbackup@gmx.net>
Copyright (c) 2007 - 2024 Thomas Schmitt <scdbackup@gmx.net>
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

View File

@ -116,7 +116,7 @@ int Xorriso_lst_append_binary(struct Xorriso_lsT **entry,
/** 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 alredy NULL, 1= ok
@return 0= *lstring was already NULL, 1= ok
*/
int Xorriso_lst_destroy(struct Xorriso_lsT **lstring, int flag);

View File

@ -3,7 +3,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2017 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2023 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -144,8 +144,9 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->do_rockridge= 1;
m->do_iso1999= 0;
m->ecma119_map= 1;
m->joliet_map= 1;
m->do_aaip= 0;
m->do_md5= 0;
m->do_md5= 64;
m->no_emul_toc= 0;
m->do_old_empty= 0;
m->scdbackup_tag_name[0]= 0;
@ -167,6 +168,10 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
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;
@ -195,6 +200,15 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
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;
@ -207,6 +221,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
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;
@ -219,9 +234,14 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
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->commit_attempts= 0;
m->print_size_attempts= 0;
m->write_session_counter= 0;
m->print_size_counter= 0;
m->no_volset_present= 0;
m->in_sector_map= NULL;
m->check_media_default= NULL;
@ -231,6 +251,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
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;
@ -239,12 +260,16 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
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->do_obs_pad= 0;
m->bdr_obs_exempt= 0;
m->modesty_on_drive= 0;
m->min_buffer_usec= 5000;
m->max_buffer_usec= 25000;
@ -290,13 +315,19 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
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->max_ce_entries= 31; /* Linux hates >= RR_MAX_CE_ENTRIES = 32 */
m->max_ce_entries_flag= 2; /* omit non-isofs fattr and ACL if needed */
m->ascii_disc_label[0]= 0;
m->grub2_sparc_core[0]= 0;
memset(m->hfsp_serial_number, 0, 8);
@ -308,6 +339,8 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
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;
@ -453,6 +486,8 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
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;
@ -469,6 +504,7 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
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;

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2015 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -39,14 +39,14 @@
struct SpotlistiteM {
int start_lba;
int blocks;
off_t start_lba;
off_t blocks;
int quality;
struct SpotlistiteM *next;
};
int Spotlistitem_new(struct SpotlistiteM **o, int start_lba, int blocks,
int Spotlistitem_new(struct SpotlistiteM **o, off_t start_lba, off_t blocks,
int quality, int flag)
{
struct SpotlistiteM *m;
@ -76,9 +76,9 @@ int Spotlistitem_destroy(struct SpotlistiteM **o, int flag)
struct SpotlisT {
struct SpotlistiteM *list_start;
struct SpotlistiteM *list_end;
int list_count;
off_t list_count;
struct SpotlistiteM *current_item;
int current_idx;
off_t current_idx;
};
@ -117,7 +117,7 @@ int Spotlist_destroy(struct SpotlisT **o, int flag)
}
int Spotlist_add_item(struct SpotlisT *o, int start_lba, int blocks,
int Spotlist_add_item(struct SpotlisT *o, off_t start_lba, off_t blocks,
int quality, int flag)
{
int ret;
@ -135,8 +135,9 @@ int Spotlist_add_item(struct SpotlisT *o, int start_lba, int blocks,
(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,
fprintf(stderr, "debug: lba %10.f , size %10.f , quality '%s'\n",
(double) start_lba, (double) blocks,
Spotlist__quality_name(quality, quality_name,
Xorriso_read_quality_invaliD, 0) + 2);
}
@ -144,15 +145,15 @@ int Spotlist_add_item(struct SpotlisT *o, int start_lba, int blocks,
}
int Spotlist_count(struct SpotlisT *o, int flag)
off_t Spotlist_count(struct SpotlisT *o, int flag)
{
return o->list_count;
}
int Spotlist_block_count(struct SpotlisT *o, int flag)
off_t Spotlist_block_count(struct SpotlisT *o, int flag)
{
int list_blocks= 0;
off_t list_blocks= 0;
struct SpotlistiteM *li;
for(li= o->list_start; li != NULL; li= li->next) {
@ -163,9 +164,9 @@ int Spotlist_block_count(struct SpotlisT *o, int flag)
}
int Spotlist_sector_size(struct SpotlisT *o, int read_chunk, int flag)
off_t Spotlist_sector_size(struct SpotlisT *o, off_t read_chunk, int flag)
{
int sector_size;
off_t sector_size;
struct SpotlistiteM *li;
sector_size= read_chunk * 2048;
@ -179,10 +180,10 @@ 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)
int Spotlist_get_item(struct SpotlisT *o, off_t idx,
off_t *start_lba, off_t *blocks, int *quality, int flag)
{
int i;
off_t i;
struct SpotlistiteM *li;
if(idx < 0 || idx > o->list_count)
@ -210,6 +211,7 @@ char *Spotlist__quality_name(int quality, char name[80], int bad_limit,
{
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)
@ -248,7 +250,7 @@ char *Spotlist__quality_name(int quality, char name[80], int bad_limit,
/* ---------------------------- SectorbitmaP ------------------------------ */
int Sectorbitmap_new(struct SectorbitmaP **o, int sectors, int sector_size,
int Sectorbitmap_new(struct SectorbitmaP **o, off_t sectors, off_t sector_size,
int flag)
{
struct SectorbitmaP *m;
@ -287,13 +289,16 @@ 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 ret, fd= -1, sectors, sector_size, i, todo, map_size, skip, bufsize= 1024;
int ret, fd= -1, todo, skip, bufsize= 1024;
off_t sectors, sector_size;
ssize_t i, map_size;
unsigned char *map;
unsigned char *buf;
unsigned char *buf, buf_head[26];
buf= TSOB_FELD(unsigned char, bufsize);
if(buf == NULL)
return(-1);
buf_head[0]= 0;
*os_errno= 0;
if(msg != NULL)
@ -318,9 +323,12 @@ wrong_filetype:;
}
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) {
if(strncmp((char *) buf, "xorriso sector bitmap v1 ", 32) == 0) {
memcpy(buf_head, buf, 25);
} else if(strncmp((char *) buf, "xorriso sector bitmap v2 ", 25) == 0 ||
strncmp((char *) buf, "xorriso sector bitmap v3 ", 25) == 0) {
memcpy(buf_head, buf, 25);
buf_head[25]= 0;
skip= -1;
sscanf(((char *) buf) + 25, "%d", &skip);
if(skip < 0)
@ -335,17 +343,33 @@ 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;
if(strncmp((char *) buf_head, "xorriso sector bitmap v1 ", 25) == 0 ||
strncmp((char *) buf_head, "xorriso sector bitmap v2 ", 25) == 0) {
ret= read(fd, buf, 8);
if(ret < 8)
goto wrong_filetype;
if((buf[0] & 128) || (buf[4] & 128))
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];
} else {
ret= read(fd, buf, 16);
if(ret < 16)
goto wrong_filetype;
if((buf[0] & 128) || (buf[8] & 128))
goto wrong_filetype;
sectors= ((off_t) buf[0] << 56) | ((off_t) buf[1] << 48) |
((off_t) buf[2] << 40) | ((off_t) buf[3] << 32) |
(buf[4] << 24) | (buf[5] << 16) | (buf[6] << 8) | buf[7];
sector_size= ((off_t) buf[8] << 56) | ((off_t) buf[9] << 48) |
((off_t) buf[10] << 40) | ((off_t) buf[11] << 32) |
(buf[12] << 24) | (buf[13] << 16) | (buf[14] << 8) | buf[15];
}
ret= Sectorbitmap_new(o, sectors, sector_size, 0);
if(ret <= 0) {
if(msg != NULL)
sprintf(msg, "Cannot allocate bitmap memory for %d sectors", sectors);
sprintf(msg, "Cannot allocate bitmap memory for %.f sectors",
(double) sectors);
ret= -1; goto ex;
}
map= (*o)->map;
@ -374,7 +398,8 @@ ex:;
int Sectorbitmap_to_file(struct SectorbitmaP *o, char *path, char *info,
char *msg, int *os_errno, int flag)
{
int ret, fd= -1, j, l;
int fd= -1, j, l, version= 2;
ssize_t ret;
unsigned char buf[40];
*os_errno= 0;
@ -388,6 +413,8 @@ int Sectorbitmap_to_file(struct SectorbitmaP *o, char *path, char *info,
ret= 0; goto ex;
}
if(o->sectors > 0x7fffffff || o->sector_size > 0x7fffffff)
version= 3;
l= 0;
if(info != NULL)
l= strlen(info);
@ -395,7 +422,7 @@ int Sectorbitmap_to_file(struct SectorbitmaP *o, char *path, char *info,
strcpy(msg, "Info string is longer than 999999 bytes");
ret= 0; goto ex;
}
sprintf((char *) buf, "xorriso sector bitmap v2 %-6d\n", l);
sprintf((char *) buf, "xorriso sector bitmap v%d %-6d\n", version, l);
ret= write(fd, buf, 32);
if(ret != 32) {
@ -413,13 +440,24 @@ cannot_write:;
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);
if(version == 2) {
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;
} else {
for(j= 0; j < 8; j++) {
buf[j]= o->sectors >> (56 - j * 8);
buf[j + 8]= o->sector_size >> (56 - j * 8);
}
ret= write(fd, buf, 16);
if(ret != 16)
goto cannot_write;
}
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;
@ -434,7 +472,7 @@ ex:;
/* @param flag bit0= sector bit value
*/
int Sectorbitmap_set(struct SectorbitmaP *o, int sector, int flag)
int Sectorbitmap_set(struct SectorbitmaP *o, off_t sector, int flag)
{
if(sector < 0 || sector >= o->sectors)
return(0);
@ -449,9 +487,9 @@ int Sectorbitmap_set(struct SectorbitmaP *o, int sector, int flag)
/* @param flag bit0= sector bit value
*/
int Sectorbitmap_set_range(struct SectorbitmaP *o,
int start_sector, int sectors, int flag)
off_t start_sector, off_t sectors, int flag)
{
int start_i, end_i, i;
off_t start_i, end_i, i;
unsigned char value;
if(start_sector < 0 || start_sector + sectors > o->sectors || sectors < 1)
@ -473,7 +511,7 @@ int Sectorbitmap_set_range(struct SectorbitmaP *o,
}
int Sectorbitmap_is_set(struct SectorbitmaP *o, int sector, int flag)
int Sectorbitmap_is_set(struct SectorbitmaP *o, off_t sector, int flag)
{
if(sector < 0 || sector >= o->sectors)
return(0);
@ -484,7 +522,7 @@ 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 end_sector, i;
off_t end_sector, i;
end_sector= end_byte / o->sector_size;
for(i= start_byte / o->sector_size; i <= end_sector; i++)
@ -495,7 +533,7 @@ int Sectorbitmap_bytes_are_set(struct SectorbitmaP *o,
int Sectorbitmap_get_layout(struct SectorbitmaP *o,
int *sectors, int *sector_size, int flag)
off_t *sectors, off_t *sector_size, int flag)
{
*sectors= o->sectors;
*sector_size= o->sector_size;
@ -506,8 +544,8 @@ int Sectorbitmap_get_layout(struct SectorbitmaP *o,
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;
int run_value, start_aligned, end_complete;
off_t i, run_start, start_sec, limit_sec;
if(((off_t) from->sectors) * ((off_t) from->sector_size) >
((off_t) to->sectors) * ((off_t) to->sector_size))
@ -518,7 +556,7 @@ int Sectorbitmap_copy(struct SectorbitmaP *from, struct SectorbitmaP *to,
return(1);
}
run_start= 0;
run_value= Sectorbitmap_is_set(from, 0, 0);
run_value= Sectorbitmap_is_set(from, (off_t) 0, 0);
for(i= 1; i <= from->sectors; i++) {
if(i < from->sectors)
if(Sectorbitmap_is_set(from, i, 0) == run_value)
@ -586,6 +624,7 @@ int Checkmediajob_new(struct CheckmediajoB **o, int flag)
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;
@ -603,7 +642,7 @@ int Checkmediajob_destroy(struct CheckmediajoB **o, int flag)
{
if((*o) == NULL)
return(0);
if((*o)->data_to_fd != -1)
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);
@ -627,6 +666,7 @@ int Checkmediajob_copy(struct CheckmediajoB *from, struct CheckmediajoB *to,
/* 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);
@ -723,7 +763,7 @@ int Xorriso_check_media_setup_job(struct XorrisO *xorriso,
strncmp(argv[i], "min_lba=", 8) == 0) {
num= -1;
sscanf(argv[i] + 8, "%lf", &num);
if(num > 0x7fffffff || num < 0)
if(num > 0x7fffffffffffffff || num < 0)
num= -1;
if(strncmp(argv[i], "max_lba=", 8) == 0)
job->max_lba= num;
@ -740,7 +780,7 @@ int Xorriso_check_media_setup_job(struct XorrisO *xorriso,
else if(argv[i][11] >= '1' && argv[i][11] <= '9') {
num= -1;
sscanf(argv[i] + 11, "%lf", &num);
if(num > 0x7fffffff || num < 0)
if(num > 0x7fffffffffffffff || num < 0)
goto bad_value;
job->patch_lba0_msc1= num;
job->patch_lba0= (num >= 32) + (strstr(argv[i] + 11, ":force") != NULL);
@ -861,9 +901,9 @@ int Xorriso_check_media_list_job(struct XorrisO *xorriso,
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);
sprintf(report + strlen(report), " min_lba=%.f", (double) job->min_lba);
if(all || job->max_lba != dflt->max_lba)
sprintf(report + strlen(report), " max_lba=%d", job->max_lba);
sprintf(report + strlen(report), " max_lba=%.f", (double) job->max_lba);
if(all || job->retry != dflt->retry)
sprintf(report + strlen(report), " retry=%s",
job->retry == 1 ? "on" : job->retry == -1 ? "off" : "default");
@ -895,8 +935,9 @@ int Xorriso_check_media_list_job(struct XorrisO *xorriso,
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" : "");
sprintf(report + strlen(report), "%.f%s",
(double) job->patch_lba0_msc1,
job->patch_lba0 == 2 ? ":force" : "");
else
sprintf(report + strlen(report), "%s",
job->patch_lba0 == 2 ? "force" : "on");
@ -939,7 +980,8 @@ int Xorriso_sectormap_to_spotlist(struct XorrisO *xorriso,
int flag)
{
struct SectorbitmaP *map;
int ret, i, sectors, sector_size, value, old_value= -1, old_start= -1;
int ret, value, old_value= -1;
off_t i, sectors, sector_size, old_start= -1;
map= job->sector_map;
if(map == NULL)
@ -1002,14 +1044,16 @@ ex:;
*/
int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso,
struct SpotlisT *spotlist,
int read_chunk,
off_t 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;
int valid;
off_t map_sectors= -1, map_sector_size= -1;
int replace_map= 0, quality, ret, pass;
off_t list_sectors, list_blocks, sector_size, sector_blocks;
off_t count, i, lba, blocks;
sector_size= Spotlist_sector_size(spotlist, read_chunk, 0);
sector_blocks= sector_size / 2048;
@ -1029,11 +1073,8 @@ int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso,
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;
if((*map)->sectors * (*map)->sector_size > list_sectors * sector_size)
list_sectors= (*map)->sectors * (*map)->sector_size / sector_size + 1;
}
ret= Sectorbitmap_new(&m, list_sectors, sector_size, 0);
if(ret <= 0)
@ -1081,8 +1122,13 @@ int Xorriso_open_job_data_to(struct XorrisO *xorriso,
{
if(job->data_to_path[0] == 0)
return(2);
job->data_to_fd= open(job->data_to_path, O_RDWR | O_CREAT | O_BINARY,
S_IRUSR | S_IWUSR);
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);
@ -1094,10 +1140,11 @@ int Xorriso_open_job_data_to(struct XorrisO *xorriso,
int Xorriso_update_in_sector_map(struct XorrisO *xorriso,
struct SpotlisT *spotlist, int read_chunk,
struct SpotlisT *spotlist, off_t read_chunk,
struct CheckmediajoB *job, int flag)
{
int sectors, sector_size, sector_blocks, ret;
int ret;
off_t sectors, sector_size, sector_blocks;
struct SectorbitmaP *map;
Sectorbitmap_destroy(&(xorriso->in_sector_map), 0);

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2011 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -13,6 +13,9 @@
#ifndef Xorriso_pvt_check_includeD
#define Xorriso_pvt_check_includeD yes
/* For ssize_t */
#include <unistd.h>
struct SpotlisT; /* List of intervals with different read qualities */
struct CheckmediajoB; /* Parameters for Xorriso_check_media() */
@ -29,7 +32,7 @@ int Xorriso_sectormap_to_spotlist(struct XorrisO *xorriso,
*/
int Xorriso_spotlist_to_sectormap(struct XorrisO *xorriso,
struct SpotlisT *spotlist,
int read_chunk,
off_t read_chunk,
struct SectorbitmaP **map,
int flag);
@ -47,33 +50,33 @@ int Xorriso_check_media_list_job(struct XorrisO *xorriso,
char *report, int flag);
int Xorriso_update_in_sector_map(struct XorrisO *xorriso,
struct SpotlisT *spotlist, int read_chunk,
struct SpotlisT *spotlist, off_t read_chunk,
struct CheckmediajoB *job, int flag);
/* Distiniction between valid and invalid sectors */
struct SectorbitmaP {
int sectors;
int sector_size;
off_t sectors;
off_t sector_size;
unsigned char *map;
int map_size;
ssize_t 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 Spotlist_add_item(struct SpotlisT *o, off_t start_lba, off_t blocks,
int quality, int flag);
int Spotlist_count(struct SpotlisT *o, int flag);
off_t Spotlist_count(struct SpotlisT *o, int flag);
int Spotlist_block_count(struct SpotlisT *o, int flag);
off_t Spotlist_block_count(struct SpotlisT *o, int flag);
int Spotlist_sector_size(struct SpotlisT *o, int read_chunk, int flag);
off_t Spotlist_sector_size(struct SpotlisT *o, off_t read_chunk, int flag);
int Spotlist_get_item(struct SpotlisT *o, int idx,
int *start_lba, int *blocks, int *quality, int flag);
int Spotlist_get_item(struct SpotlisT *o, off_t idx,
off_t *start_lba, off_t *blocks, int *quality, int flag);
char *Spotlist__quality_name(int quality, char name[80], int bad_limit,
int flag);
@ -95,8 +98,8 @@ char *Spotlist__quality_name(int quality, char name[80], int bad_limit,
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 */
off_t min_lba; /* if >=0 : begin checking at this address */
off_t max_lba; /* if >=0 : read up to this address, else use mode */
int min_block_size; /* granularity desired by user
*/
@ -118,8 +121,9 @@ struct CheckmediajoB {
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;
off_t patch_lba0_msc1;
char sector_map_path[SfileadrL];
struct SectorbitmaP *sector_map;
@ -153,22 +157,22 @@ 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 Sectorbitmap_new(struct SectorbitmaP **o, off_t sectors, off_t 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(struct SectorbitmaP *o, off_t 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);
off_t start_sector, off_t sectors, int flag);
int Sectorbitmap_is_set(struct SectorbitmaP *o, off_t 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);
off_t *sectors, off_t *sector_size, int flag);
int Sectorbitmap_copy(struct SectorbitmaP *from, struct SectorbitmaP *to,
int flag);

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2014 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2019 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -62,6 +62,7 @@ int Xorriso_compare_2_contents(struct XorrisO *xorriso, char *common_adr,
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);
@ -73,7 +74,7 @@ int Xorriso_compare_2_contents(struct XorrisO *xorriso, char *common_adr,
sprintf(respt, "- %s (DISK) : cannot open() : %s\n",
disk_adr, strerror(errno));
cannot_address:;
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 2048;
{ret= 0; goto ex;}
@ -105,7 +106,7 @@ cannot_address:;
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&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
close(fd1);
(*result)|= 4096;
@ -155,7 +156,7 @@ cannot_address:;
if(disk_size > r1count + r1 + offset) {
sprintf(respt, "- %s (DISK) : early EOF after %.f bytes\n",
disk_adr, (double) r1count);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 8196;
}
@ -168,7 +169,7 @@ cannot_address:;
if(iso_size > r2count + r2) {
sprintf(respt, "- %s (ISO) : early EOF after %.f bytes\n",
iso_adr, (double) r2count);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= (1<<14);
}
@ -179,7 +180,7 @@ cannot_address:;
if(disk_size > r1count + r1 + offset) {
sprintf(respt, "- %s (DISK) : early EOF after %.f bytes\n",
disk_adr, (double) r1count);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 8196;
}
@ -204,7 +205,7 @@ cannot_address:;
if(!(flag&(1<<29))) {
xorriso->pacifier_count+= r1;
xorriso->pacifier_byte_count+= r1;
if(flag&(1<<31))
if(flag&(1u<<31))
Xorriso_pacifier_callback(xorriso, "content bytes read",
xorriso->pacifier_count, 0, "", 8);
else
@ -228,7 +229,7 @@ cannot_address:;
sprintf(offset_text, "%.f+", (double) offset);
sprintf(respt, "%s %s : differs by MD5 sums.\n",
common_adr, (flag&1 ? "CONTENT": "content"));
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= (1<<15);
}
@ -238,11 +239,14 @@ cannot_address:;
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"),
(double) (diffcount + abs(r1count-r2count)),
offset_text, (double) first_diff);
if(!(flag&(1<<31)))
dcount, offset_text, (double) first_diff);
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= (1<<15);
}
@ -333,9 +337,9 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
if(ret>0) {
strcpy(respt, "? ");
Text_shellsafe(disk_adr, respt, 1);
sprintf(respt + strlen(respt), " (DISK) : exluded by %s\n",
sprintf(respt + strlen(respt), " (DISK) : excluded by %s\n",
(ret==1 ? "-not_paths" : "-not_leaf"));
if(! (flag & ((1 << 31) | (1 << 26))))
if(! (flag & ((1u << 31) | (1 << 26))))
Xorriso_result(xorriso,0);
missing= 1;
(*result)|= 1;
@ -351,7 +355,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
Text_shellsafe(disk_adr, respt, 1);
sprintf(respt + strlen(respt),
" (DISK) : cannot lstat() : %s\n", strerror(errno));
if(! (flag & ((1 << 31) | (1 << 26))))
if(! (flag & ((1u << 31) | (1 << 26))))
Xorriso_result(xorriso,0);
missing= 1;
(*result)|= 1;
@ -380,7 +384,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
strcpy(respt, "? ");
Text_shellsafe(iso_adr, respt, 1);
strcat(respt, " (ISO) : cannot find this file in ISO image\n");
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
missing= 1;
(*result)|= 2;
@ -406,7 +410,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
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&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 4;
}
@ -414,7 +418,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
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&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 8;
if((s1.st_mode&S_IFMT) == S_IFLNK) {
@ -454,7 +458,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
if((*result) & (1 << 19)) {
sprintf(respt, "%s ACL : %d difference%s\n",
a, diff_count, diff_count == 1 ? "" : "s");
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
}
}
@ -475,7 +479,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
(*result)|= (1 << 20);
sprintf(respt, "%s xattr : %d difference%s\n",
a, diff_count, diff_count == 1 ? "" : "s");
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
}
}
@ -483,14 +487,14 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
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&(1<<31)))
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&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 32;
}
@ -500,7 +504,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
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&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 64;
}
@ -510,7 +514,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
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&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 128;
}
@ -519,7 +523,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
a, Ftimetxt(s1.st_mtime, ttx1, 0),
Ftimetxt(s2.st_mtime, ttx2, 0),
((double) s1.st_mtime) - (double) s2.st_mtime);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 256;
}
@ -529,7 +533,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
a, Ftimetxt(s1.st_atime, ttx1, 0),
Ftimetxt(s2.st_atime, ttx2, 0),
((double) s1.st_atime) - (double) s2.st_atime);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 512;
}
@ -540,7 +544,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
a, Ftimetxt(s1.st_ctime, ttx1, 0),
Ftimetxt(s2.st_ctime, ttx2, 0),
((double) s1.st_ctime) - (double) s2.st_ctime);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= 1024;
}
@ -569,7 +573,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
!((*result) & (8 | 128 | 256 | 512 | 1024))) {
sprintf(respt,
"%s content : node timestamp younger than image timestamp\n", a);
if((xorriso->do_aaip & 32) && !(flag&(1<<31)))
if((xorriso->do_aaip & 32) && !(flag&(1u<<31)))
Xorriso_result(xorriso,0);
stamp= s2.st_mtime;
if((flag & 1) && s2.st_atime >= stamp)
@ -580,19 +584,19 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
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&(1<<31)))
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&(1<<31)))
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&(1<<31)))
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)){
@ -601,12 +605,12 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
(*result)|= (1 << 15); /* content bytes differ */
sprintf(respt,
"%s content : assuming inequality after dev_ino mismatch\n", a);
if((xorriso->do_aaip & 32) && !(flag&(1<<31)))
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&(1<<31)))
if((xorriso->do_aaip & 32) && !(flag&(1u<<31)))
Xorriso_result(xorriso,0);
(*result)|= (1 << 22);
}
@ -630,7 +634,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
ret= Xorriso_compare_2_contents(xorriso, a, disk_adr, s1.st_size,
offset, bytes,
part_path, stbuf.st_size, result,
(s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1<<31))));
(s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1u<<31))));
if(ret<0)
was_error= 1;
}
@ -638,7 +642,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
sprintf(xorriso->info_text,
"- %s/* (ISO) : Not all split parts present (%d of %d)\n",
iso_adr, split_count, total_parts);
if(!(flag&(1<<31)))
if(!(flag&(1u<<31)))
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 1);
(*result)|= 1<<18;
}
@ -646,7 +650,7 @@ int Xorriso_compare_2_files(struct XorrisO *xorriso, char *disk_adr,
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)|(1<<31))));
(s1.st_mtime==s2.st_mtime) | (flag&((1<<29)|(1u<<31))));
if(ret<0)
was_error= 1;
}
@ -742,7 +746,7 @@ int Xorriso_find_compare(struct XorrisO *xorriso, void *boss_iter, void *node,
(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) | ((flag&1)<<31));
| ((!(flag&2))<<27) | (((unsigned)(flag&1))<<31));
/* was once: | ((!(flag&1))<<29) */
if(ret<xorriso->find_compare_result)
xorriso->find_compare_result= ret;
@ -795,8 +799,8 @@ int Xorriso_update_interpreter(struct XorrisO *xorriso,
struct SplitparT *split_parts= NULL;
int split_count= 0;
char *part_path= NULL, *part_name;
int partno, total_parts, new_total_parts;
off_t offset, bytes, total_bytes, disk_size, first_bytes;
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 ");
@ -959,10 +963,12 @@ overwrite:;
if(ret <= 0)
goto ex;
}
if(flag & 1)
if(flag & 1) {
sprintf(xorriso->info_text, "Widened hard link ");
else
} 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,
@ -1005,6 +1011,25 @@ overwrite:;
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;

View File

@ -1,9 +1,9 @@
# configure.ac stems from xorriso/configure_ac.txt and leads to ./configure
# Copyright (c) 2007 - 2018 Thomas Schmitt <scdbackup@gmx.net>
# Copyright (c) 2007 - 2023 Thomas Schmitt <scdbackup@gmx.net>
# Provided under GPL version 2 or later.
AC_INIT([xorriso], [1.5.0], [http://libburnia-project.org])
AC_INIT([xorriso], [1.5.7], [http://libburnia-project.org])
AC_PREREQ([2.50])
AC_CANONICAL_HOST
@ -23,14 +23,14 @@ AC_DEFINE([Xorriso_standalonE], [])
BURN_MAJOR_VERSION=1
BURN_MINOR_VERSION=5
BURN_MICRO_VERSION=0
BURN_MICRO_VERSION=7
AC_SUBST(BURN_MAJOR_VERSION)
AC_SUBST(BURN_MINOR_VERSION)
AC_SUBST(BURN_MICRO_VERSION)
LIBISOFS_MAJOR_VERSION=1
LIBISOFS_MINOR_VERSION=5
LIBISOFS_MICRO_VERSION=0
LIBISOFS_MICRO_VERSION=7
AC_SUBST(LIBISOFS_MAJOR_VERSION)
AC_SUBST(LIBISOFS_MINOR_VERSION)
AC_SUBST(LIBISOFS_MICRO_VERSION)
@ -42,7 +42,8 @@ dnl #define isoburn_header_version_*
AC_PREFIX_DEFAULT([/usr/local])
test "$prefix" = "NONE" && prefix=$ac_default_prefix
AM_MAINTAINER_MODE
dnl ts B90405 : Disabled on advise of Ross Burton
dnl AM_MAINTAINER_MODE
AM_PROG_CC_C_O
AC_C_CONST
@ -132,6 +133,22 @@ then
AC_DEFINE([Libburn_os_has_statvfS], [])
fi
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)
dnl Add compiler-specific flags
@ -351,6 +368,7 @@ dnl The empty parameter after "compressBound" causes -lz.
ZLIB_DEF=yes
AC_CHECK_HEADER(zlib.h, AC_CHECK_LIB(z, compressBound, , ZLIB_DEF= ), ZLIB_DEF= )
else
echo "disabled use of zlib"
ZLIB_DEF=
fi
if test x$ZLIB_DEF = xyes

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2016 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -300,11 +300,14 @@ unrecognizable:;
/* @param flag bit0= for Xorriso_msgs_submit: use pager
bit1= do not issue warnings
bit2= warn about dangling link
bit3= report sorry if dangling link
*/
int Xorriso_hop_link(struct XorrisO *xorriso, char *link_path,
struct LinkiteM **link_stack, struct stat *stbuf, int flag)
{
int ret;
char *severity;
struct LinkiteM *litm;
if(*link_stack != NULL) {
@ -318,8 +321,19 @@ int Xorriso_hop_link(struct XorrisO *xorriso, char *link_path,
}
}
ret= stat(link_path, stbuf);
if(ret==-1)
if(ret == -1) {
if(flag & (4 | 8)) {
if(flag & 8)
severity= "SORRY";
else
severity= "WARNING";
sprintf(xorriso->info_text, "Non-existing link target with : ");
Text_shellsafe(link_path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, severity,
flag & 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 : ");
@ -343,6 +357,7 @@ int Xorriso_hop_link(struct XorrisO *xorriso, char *link_path,
/* @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,
@ -563,13 +578,15 @@ revoke_sorting:;
report_size= sub_size/1024;
if(report_size*1024<sub_size)
report_size++;
if(xorriso->sh_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);
if(!(flag & 4)) {
if(xorriso->sh_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;
@ -902,7 +919,7 @@ int Xorriso_lsx_filev(struct XorrisO *xorriso, char *wd,
if(ret<=0)
link_target[0]= 0;
}
} else if(flag&4) { /* -du or -dus */
} 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,
@ -1186,7 +1203,7 @@ int Xorriso_findx_action(struct XorrisO *xorriso, struct FindjoB *job,
ret= 1;
} else if(action==18) { /* add_missing */
ret= Xorriso_compare_2_files(xorriso, abs_path, iso_path, abs_path+dpl,
&compare_result, 4|(1<<31));
&compare_result, 4|(1u<<31));
if(ret<xorriso->find_compare_result)
xorriso->find_compare_result= ret;
if(ret==0) {
@ -1826,11 +1843,11 @@ int Xorriso_afile_fopen(struct XorrisO *xorriso,
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,
off_t 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 *form= NULL, session_text[12], track_text[12], lba_text[24];
char *vars[5][2], *sfe= NULL, *volid_sfe= NULL, *cpt, *sysname;
char *cooked_dev= NULL, *eff_dev;
struct stat stbuf;
@ -1934,7 +1951,7 @@ int Xorriso_make_mount_cmd(struct XorrisO *xorriso, char *cmd,
}
sprintf(session_text, "%d", session);
sprintf(track_text, "%d", track);
sprintf(lba_text, "%d", lba);
sprintf(lba_text, "%.f", (double) lba);
vars[0][0]= "sbsector";
vars[0][1]= lba_text;
vars[1][0]= "track";
@ -2169,3 +2186,108 @@ ex:;
Xorriso_wait_child_end(xorriso, forked_pid, &status, 0);
return(ret);
}
/* flag: bit0= *capacity is a desired value.
Try SEEK_SET with *capacity
bit1= open for writing
return: 0= no random access , -1= cannot open path
1= *capacity is valid
*/
int Xorriso_lseek_capacity(struct XorrisO *xorriso, char *path,
off_t *capacity, int flag)
{
int fd;
off_t seek_result;
if(flag & 2)
fd= open(path, O_WRONLY);
else
fd= open(path, O_RDONLY);
if(fd < 0) {
sprintf(xorriso->info_text,
"Cannot open for determination of random-access capacity: ");
Text_shellsafe(path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0);
return(-1);
}
if(flag & 1) {
seek_result= lseek(fd, *capacity, SEEK_SET);
} else {
seek_result= lseek(fd, 0, SEEK_END);
}
close(fd);
if(seek_result < 0)
return(0);
*capacity= seek_result;
return(1);
}
/* flag: bit0= *capacity is a desired value.
If SEEK_END fails, try SEEK_SET with *capacity
bit1= open for writing
return: 0= no random access , -1= path does not exist , -2= wrong type
-3= cannot open path
1= *capacity is valid
*/
int Xorriso_determine_capacity(struct XorrisO *xorriso, char *path,
off_t *capacity, char **reason, int flag)
{
int ret;
off_t src_size, src_seek_size= -1;
struct stat stbuf;
if(reason != NULL)
*reason= "offers no random access";
if(lstat(path, &stbuf) == -1) {
*capacity= 0;
if(reason != NULL)
*reason= "does not exist";
return(-1);
}
if(S_ISREG(stbuf.st_mode)) {
src_size= stbuf.st_size;
} else if(!(S_ISDIR(stbuf.st_mode) || S_ISLNK(stbuf.st_mode) ||
S_ISFIFO(stbuf.st_mode) || S_ISSOCK(stbuf.st_mode))) {
ret= Xorriso_lseek_capacity(xorriso, path, &src_size, flag & 2);
if(ret <= 0 || src_size <= 0) {
if(ret == -1 || !(flag & 1)) {
*capacity= 0;
if(ret == -1) {
if(reason != NULL)
*reason= "cannot be opened";
return(-3);
}
return(ret > 0);
}
if(ret > 0)
src_seek_size= 0;
src_size= *capacity;
ret= Xorriso_lseek_capacity(xorriso, path, &src_size, flag & 3);
if(ret <= 0 || src_size < src_seek_size) {
if(src_seek_size == 0) {
src_size= src_seek_size;
} else {
*capacity= 0;
if(ret == -1) {
if(reason != NULL)
*reason= "cannot be opened";
return(-3);
}
return(0);
}
}
}
} else {
*capacity= 0;
if(reason != NULL)
*reason= "is of wrong type";
return(-2);
}
*capacity= src_size;
if(reason != NULL)
*reason= "";
return(1);
}

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2010 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -45,6 +45,17 @@ int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag);
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
@ -107,7 +118,7 @@ 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,
off_t lba, int track, int session, char *volid,
char *devadr, char result[SfileadrL], int flag);
int Xorriso_append_scdbackup_record(struct XorrisO *xorriso, int flag);
@ -116,5 +127,8 @@ int Xorriso_concat(struct XorrisO *xorriso, char *mode, char *target,
int progc, char **progv,
int filec, char **filev, int flag);
int Xorriso_determine_capacity(struct XorrisO *xorriso, char *path,
off_t *capacity, char **reason, int flag);
#endif /* ! Xorriso_pvt_diskop_includeD */

File diff suppressed because it is too large Load Diff

View File

@ -25,8 +25,8 @@ int Xorriso_check_md5_range(struct XorrisO *xorriso, off_t start_lba,
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);
off_t from_lba, off_t block_count, off_t read_chunk,
off_t md5_start, int flag);
int Xorriso_get_drive_handles(struct XorrisO *xorriso,
struct burn_drive_info **dinfo,

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2017 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -55,6 +55,7 @@ int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag)
"\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",
@ -80,20 +81,30 @@ int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag)
"\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",
"\tmodesty_on_drive=\tLike minbuf=, but with more parameters",
"\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",
"\t--obs_pad\t\tpad DVD DAO and stdio to full 32k or 64k",
"\t--bdr_obs_exempt\tpossibly exempt BD-R from padding to full 64k",
"\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 overwriteable media.",
"A much more elaborate cdrecord emulator is cdrskin from the same project.",
"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: <https://www.gnu.org/software/xorriso/>",
"General help using GNU software: <https://www.gnu.org/gethelp/>",
#else
"Report any bugs to bug-xorriso@gnu.org or in private to scdbackup@gmx.net .",
#endif
"@End_of_helptexT@"
};
int i;
@ -110,7 +121,8 @@ int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag)
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 ret, i, k, mem_do_close, aq_ret, eject_ret, hflag;
off_t msc1, msc2;
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;
@ -266,6 +278,8 @@ no_volunteer:;
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) {
@ -279,6 +293,11 @@ no_volunteer:;
strncmp(argpt, "dvd_obs=", 8)==0) {
cpt= strchr(argpt, '=') + 1;
Xorriso_option_dvd_obs(xorriso, cpt, 0);
} else if(strcmp(argv[i], "--obs_pad") == 0) { /* intentional: argv[i] */
xorriso->do_obs_pad= 1;
} else if(strcmp(argv[i], "--bdr_obs_exempt") == 0) {
/* intentional: argv[i] */
xorriso->bdr_obs_exempt= 1;
} else if(strcmp(argpt, "-eject")==0) {
do_eject= 1;
} else if(strncmp(argpt, "-fs=", 4)==0 || strncmp(argpt, "fs=", 3)==0) {
@ -430,7 +449,7 @@ no_volunteer:;
/* Perform actions */
Xorriso_option_report_about(xorriso, "NOTE", 0);
if(do_version) {
sprintf(xorriso->result_line, "Cdrecord 2.01-Emulation Copyright (C) 2017 see libburnia-project.org xorriso\n");
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);
}
@ -491,7 +510,7 @@ no_volunteer:;
if(dev_adr[0]) {
hflag= 2 | 64; /* ts B11201 no more: | 32 */
if(!do_grow)
hflag|= 8; /* consider overwriteables as blank */
hflag|= 8; /* consider overwritables as blank */
ret= Xorriso_option_dev(xorriso, dev_adr, hflag);
if(ret<=0)
goto ex;
@ -507,7 +526,7 @@ no_volunteer:;
ret= Xorriso_msinfo(xorriso, &msc1, &msc2, 2 | !!do_grow);
if(ret<=0)
goto ex;
sprintf(xorriso->result_line, "%d,%d\n", msc1, msc2);
sprintf(xorriso->result_line, "%.f,%.f\n", (double) msc1, (double) msc2);
Xorriso_result(xorriso, 1);
}
@ -625,7 +644,9 @@ int Xorriso_genisofs_count_args(struct XorrisO *xorriso, int argc, char **argv,
"-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",
"--gpt-iso-bootable", "--gpt-iso-not-ro",
"-part_like_isohybrid", "--zisofs-version-2", "--zisofs2-susp-z2",
"--zisofs2-susp-zf",
""
};
static char arg1_options[][41]= {
@ -654,8 +675,10 @@ int Xorriso_genisofs_count_args(struct XorrisO *xorriso, int argc, char **argv,
"-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-exclude", "-jigdo-map", "-md5-list",
"-jigdo-template-compress",
"-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",
@ -668,13 +691,17 @@ int Xorriso_genisofs_count_args(struct XorrisO *xorriso, int argc, char **argv,
""
};
static char arg2_options[][41]= {
"-hfs-bless-by", "--scdbackup_tag", "--sort-weight",
"-hfs-bless-by", "-hide_iso_path", "--scdbackup_tag", "--sort-weight",
""
};
static char arg3_options[][41]= {
"-append_partition", "-hfsplus-file-creator-type",
""
};
static char arg4_options[][41]= {
"-cut_out",
""
};
static char final_options[][41]= {
"-find",
""
@ -700,6 +727,10 @@ int Xorriso_genisofs_count_args(struct XorrisO *xorriso, int argc, char **argv,
for(i=0; arg3_options[i][0]!=0; i++)
if(strcmp(arg3_options[i], cmd)==0)
return(1);
*count= 4;
for(i=0; arg4_options[i][0]!=0; i++)
if(strcmp(arg4_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)
@ -720,7 +751,7 @@ int Xorriso_genisofs_ignore(struct XorrisO *xorriso, char *whom,
"-cache-inodes", "-check-oldnames",
"-L", "-no-bak", "-no-cache-inodes",
"-no-split-symlink-components", "-no-split-symlink-fields", "-nobak",
"-force-rr", "-T",
"-force-rr", "-T", "-translation-table",
"-no-iso-translate",
""
};
@ -787,6 +818,8 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
" -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",
" -hide_iso_path HIDE_STATE ISO_RR_PATH",
" Hide file by its ISO path",
" -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",
@ -849,11 +882,16 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
" -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-md5 PATTERN Pattern(s) where files MUST match an externally-supplied MD5sum",
" -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)",
" -md5-list FILE File containing MD5 sums of the files that should be checked",
" -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,...",
@ -880,12 +918,15 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
" -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 of ISO partition in 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",
" --gpt-iso-bootable Set Legacy BIOS bootable flag in ISO partition",
" --gpt-iso-not-ro Do not set Read-only flag in ISO partition",
" -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",
@ -908,9 +949,13 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
" -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..",
" 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.",
" -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",
" --modification-date=YYYYMMDDhhmmsscc",
" Override date of creation and modification",
" --set_all_file_dates TIME Override mtime, atime, ctime in all files",
@ -928,6 +973,9 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
" --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",
@ -937,6 +985,14 @@ int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
" --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: <https://www.gnu.org/software/xorriso/>",
"General help using GNU software: <https://www.gnu.org/gethelp/>",
#else
"Report any bugs to bug-xorriso@gnu.org or in private to scdbackup@gmx.net .",
#endif
"@End_of_helptexT@"
};
@ -1032,8 +1088,7 @@ int Xorriso_genisofs_hide_list(struct XorrisO *xorriso, char *whom,
}
ret= 1;
ex:;
if(flag & 1)
Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2);
Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2);
if(fp != NULL && fp != stdin)
fclose(fp);
if(ret<=0)
@ -1330,7 +1385,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
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[8], *iso_rr_pt, *disk_pt, *rpt, *wpt;
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;
@ -1399,7 +1454,7 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
continue;
if(strcmp(argpt, "-version")==0) {
sprintf(xorriso->result_line,
"mkisofs 2.01-Emulation Copyright (C) 2017 see libburnia-project.org xorriso\n"
"mkisofs 2.01-Emulation Copyright (C) 2019 see libburnia-project.org xorriso\n"
);
fd= xorriso->dev_fd_1;
if(fd<0)
@ -1573,11 +1628,13 @@ int Xorriso_genisofs(struct XorrisO *xorriso, char *whom,
Xorriso_option_md5(xorriso, "on", 0);
} else if(strcmp(argpt, "-z")==0 ||
strcmp(argpt, "-transparent-compression")==0) {
ret= Xorriso_genisofs_fused_options(xorriso, whom, "z",
&option_d, &iso_level, &lower_r, ra_text, 2);
if(ret <= 0)
goto problem_handler_1;
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;
@ -1646,7 +1703,7 @@ problem_handler_1:;
ret= 0; goto ex;
}
}
/* Regard overwriteable as blank, truncate regular files on write start */
/* Regard overwritable as blank, truncate regular files on write start */
ret= Xorriso_option_dev(xorriso, adr, 2|8|16);
if(ret<=0)
goto ex;
@ -1780,7 +1837,7 @@ illegal_c:;
/* 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]|= 1<<31;
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 */;
@ -1927,6 +1984,8 @@ not_enough_args:;
strcmp(argpt, "-eltorito-alt-boot")==0 ||
strcmp(argpt, "--protective-msdos-label")==0 ||
strcmp(argpt, "--mbr-force-bootable")==0 ||
strcmp(argpt, "--gpt-iso-bootable")==0 ||
strcmp(argpt, "--gpt-iso-not-ro")==0 ||
strcmp(argpt, "--boot-catalog-hide")==0 ||
strcmp(argpt, "-isohybrid-gpt-basdat")==0 ||
strcmp(argpt, "-isohybrid-gpt-hfsplus")==0 ||
@ -1934,7 +1993,7 @@ not_enough_args:;
strcmp(argpt, "-part_like_isohybrid")==0) {
delay_opt_list[delay_opt_count++]= i;
if(argv[i] != argpt)
delay_opt_list[delay_opt_count - 1]|= 1<<31;
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 ||
@ -1964,8 +2023,17 @@ not_enough_args:;
goto not_enough_args;
delay_opt_list[delay_opt_count++]= i;
if(argv[i] != argpt)
delay_opt_list[delay_opt_count - 1]|= 1<<31;
delay_opt_list[delay_opt_count - 1]|= 1u<<31;
i++;
} else if(strcmp(argpt, "-hide_iso_path") == 0) {
if(i + 2 >= 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+= 2;
} else if(strncmp(argpt, "--modification-date=", 20)==0) {
ret= Xorriso_option_volume_date(xorriso, "uuid", argpt + 20, 0);
if(ret <= 0)
@ -2010,7 +2078,10 @@ not_enough_args:;
sort_file_pattern= (strcmp(argpt, "--sort-weight-patterns") == 0);
} else if(strcmp(argpt, "-z")==0 ||
strcmp(argpt, "-transparent-compression")==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) {
@ -2089,15 +2160,18 @@ not_enough_args:;
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-map") == 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, "-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)
@ -2277,6 +2351,15 @@ rr_reloc_dir:;
if(ret <= 0)
goto problem_handler_2;
} else if(strcmp(argpt, "-cut_out") == 0) {
if(i + 4 >= argc)
goto not_enough_args;
i+= 4;
ret= Xorriso_option_cut_out(xorriso, argv[i - 3], argv[i - 2],
argv[i - 1], 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);
@ -2440,8 +2523,8 @@ problem_handler_2:;
/* After all pathspecs are added: perform delayed options, mostly boot related
*/
for(j= 0; j < delay_opt_count; j++) {
i= delay_opt_list[j] & ~(1 << 31);
if(delay_opt_list[j] & (1 << 31))
i= delay_opt_list[j] & ~(1u << 31);
if(delay_opt_list[j] & (1u << 31))
argpt= argv[i] + 1;
else
argpt= argv[i];
@ -2614,8 +2697,14 @@ problem_handler_2:;
} else if(strcmp(argpt, "--mbr-force-bootable") == 0) {
xorriso->system_area_options= xorriso->system_area_options | (1 << 15);
} else if(strcmp(argpt, "--gpt-iso-bootable") == 0) {
xorriso->system_area_options= xorriso->system_area_options | (1 << 16);
} else if(strcmp(argpt, "--gpt-iso-not-ro") == 0) {
xorriso->system_area_options= xorriso->system_area_options | (1 << 17);
} else if(strcmp(argpt, "--boot-catalog-hide")==0) {
xorriso->boot_image_cat_hidden|= 3;
xorriso->boot_image_cat_hidden|= 7;
} else if(strcmp(argpt, "-partition_offset") == 0 ||
strcmp(argpt, "-partition_sec_hd") == 0 ||
strcmp(argpt, "-partition_hd_cyl") == 0 ||
@ -2702,6 +2791,14 @@ problem_handler_2:;
if(ret <= 0)
goto problem_handler_boot;
} else if(strcmp(argpt, "-hide_iso_path") == 0) {
int i_plus;
i_plus= i + 2;
ret= Xorriso_option_hide(xorriso, argv[i + 1], i + 3, argv, &i_plus, 0);
if(ret <= 0)
goto problem_handler_boot;
}
continue; /* regular bottom of loop */
problem_handler_boot:;
@ -2712,7 +2809,8 @@ problem_handler_boot:;
continue;
goto ex;
}
if(with_boot_image && with_cat_path == 0)
if(with_boot_image && with_cat_path == 0 &&
!(xorriso->boot_image_cat_hidden & 1))
strcpy(xorriso->boot_image_cat_path, "/boot.catalog");
/* The boot catalog has to be hidden separately */
if(xorriso->boot_image_cat_path[0]) {

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2014 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -378,6 +378,25 @@ int Xorriso_set_filter(struct XorrisO *xorriso, void *in_node,
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))
@ -656,13 +675,30 @@ int Xorriso_status_extf(struct XorrisO *xorriso, char *filter, FILE *fp,
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;
int ret, i;
struct iso_zisofs_ctrl ctrl;
ctrl.version= 0;
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;
@ -670,6 +706,17 @@ int Xorriso_set_zisofs_params(struct XorrisO *xorriso, int flag)
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) {
@ -681,37 +728,96 @@ int Xorriso_set_zisofs_params(struct XorrisO *xorriso, int flag)
}
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= do only report non-default settings
bit1= do only report to fp
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) && xorriso->zlib_level == xorriso->zlib_level_default &&
xorriso->zisofs_block_size == xorriso->zisofs_block_size_default &&
xorriso->zisofs_by_magic == 0 &&
ziso_count == 0 && osiz_count == 0 &&
gzip_count == 0 && gunzip_count == 0) {
if(filter == NULL)
return(2);
if(filter[0] == 0)
return 2;
if(!(flag & 1)) {
always= 1;
} else if(filter != NULL) {
if(filter[0] != 0)
always= 1;
}
sprintf(xorriso->result_line,
"-zisofs level=%d:block_size=%dk:by_magic=%s:ziso_used=%.f:osiz_used=%.f",
xorriso->zlib_level, xorriso->zisofs_block_size / 1024,
xorriso->zisofs_by_magic ? "on" : "off",
(double) ziso_count, (double) osiz_count);
sprintf(xorriso->result_line + strlen(xorriso->result_line),
":gzip_used=%.f:gunzip_used=%.f\n",
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);
Xorriso_status_result(xorriso, filter, fp, flag & 2);
}
return(1);
}

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2016 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -753,7 +753,7 @@ int Findjob_endif(struct FindjoB *job, int flag)
}
if(job->cursor->up==NULL)
goto improper_range;
/* test wether parent node is -if */
/* 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) {
@ -895,16 +895,61 @@ int Findjob_set_num_filter(struct FindjoB *o, int test_type,
}
int Findjob_set_lba_range(struct FindjoB *o, int start_lba, int count,
int Findjob_set_size_filter(struct FindjoB *o, int test_type,
off_t 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(off_t), 1);
t->arg2= calloc(sizeof(int), 1);
if(t->arg1 == NULL || t->arg2 == NULL)
return(-1);
*((off_t *) t->arg1)= num1;
*((int *) t->arg2)= num2;
return(1);
}
int Findjob_set_off_t_filter(struct FindjoB *o, int test_type,
off_t num1, off_t 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(off_t), 1);
t->arg2= calloc(sizeof(off_t), 1);
if(t->arg1 == NULL || t->arg2 == NULL)
return(-1);
*((off_t *) t->arg1)= num1;
*((off_t *) t->arg2)= num2;
return(1);
}
int Findjob_set_lba_range(struct FindjoB *o, off_t start_lba, off_t count,
int flag)
{
int ret, end_lba;
int ret;
off_t 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);
ret= Findjob_set_off_t_filter(o, 4, start_lba, end_lba, 0);
return(ret);
}

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2016 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -32,7 +32,7 @@ struct ExprtesT {
1= -name char *arg1 (regex_t in *arg2)
2= -type char *arg1
3= -damaged
4= -lba_range int *arg1 int *arg2
4= -lba_range off_t *arg1 off_t *arg2
5= -has_acl
6= -has_xattr
7= -has_aaip
@ -55,6 +55,8 @@ struct ExprtesT {
24= -name_limit_blocker int *arg1
25= -maxdepth int *arg1
26= -mindepth int *arg1
27= -size off_t *arg1 int *arg2 (0=test for equal, -1=smaller, 1=larger,
-2=smaller_or_equal , 2=larger_or_equal)
*/
int test_type;
@ -245,7 +247,13 @@ 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 Findjob_set_size_filter(struct FindjoB *o, int test_type,
off_t num1, int num2, int flag);
int Findjob_set_off_t_filter(struct FindjoB *o, int test_type,
off_t num1, off_t num2, int flag);
int Findjob_set_lba_range(struct FindjoB *o, off_t start_lba, off_t count,
int flag);
int Findjob_set_wanted_node(struct FindjoB *o, void *wanted_node, int flag);

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2015 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -18,7 +18,7 @@ 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_assert_volid(struct XorrisO *xorriso, off_t msc1, int flag);
int Xorriso_is_isohybrid(struct XorrisO *xorriso, IsoFile *bootimg_node,
int flag);

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2017 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -36,7 +36,7 @@
#include "sort_cmp.h"
#include "parse_exec.h"
#include "write_run.h"
#include "disk_ops.h"
/* @param flag bit0= give directory x-permission where is r-permission
@ -126,6 +126,7 @@ int Xorriso_graft_split(struct XorrisO *xorriso, IsoImage *volume,
int partno, total_parts;
off_t offset;
char *part_name= NULL;
struct stat stbuf;
Xorriso_alloc_meM(part_name, char, SfileadrL);
@ -133,6 +134,8 @@ int Xorriso_graft_split(struct XorrisO *xorriso, IsoImage *volume,
if(ret < 0)
goto ex;
*node= (IsoNode *) new_dir;
if(lstat(disk_path, &stbuf) != -1)
Xorriso_transfer_properties(xorriso, &stbuf, disk_path, *node, 1 | 8);
if(xorriso->update_flags & 1) {
ret= Xorriso_mark_update_merge(xorriso, img_name, node, 1);
if(ret <= 0)
@ -285,7 +288,7 @@ ex:;
/*
@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 objetc.
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
@ -365,7 +368,7 @@ int Xorriso_add_tree(struct XorrisO *xorriso, IsoDir *dir,
char *name, *img_name, *srcpt, *stbuf_src= "";
struct stat stbuf, hstbuf;
dev_t dir_dev;
struct LinkiteM *own_link_stack;
struct LinkiteM *own_link_stack = NULL;
char *sfe= NULL, *sfe2= NULL;
char *disk_path= NULL, *img_path= NULL, *link_target= NULL;
@ -487,7 +490,7 @@ cannot_lstat:;
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);
ret= Xorriso_hop_link(xorriso, srcpt, &own_link_stack, &hstbuf, 8);
if(ret<0)
goto was_problem;
if(ret==1) {
@ -499,6 +502,7 @@ cannot_lstat:;
if(lstat(srcpt, &stbuf)==-1)
goto cannot_lstat;
} else {
Xorriso_msgs_submit(xorriso, 0, srcpt, 0, "ERRFILE", 0);
if(Xorriso_eval_problem_status(xorriso, 0, 1|2)<0)
{ret= 0; goto was_problem;}
ret= Xorriso_resolve_link(xorriso, srcpt, link_target, 1);
@ -871,6 +875,13 @@ int Xorriso_graft_in(struct XorrisO *xorriso, void *boss_iter,
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))
@ -1225,13 +1236,14 @@ int Xorriso_cut_out(struct XorrisO *xorriso, char *disk_path,
{
int ret;
char *eff_source= NULL, *eff_dest= NULL;
off_t src_size;
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);
2 | 4);
if(ret<=0)
goto ex;
ret= Xorriso_path_is_excluded(xorriso, disk_path, !(flag&1));
@ -1258,22 +1270,45 @@ int Xorriso_cut_out(struct XorrisO *xorriso, char *disk_path,
{ret= 0; goto ex;}
}
}
if(S_ISREG(stbuf.st_mode)) {
if(stbuf.st_size<startbyte) {
Xorriso_msgs_submit(xorriso, 0, eff_source, 0, "ERRFILE", 0);
sprintf(xorriso->info_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;}
src_size= stbuf.st_size;
} else if(!(S_ISDIR(stbuf.st_mode) || S_ISLNK(stbuf.st_mode) ||
S_ISFIFO(stbuf.st_mode) || S_ISSOCK(stbuf.st_mode))) {
src_size= startbyte + bytecount;
ret= Xorriso_determine_capacity(xorriso, eff_source, &src_size, NULL, 1);
if(ret <= 0)
goto unsupported_type;
if(src_size <= 0) {
Xorriso_msgs_submit(xorriso, 0,
"-cut_out: Special file with addressable size range of 0 encountered",
0, "FAILURE", 0);
goto unsupported_type;
}
} 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));
if(S_ISDIR(stbuf.st_mode) || S_ISLNK(stbuf.st_mode) ||
S_ISFIFO(stbuf.st_mode) || S_ISSOCK(stbuf.st_mode)) {
sprintf(xorriso->info_text,
"-cut_out: File type (%s) is not suitable for this command: ",
Ftypetxt(stbuf.st_mode, 0));
} else {
sprintf(xorriso->info_text,
"-cut_out: File (%s) does not support or permit random read access: ",
Ftypetxt(stbuf.st_mode, 0));
}
Text_shellsafe(eff_source, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE", 0);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
if(src_size < startbyte) {
Xorriso_msgs_submit(xorriso, 0, eff_source, 0, "ERRFILE", 0);
sprintf(xorriso->info_text,
"-cut_out: Byte offset %.f larger than addressable file size %.f : ",
(double) startbyte, (double) src_size);
Text_shellsafe(eff_source, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
@ -1584,7 +1619,7 @@ ex:;
if(sub_path!=NULL)
free(sub_path);
Xorriso_findi_iter(xorriso, (IsoDir *) victim_node, &mem, &iter,
&node_array, &node_count, &node_idx, &node, (1<<31));
&node_array, &node_count, &node_idx, &node, (1u<<31));
return(ret);
}
@ -1622,6 +1657,8 @@ int Xorriso_overwrite_dest(struct XorrisO *xorriso, void *boss_iter,
/* @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)
@ -1672,6 +1709,8 @@ int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter,
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");
@ -1687,7 +1726,7 @@ int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter,
{ret= 0; goto ex;}
}
/* Check whether destination exists and may be not overwriteable */
/* 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)
@ -2092,7 +2131,8 @@ int Xorriso_setfacl(struct XorrisO *xorriso, void *in_node, char *path,
if(ret<=0)
goto ex;
}
ret= iso_node_set_acl_text(node, access_text, default_text, 0);
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",
@ -2107,7 +2147,6 @@ int Xorriso_setfacl(struct XorrisO *xorriso, void *in_node, char *path,
Xorriso_set_change_pending(xorriso, 0);
ret= 1;
ex:;
Xorriso_process_msg_queues(xorriso,0);
return(ret);
}
@ -2507,7 +2546,7 @@ int Xorriso_cannot_create_iter(struct XorrisO *xorriso, int iso_error,int flag)
/* 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
node_count, node_idx ! They are just opaque handles for which this function
provides the memory of proper type.
@param flag bit0= initialize iteration
bit1= action needs full freedom of object manipulation
@ -2582,7 +2621,7 @@ cannot_iter:;
}
}
if(flag&(1<<31)) {
if(flag&(1u<<31)) {
if(*node_count>=0 && *node_array!=NULL) {
for(i= 0; i<*node_count; i++)
iso_node_unref((*node_array)[i]);
@ -2597,7 +2636,7 @@ cannot_iter:;
}
}
if(flag&(1|(1<<31)))
if(flag&(1|(1u<<31)))
return(1);
if(*node_count>=0) {
/* return next node_array element */
@ -3016,12 +3055,13 @@ return:
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;
int value=0, ret, bless_idx, size_mode, lba_count, i, mask;
off_t range_lba, end_lba, *file_end_lbas= NULL, *file_start_lbas= NULL;
off_t start_lba;
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;
off_t damage_start, damage_end, size, *section_sizes= NULL, size_arg;
void *xinfo_dummy;
IsoNode *node;
IsoStream *stream;
@ -3107,10 +3147,10 @@ return:
break; case 4: /* -lba_range *arg1 *arg2 */
value= 1;
start_lba= *((int *) ftest->arg1);
end_lba= *((int *) ftest->arg2);
range_lba= *((off_t *) ftest->arg1);
end_lba= *((off_t *) ftest->arg2);
if(node == NULL) {
value= !(start_lba >= 0);
value= !(range_lba >= 0);
goto ex;
}
ret= Xorriso__start_end_lbas(node, &lba_count, &file_start_lbas,
@ -3118,15 +3158,15 @@ return:
if(ret <= 0) {
if(ret < 0)
Xorriso_process_msg_queues(xorriso, 0);
if(start_lba >= 0)
if(range_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)
if(range_lba >= 0) {
if(file_end_lbas[i] < range_lba || file_start_lbas[i] > end_lba)
value= 0;
} else {
if(file_end_lbas[i] >= -start_lba && file_start_lbas[i] <= -end_lba)
if(file_end_lbas[i] >= -range_lba && file_start_lbas[i] <= -end_lba)
value= 0;
}
}
@ -3276,6 +3316,30 @@ return:
break; case 26: /* -mindepth */
value= (ftest->boss->depth >= *((int *) arg1));
break; case 27: /* -size */
size_arg= *((off_t *) arg1);
size_mode= *((int *) arg2);
ret= Xorriso__get_file_size(node, &size, 0);
if(ret <= 0) {
if(ret < 0)
Xorriso_process_msg_queues(xorriso, 0);
value= 0;
goto ex;
}
if(size_mode == 0) {
value= (size == size_arg);
} else if(size_mode == 1) {
value= (size > size_arg);
} else if(size_mode == 2) {
value= (size >= size_arg);
} else if(size_mode == -1) {
value= (size < size_arg);
} else if(size_mode == -2) {
value= (size <= size_arg);
} else {
value= 0;
}
break; default:
/* >>> complain about unknown test type */;
@ -3545,7 +3609,7 @@ ex:;
Xorriso_process_msg_queues(xorriso,0);
Xorriso_findi_iter(xorriso, dir_node, &mem, &iter, &node_array, &node_count,
&node_idx, &node, (1<<31));
&node_idx, &node, (1u<<31));
if(ret<=0)
return(ret);
if(deleted)

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2010 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -65,8 +65,6 @@ int Xorriso_findi_sorted(struct XorrisO *xorriso, struct FindjoB *job,
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);

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2016 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -47,7 +47,7 @@
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
bit5= (with bit4) 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
@ -196,6 +196,8 @@ ex:;
}
/* @param flag bit0=do not complain about non existent node
*/
int Xorriso_get_node_by_path(struct XorrisO *xorriso,
char *in_path, char *eff_path,
IsoNode **node, int flag)
@ -206,7 +208,8 @@ int Xorriso_get_node_by_path(struct XorrisO *xorriso,
Xorriso_alloc_meM(path, char, SfileadrL);
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, in_path, path, 0);
ret= Xorriso_normalize_img_path(xorriso, xorriso->wdi, in_path, path,
flag & 1);
if(ret<=0)
goto ex;
if(eff_path!=NULL)
@ -214,7 +217,7 @@ int Xorriso_get_node_by_path(struct XorrisO *xorriso,
ret= Xorriso_get_volume(xorriso, &volume, 0);
if(ret<=0)
goto ex;
ret= Xorriso_node_from_path(xorriso, volume, path, node, 0);
ret= Xorriso_node_from_path(xorriso, volume, path, node, flag & 1);
if(ret<=0)
{ret= 0; goto ex;}
ret= 1;
@ -303,7 +306,7 @@ int Xorriso_fake_stbuf(struct XorrisO *xorriso, char *path, struct stat *stbuf,
/* >>> With directories this should be : number of subdirs + 2 */
/* >>> ??? How to obtain RR hardlink number for other types ? */
/* This may get overriden farther down */
/* This may get overridden farther down */
stbuf->st_nlink= 1;
stbuf->st_uid= iso_node_get_uid(*node);
@ -456,7 +459,7 @@ ex:;
*/
/* @param flag bit0= use lba rather than node pointer
*/
int Xorriso_path_from_lba(struct XorrisO *xorriso, IsoNode *node, int lba,
int Xorriso_path_from_lba(struct XorrisO *xorriso, IsoNode *node, off_t lba,
char path[SfileadrL], int flag)
{
int ret;
@ -474,7 +477,7 @@ int Xorriso_path_from_lba(struct XorrisO *xorriso, IsoNode *node, int lba,
return(ret);
}
if(flag & 1)
Findjob_set_lba_range(job, lba, 1, 0);
Findjob_set_lba_range(job, lba, (off_t) 1, 0);
else
Findjob_set_wanted_node(job, (void *) node, 0);
Findjob_set_action_found_path(job, 0);
@ -495,7 +498,7 @@ int Xorriso_path_from_lba(struct XorrisO *xorriso, IsoNode *node, int lba,
/* @param flag bit0= in_node is valid, do not resolve iso_adr
bit2= recognize and parse split parts despite
xorrio->split_size <= 0
xorriso->split_size <= 0
*/
int Xorriso_identify_split(struct XorrisO *xorriso, char *iso_adr,
void *in_node,
@ -627,6 +630,8 @@ ex:;
/* @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)
@ -636,7 +641,7 @@ int Xorriso_is_split(struct XorrisO *xorriso, char *path, void *node,
struct stat stbuf;
ret= Xorriso_identify_split(xorriso, path, node, &split_parts,
&split_count, &stbuf, flag & 3);
&split_count, &stbuf, flag & 7);
if(split_parts!=NULL)
Splitparts_destroy(&split_parts, split_count, 0);
return(ret>0);
@ -835,7 +840,17 @@ int Xorriso_getfattr(struct XorrisO *xorriso, void *in_node, char *path,
if(ret <= 0)
goto ex;
if(flag & 64) {
ret= (num_attrs > 0);
if(flag & 16) {
ret= 0;
for(i= 0; i < (int) num_attrs; i++) {
if(strncmp(names[i], "isofs.", 6) != 0) {
ret= 1;
break;
}
}
} else {
ret= (num_attrs > 0);
}
goto ex;
}
if(num_attrs == 0)
@ -1294,7 +1309,9 @@ ex:
int Xorriso_stream_type(struct XorrisO *xorriso, IsoNode *node,
IsoStream *stream, char type_text[], int flag)
{
int ret, lba;
int ret, stream_type, block_size_log2;
off_t lba;
uint8_t zisofs_algo[2], algo_num;
char text[5];
strncpy(text, stream->class->type, 4);
@ -1305,10 +1322,16 @@ int Xorriso_stream_type(struct XorrisO *xorriso, IsoNode *node,
strcpy(type_text, "image");
else
strcpy(type_text, "disk");
} else if(strcmp(text, "ziso") == 0) {
strcpy(type_text, "--zisofs");
} else if(strcmp(text, "osiz") == 0) {
strcpy(type_text, "--zisofs-decode");
} 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) {
@ -1400,6 +1423,8 @@ int Xorriso_make_md5(struct XorrisO *xorriso, void *in_node, char *path,
/* @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,
@ -1516,13 +1541,15 @@ much_too_long:;
report_size= sub_size/1024;
if(report_size*1024<sub_size)
report_size++;
if(xorriso->sh_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);
if(!(flag & 4)) {
if(xorriso->sh_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:;
@ -1844,6 +1871,41 @@ ex:;
}
/*
@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().
@ -2037,7 +2099,7 @@ ex:;
/* @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 temporay memory needs
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,
@ -2159,8 +2221,20 @@ ex:;
}
int Xorriso__start_end_lbas(IsoNode *node,
int *lba_count, int **start_lbas, int **end_lbas,
/* @return 1= size is valid , 0= not a regular file , -1 = error
*/
int Xorriso__get_file_size(IsoNode *node, off_t *size, int flag)
{
*size= 0;
if(!LIBISO_ISREG(node))
return(0);
*size= iso_file_get_size((IsoFile *) node);
return(1);
}
int Xorriso__start_end_lbas(IsoNode *node, int *lba_count,
off_t **start_lbas, off_t **end_lbas,
off_t **section_sizes, off_t *size, int flag)
{
int section_count= 0, ret, i;
@ -2179,8 +2253,8 @@ int Xorriso__start_end_lbas(IsoNode *node,
{ret= -1; goto ex;}
if(ret != 1 || section_count <= 0)
{ret= 0; goto ex;}
*start_lbas= calloc(section_count, sizeof(int));
*end_lbas= calloc(section_count, sizeof(int));
*start_lbas= calloc(section_count, sizeof(off_t));
*end_lbas= calloc(section_count, sizeof(off_t));
*section_sizes= calloc(section_count, sizeof(off_t));
if(*start_lbas == NULL || *end_lbas == NULL || *section_sizes == NULL)
{ret= -1; goto ex;}
@ -2208,11 +2282,10 @@ ex:;
}
int Xorriso__file_start_lba(IsoNode *node,
int *lba, int flag)
int Xorriso__file_start_lba(IsoNode *node, off_t *lba, int flag)
{
int *start_lbas= NULL, *end_lbas= NULL, lba_count= 0, i, ret;
off_t size, *section_sizes= NULL;
int lba_count= 0, i, ret;
off_t size, *section_sizes= NULL, *start_lbas= NULL, *end_lbas= NULL;
*lba= -1;
ret= Xorriso__start_end_lbas(node, &lba_count, &start_lbas, &end_lbas,
@ -2351,7 +2424,7 @@ int Xorriso_show_stream(struct XorrisO *xorriso, void *in_node,
IsoFile *file;
IsoStream *stream= NULL, *input_stream;
IsoExternalFilterCommand *cmd;
char type_text[16], *source_path= NULL;
char type_text[80], *source_path= NULL;
unsigned int fs_id;
dev_t dev_id;
ino_t ino_id;
@ -2430,8 +2503,8 @@ 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;
int lba_count= 0, sect, ret;
off_t i, sectors, sector_size, *start_lbas= NULL, *end_lbas= NULL;
off_t sect_base= 0, size= 0, byte, *section_sizes= NULL;
struct SectorbitmaP *map;
@ -2458,8 +2531,7 @@ int Xorriso_file_eval_damage(struct XorrisO *xorriso, IsoNode *node,
*damage_end= byte + (off_t) 2048;
}
}
sect_base+= ((off_t) 2048) *
((off_t) (end_lbas[sect] - start_lbas[sect] + 1));
sect_base+= ((off_t) 2048) * (end_lbas[sect] - start_lbas[sect] + 1);
}
if(*damage_end > size)
*damage_end= size;
@ -2481,8 +2553,8 @@ int Xorriso_file_eval_damage(struct XorrisO *xorriso, IsoNode *node,
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;
int ret, lba_count, i;
off_t size, *section_sizes= NULL, *start_lbas= NULL, *end_lbas= NULL;
ret= Xorriso__start_end_lbas(node, &lba_count, &start_lbas, &end_lbas,
&section_sizes, &size, 0);
@ -2496,12 +2568,13 @@ int Xorriso_report_lba(struct XorrisO *xorriso, char *show_path,
if(flag & 1)
size= section_sizes[i];
if(flag & 2) {
if(end_lbas[i] > 0 && (uint32_t) end_lbas[i] > *last_block)
if(end_lbas[i] > 0 && end_lbas[i] > (off_t) *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);
"File data lba: %2d , %8.f , %8.f , %8.f , ",
i, (double) start_lbas[i],
(double) (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);
@ -2701,7 +2774,8 @@ int Xorriso_getfname(struct XorrisO *xorriso, char *path, int flag)
int Xorriso_is_plain_image_file(struct XorrisO *xorriso, void *in_node,
char *path, int flag)
{
int ret, lba;
int ret;
off_t lba;
IsoStream *stream;
IsoNode *node;
@ -2722,3 +2796,86 @@ int Xorriso_is_plain_image_file(struct XorrisO *xorriso, void *in_node,
return(0);
}
/*
Check for existence of a data file at given path. Complain if it is missing.
@param prefix is printed directly before purpose, no blank inbetween
@param purpose is printed up to first '=' character
@param path ISO or disk file path
@param flag bit0= check on disk (else in ISO)
*/
int Xorriso_warn_if_not_exist(struct XorrisO *xorriso, char *prefix,
char *purpose, char *path, int flag)
{
int ret;
char *where, *ept;
struct stat stbuf;
if(flag & 1) {
where= "on disk";
ret= Sfile_type(path, 1 | 4 | 16);
if(ret == 1 || ret == 6)
return(1);
} else {
where= "in ISO image";
ret= Xorriso_iso_lstat(xorriso, path, &stbuf, 0);
if(ret == 0) {
if(S_ISREG(stbuf.st_mode) || S_ISBLK(stbuf.st_mode))
return(0);
}
}
/* Not found or not data file or block device */
sprintf(xorriso->info_text, "%s%s", prefix, purpose);
ept= strchr(xorriso->info_text + strlen(prefix), '=');
if(ept != NULL)
*(ept + 1)= 0;
if(ret == -1) {
sprintf(xorriso->info_text + strlen(xorriso->info_text),
" : path does not yet exist %s : ", where);
} else {
sprintf(xorriso->info_text + strlen(xorriso->info_text),
" : path exists %s but is not a usable file type : ", where);
}
Text_shellsafe(path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
return(0);
}
/*
Check for existence of a file at given path. Complain if it exists but is
not a boot catalog file.
@param prefix is printed directly before purpose, no blank inbetween
@param purpose is printed up to first '=' character
@param path ISO file path
*/
int Xorriso_warn_if_not_bootcat(struct XorrisO *xorriso, char *prefix,
char *purpose, char *path, int flag)
{
int ret;
char *where, *ept;
IsoImage *volume;
IsoNode *node;
where= "in ISO image";
ret= Xorriso_get_volume(xorriso, &volume, 0);
if(ret <= 0)
return(-1);
ret= Xorriso_node_from_path(xorriso, volume, path, &node, 1);
if(ret <= 0)
return(1);
if(LIBISO_ISBOOT(node))
return(2);
sprintf(xorriso->info_text, "%s%s", prefix, purpose);
ept= strchr(xorriso->info_text + strlen(prefix), '=');
if(ept != NULL)
*(ept + 1)= 0;
sprintf(xorriso->info_text + strlen(xorriso->info_text),
" : path exists %s but is currently not a boot catalog file : ",
where);
Text_shellsafe(path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
return(0);
}

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2016 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -49,7 +49,7 @@ 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,
int Xorriso_path_from_lba(struct XorrisO *xorriso, IsoNode *node, off_t lba,
char path[SfileadrL], int flag);
int Xorriso_get_attr_value(struct XorrisO *xorriso, void *in_node, char *path,
@ -71,12 +71,13 @@ int Xorriso_obtain_pattern_files_i(
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,
int Xorriso__get_file_size(IsoNode *node, off_t *size, int flag);
int Xorriso__start_end_lbas(IsoNode *node, int *lba_count,
off_t **start_lbas, off_t **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_start_lba(IsoNode *node, off_t *lba, int flag);
int Xorriso_file_eval_damage(struct XorrisO *xorriso, IsoNode *node,
off_t *damage_start, off_t *damage_end,

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2016 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -57,6 +57,7 @@
#include "lib_mgt.h"
#include "iso_manip.h"
#include "write_run.h"
int Xorriso_abort(struct XorrisO *xorriso, int flag)
@ -120,7 +121,7 @@ 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= {0, 6, 15};
struct iso_zisofs_ctrl zisofs_ctrl;
/* First an ugly compile time check for header version compatibility.
@ -145,7 +146,7 @@ int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag)
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 indendation is an advise of man gcc to help old compilers ignoring */
/* 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
@ -213,13 +214,28 @@ LIBISOBURN_MISCONFIGURATION_ = 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);
@ -765,8 +781,10 @@ int Xorriso_jigdo_interpreter(struct XorrisO *xorriso, char *aspect, char *arg,
goto jte_failed;
xorriso->libjte_params_given|= 8;
} else if(strcmp(aspect, "md5_path") == 0 ||
strcmp(aspect, "-md5-list") == 0) {
ret= libjte_set_md5_path(jte, arg);
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;
@ -802,8 +820,10 @@ int Xorriso_jigdo_interpreter(struct XorrisO *xorriso, char *aspect, char *arg,
goto jte_failed;
xorriso->libjte_params_given|= 512;
} else if(strcmp(aspect, "demand_md5") == 0 ||
strcmp(aspect, "-jigdo-force-md5") == 0) {
ret= libjte_add_md5_demand(jte, arg);
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;
@ -813,6 +833,13 @@ int Xorriso_jigdo_interpreter(struct XorrisO *xorriso, char *aspect, char *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);
@ -979,37 +1006,83 @@ int Xorriso_set_data_cache(struct XorrisO *xorriso, void *o,
return(ret);
}
/* @param flag bit0= issue hex string rather than structured text format
*/
int Xorriso_format_guid(struct XorrisO *xorriso, uint8_t guid[16], char *line,
int flag)
{
int i;
line[0]= 0;
for(i= 3; i >= 0; i--)
sprintf(line + strlen(line), "%-2.2x", guid[i]);
sprintf(line + strlen(line), "-");
for(i= 5; i >= 4; i--)
sprintf(line + strlen(line), "%-2.2x", guid[i]);
sprintf(line + strlen(line), "-");
for(i= 7; i >= 6; i--)
sprintf(line + strlen(line), "%-2.2x", guid[i]);
sprintf(line + strlen(line), "-");
for(i= 8; i < 10; i++)
sprintf(line + strlen(line), "%-2.2x", guid[i]);
sprintf(line + strlen(line), "-");
for(i= 10; i < 16; i++)
sprintf(line + strlen(line), "%-2.2x", guid[i]);
Xorriso__format_guid(guid, line, !(flag & 1));
return(1);
}
/* @param flag bit0= issue hex string rather than structured text format
*/
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);
ret= Xorriso_format_guid(xorriso, guid, line, flag & 1);
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);
}
/* Frontend to isoburn_conv_name_chars()
@param flag bit0= File name.
Do not omit version number if it would appear.
*/
int Xorriso_conv_name_chars(struct XorrisO *xorriso, char *name,
char **result, size_t *result_len,
int name_space, int flag)
{
int ret, relax_mem;
struct isoburn_imgen_opts *sopts= NULL;
*result= NULL;
*result_len= 0;
relax_mem= xorriso->relax_compliance;
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;
}
ret= isoburn_conv_name_chars(sopts, name, strlen(name), result, result_len,
name_space);
if(ret <= 0) {
Xorriso_process_msg_queues(xorriso, 0);
ret= 0; goto ex;
}
ret= 1;
ex:;
isoburn_igopt_destroy(&sopts, 0);
xorriso->relax_compliance= relax_mem;
return(ret);
}

View File

@ -22,7 +22,7 @@
/* The library which does MMC optical drive operations */
#include <libburn/libburn.h>
/* The library which enhances overwriteable media with ISO 9660 multi-session
/* The library which enhances overwritable media with ISO 9660 multi-session
capabilities via the method invented by Andy Polyakov for growisofs */
#include <libisoburn/libisoburn.h>

View File

@ -4,14 +4,18 @@
# from base file xorriso/xorriso.texi.
# Same for xorriso/xorrisofs.texi and xorriso/xorrecord.texi.
( cd xorriso ; makeinfo ./xorriso.texi )
( cd xorriso ; makeinfo ./xorrisofs.texi )
( cd xorriso ; makeinfo ./xorrecord.texi )
( cd xorriso ; makeinfo ./xorriso-tcltk.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 )
( cd test ; makeinfo --no-split ./merge_debian_isos.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
xorriso/make_xorriso_1 -auto -merge_debian_isos

View File

@ -7,10 +7,12 @@
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.
of from test/merge_debian_iso.texi to test/merge_debian_iso.1
The conversion rules are described at the beginning of xorriso/xorriso.texi
Copyright 2010 - 2011 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2010 - 2022 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
*/
@ -190,7 +192,7 @@ int Mx1_rewrap(struct Mx1 *m, char **read_pt, char **write_pt,
strcpy(wpt, front);
wpt+= strlen(front);
if(l > 0)
strncpy(wpt, content, l);
memcpy(wpt, content, l);
wpt+= l;
strcpy(wpt, back);
wpt+= strlen(back);
@ -477,6 +479,7 @@ usage:;
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++) {
@ -493,6 +496,12 @@ usage:;
} 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 if(strcmp(argv[i], "-merge_debian_isos") == 0) {
strcpy(name_in, "test/merge_debian_isos.texi");
strcpy(name_out, "test/merge_debian_isos.1");
} else {
fprintf(stderr, "%s : unknown option %s\n", argv[0], argv[i]);
goto usage;

View File

@ -1,7 +1,7 @@
#!/bin/sh
# make_xorriso_standalone.sh
# Copyright 2008 - 2017 Thomas Schmitt, scdbackup@gmx.net, GPLv2+
# Copyright 2008 - 2023 Thomas Schmitt, scdbackup@gmx.net, GPLv2+
#
# Not intended for general use in production installations !
#
@ -50,7 +50,7 @@ create_gnu_xorriso="yes"
current_dir=$(pwd)
lone_dir="$current_dir"/"xorriso-standalone"
xorriso_rev=1.5.0
xorriso_rev=1.5.7
# For unstable uploads and patch level 0 of stable releases:
xorriso_pl=""
# For higher patch levels of stable releases:
@ -118,6 +118,7 @@ copy_files \
COPYING \
ChangeLog \
INSTALL \
NEWS \
acinclude.m4 \
aclocal.m4 \
bootstrap \
@ -246,6 +247,10 @@ copy_files doc/partition_offset.wiki \
create_dir "$lone_dir"/test
copy_files \
test/compare_file.c \
test/merge_debian_isos \
test/merge_debian_isos.texi \
test/merge_debian_isos.info \
test/merge_debian_isos.1 \
"$lone_dir"/test
create_dir "$lone_dir"/frontend
@ -258,6 +263,14 @@ copy_files \
frontend/grub-mkrescue-sed.sh \
"$lone_dir"/frontend
create_dir "$lone_dir"/xorriso-dd-target
copy_files \
xorriso-dd-target/xorriso-dd-target \
xorriso-dd-target/xorriso-dd-target.texi \
xorriso-dd-target/xorriso-dd-target.info \
xorriso-dd-target/xorriso-dd-target.1 \
"$lone_dir"/xorriso-dd-target
# releng
@ -277,6 +290,7 @@ copy_files libisofs/*.[ch] "$lone_dir"/libisofs
copy_files libisofs/filters/*.[ch] "$lone_dir"/libisofs/filters
copy_files doc/susp_aaip*.txt "$lone_dir"/doc
copy_files doc/zisofs_format.txt "$lone_dir"/doc
copy_files doc/zisofs2_format.txt "$lone_dir"/doc
copy_files doc/checksums.txt "$lone_dir"/doc
copy_files doc/boot_sectors.txt "$lone_dir"/doc
copy_files COPYRIGHT "$lone_dir"/libisofs

View File

@ -113,8 +113,7 @@ int Xorriso_prepare_regex(struct XorrisO *xorriso, char *adr, int flag)
if(adr_part[0]==0)
goto next_adr_part;
if(adr_part[0]=='.' && adr_part[1]==0 &&
(xorriso->re_fill>0 || i<count-1))
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 */
@ -159,6 +158,12 @@ next_adr_part:;
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 */

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -176,7 +176,7 @@ ex:;
(Also accepts capital letters.)
@param text Input like "42", "2k", "3.14m" or "-1g"
@param flag Bitfield for control purposes:
bit0= return -1 rathern than 0 on failure
bit0= return -1 rather than 0 on failure
@return The derived double value
*/
double Scanf_io_size(char *text, int flag)
@ -679,7 +679,7 @@ completed:;
3= Mon Day hh:mm:ss Year
4= YYMMDD.hhmmss
*/
char *Ftimetxt(time_t t, char timetext[40], int flag)
char *Ftimetxt(time_t t, char *timetext, int flag)
{
char *rpt;
struct tm tms, *tmpt;
@ -1065,8 +1065,8 @@ char *Text_shellsafe(char *in_text, char *out_text, int flag)
} else {
if(w + 3 > limit) {
overflow:;
strncpy(out_text, "'xorriso: TEXT MUCH TOO LONG ... ",33);
break;
strcpy(out_text, "'xorriso: TEXT MUCH TOO LONG ... '");
return(out_text);
}
out_text[w++]= in_text[i];
}
@ -1334,3 +1334,51 @@ int Xorriso__exchange_prefix(char *source_prefix, char *target_prefix,
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);
}

View File

@ -1,11 +1,12 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2012 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
This file contains declarations of cellaneous helper functions of xorriso.
This file contains declarations of miscellaneous helper functions of
xorriso.
*/
@ -14,6 +15,14 @@
#include <regex.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#else
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#endif
char *Text_shellsafe(char *in_text, char *out_text, int flag);
@ -25,7 +34,7 @@ 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);
char *Ftimetxt(time_t t, char *timetext, int flag);
int System_uname(char **sysname, char **release, char **version,
char **machine, int flag);
@ -34,7 +43,7 @@ int System_uname(char **sysname, char **release, char **version,
[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 rathern than 0 on failure
bit0= return -1 rather than 0 on failure
@return The derived double value
*/
double Scanf_io_size(char *text, int flag);
@ -101,5 +110,18 @@ int Xorriso__to_upper(char *in, char *out, int out_size, int flag);
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 */

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2017 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -295,52 +295,120 @@ ex:;
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;
int partno = 0, type_code= -1, i, guid_valid= 0, ret, set_changed= 0;
int disable= 0;
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) {
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:;
if(strcmp(partno_text, "all") == 0) {
if(strcmp(type_text, "revoke") != 0 && image_path[0] != 0) {
sprintf(xorriso->info_text,
"-append_partition: Partition type '%s' is out of range (0x00...0xff)",
type_text);
"-append_partition: Pseudo partition number 'all' works only with type code 'revoke' or empty disk path");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
partno= -1;
} else {
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);
}
type_code= unum;
}
if(xorriso->appended_partitions[partno - 1] != NULL)
if(strcmp(type_text, "revoke") == 0) {
disable= 1;
} else {
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;
}
disable= (image_path[0] == 0);
}
if(partno == -1) {
/* All partitions */
set_changed= 0;
for(i= 0; i < Xorriso_max_appended_partitionS; i++) {
/* For now only pseudo-type 'revoke' works for all partitions */
if(xorriso->appended_partitions[i - 1] != NULL) {
if(xorriso->appended_partitions[i - 1][0] != 0)
set_changed= 1;
free(xorriso->appended_partitions[i - 1]);
xorriso->appended_partitions[i - 1]= NULL;
}
}
goto work_done;
}
set_changed= 1;
if(xorriso->appended_partitions[partno - 1] != NULL) {
if(strcmp(xorriso->appended_partitions[partno - 1], image_path) == 0)
set_changed= 0;
free(xorriso->appended_partitions[partno - 1]);
xorriso->appended_partitions[partno - 1]= NULL;
} else {
if(disable)
set_changed= 0;
}
if(disable)
goto work_done;
xorriso->appended_partitions[partno - 1]= strdup(image_path);
if(xorriso->appended_partitions[partno - 1] == NULL) {
Xorriso_no_malloc_memory(xorriso, NULL, 0);
return(-1);
}
if(xorriso->appended_part_types[partno - 1] != type_code)
set_changed= 1;
xorriso->appended_part_types[partno - 1]= type_code;
if(guid_valid) {
if(xorriso->appended_part_gpt_flags[partno - 1] & 1) {
if(memcmp(xorriso->appended_part_type_guids[partno - 1], guid, 16) != 0)
set_changed= 1;
} else {
set_changed= 1;
}
memcpy(xorriso->appended_part_type_guids[partno - 1], guid, 16);
xorriso->appended_part_gpt_flags[partno - 1]|= 1;
} else {
if(xorriso->appended_part_gpt_flags[partno - 1] & 1)
set_changed= 1;
xorriso->appended_part_gpt_flags[partno - 1]&= ~1;
}
work_done:;
if(set_changed)
Xorriso_set_change_pending(xorriso, 1);
return(1);
}
@ -474,6 +542,25 @@ int Xorriso_option_assert_volid(struct XorrisO *xorriso, char *pattern,
}
/* Command -assess_indev_features */
int Xorriso_option_assess_indev_features(struct XorrisO *xorriso, char *mode,
int flag)
{
int ret;
if(strcmp(mode, "plain") != 0 && strcmp(mode, "cmd") != 0 &&
strcmp(mode, "as_mkisofs") != 0 && strcmp(mode, "replay") != 0 &&
mode[0] != 0) {
sprintf(xorriso->info_text, "-assess_indev_features: unknown mode '%s'",
mode);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
return(0);
}
ret= Xorriso_assess_written_features(xorriso, mode, 0);
return(ret);
}
/* Option -auto_charset "on"|"off" */
int Xorriso_option_auto_charset(struct XorrisO *xorriso, char *mode, int flag)
{
@ -683,7 +770,7 @@ int Xorriso_option_boot_image(struct XorrisO *xorriso, char *form,
char *treatment, int flag)
{
int was_ok= 1, ret, isolinux_grub= 0, count, bin_count, parm_len;
int palohdrversion;
int palohdrversion, type_code, is_change= 0;
unsigned int u;
char *formpt, *treatpt, *eff_path= NULL, *eqpt, parm[20];
uint8_t sn[8];
@ -713,6 +800,7 @@ cannot_keep_or_patch:;
xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~3) | 0;
xorriso->boot_image_bin_path[0]= 0;
xorriso->patch_system_area= 0;
is_change= 1;
} else if(strcmp(treatpt, "patch")==0) {
treatment_patch:;
@ -728,6 +816,7 @@ treatment_patch:;
xorriso->patch_system_area= 2;
else
xorriso->patch_system_area= 0;
is_change= 1;
} else if(strcmp(treatpt, "replay")==0) {
ret= Xorriso_report_system_area(xorriso, "cmd", 2);
@ -746,6 +835,7 @@ treatment_patch:;
if(ret <= 0)
goto ex;
}
is_change= 1;
} else if(strcmp(treatpt, "next") == 0) {
ret= Xorriso_attach_boot_image(xorriso, 0);
@ -767,23 +857,30 @@ treatment_patch:;
sprintf(xorriso->result_line, "------------------------------------\n");
Xorriso_result(xorriso, 0);
Xorriso_status(xorriso, "-boot_image", NULL, 0);
Xorriso_status(xorriso, "-append_partition", 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;
is_change= 1;
} 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;
Xorriso_warn_if_not_bootcat(xorriso, "-boot_image ", treatment,
xorriso->boot_image_cat_path, 0);
is_change= 1;
} else if(strncmp(treatpt, "cat_hidden=", 11) == 0) {
ret= Xorriso__hide_mode(treatpt + 11, 0);
if(ret >= 0)
if(ret >= 0) {
is_change= 1;
xorriso->boot_image_cat_hidden= ret;
else
} else {
was_ok= 0;
}
} else if(strncmp(treatpt, "dir=", 4) == 0) {
if(strcmp(formpt, "isolinux")==0) {
@ -817,6 +914,11 @@ treatment_patch:;
xorriso->keep_boot_image= 0;
xorriso->patch_isolinux_image= (xorriso->patch_isolinux_image & ~3) | 1;
strcpy(xorriso->boot_image_bin_form, formpt);
Xorriso_warn_if_not_exist(xorriso, "Implicit boot image via -boot_image ",
treatment, xorriso->boot_image_bin_path, 0);
Xorriso_warn_if_not_bootcat(xorriso, "-boot_image ", treatment,
xorriso->boot_image_cat_path, 0);
is_change= 1;
{ret= 1; goto ex;}
} else if(strcmp(formpt, "grub") == 0) {
@ -825,6 +927,7 @@ treatment_patch:;
was_ok= 0;
strcpy(xorriso->boot_image_bin_form, formpt);
is_change= 1;
} else
was_ok= 0;
@ -832,14 +935,25 @@ treatment_patch:;
} else if(strcmp(treatpt, "bin_path=") == 0) {
xorriso->boot_image_bin_path[0] = 0;
xorriso->boot_efi_default= 0;
is_change= 1;
} 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_warn_if_not_exist(xorriso, "-boot_image ",
treatment, xorriso->boot_image_bin_path, 0);
}
xorriso->keep_boot_image= 0;
if(isolinux_grub) {
@ -852,21 +966,28 @@ treatment_patch:;
} else
strcpy(xorriso->boot_image_bin_form, "any");
xorriso->boot_efi_default= 0;
is_change= 1;
} else if(strcmp(treatpt, "efi_path=") == 0) {
xorriso->boot_image_bin_path[0] = 0;
xorriso->boot_efi_default= 0;
is_change= 1;
} 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_warn_if_not_exist(xorriso, "-boot_image ",
treatment, xorriso->boot_image_bin_path, 0);
}
xorriso->keep_boot_image= 0;
xorriso->boot_efi_default= 1;
is_change= 1;
} else if(strncmp(treatpt, "mips_path=", 10) == 0) {
sprintf(eff_path, "-boot_image %s mips_path=", formpt);
@ -880,6 +1001,8 @@ treatment_patch:;
ret= Xorriso_add_mips_boot_file(xorriso, eff_path, 0);
if(ret <= 0)
goto ex;
Xorriso_warn_if_not_exist(xorriso, "-boot_image ", treatment, eff_path, 0);
is_change= 1;
} else if(strncmp(treatpt, "mipsel_path=", 12) == 0) {
sprintf(eff_path, "-boot_image %s mipsel_path=", formpt);
@ -893,6 +1016,8 @@ treatment_patch:;
ret= Xorriso_add_mips_boot_file(xorriso, eff_path, 2);
if(ret <= 0)
goto ex;
Xorriso_warn_if_not_exist(xorriso, "-boot_image ", treatment, eff_path, 0);
is_change= 1;
} else if(strcmp(treatpt, "mips_discard") == 0 ||
strcmp(treatpt, "mipsel_discard") == 0 ||
@ -903,6 +1028,7 @@ treatment_patch:;
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 */
is_change= 1;
} else if(strncmp(treatpt, "sparc_label=", 12) == 0) {
sprintf(eff_path, "-boot_image %s sparc_label=", formpt);
@ -912,12 +1038,16 @@ treatment_patch:;
strncpy(xorriso->ascii_disc_label, treatpt + 12,
Xorriso_disc_label_sizE - 1);
xorriso->ascii_disc_label[Xorriso_disc_label_sizE - 1] = 0;
is_change= 1;
} 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;
Xorriso_warn_if_not_exist(xorriso, "-boot_image ", treatment,
xorriso->grub2_sparc_core, 0);
is_change= 1;
} else if(strncmp(treatpt, "hppa_", 5) == 0) {
sprintf(eff_path, "-boot_image %s %s", formpt, treatpt);
@ -943,6 +1073,8 @@ treatment_patch:;
ret= Xorriso_set_hppa_boot_parm(xorriso, eqpt + 1, parm, 0);
if(ret <= 0)
goto ex;
/* (needs no file existence check because already done in libisofs) */
is_change= 1;
} else if(strncmp(treatpt, "alpha_boot=", 11) == 0) {
sprintf(eff_path, "-boot_image %s %s", formpt, treatpt);
@ -952,6 +1084,9 @@ treatment_patch:;
ret = Xorriso_set_alpha_boot(xorriso, treatpt + 11, 0);
if(ret <= 0)
goto ex;
Xorriso_warn_if_not_exist(xorriso, "-boot_image ", treatment,
treatpt + 11, 0);
is_change= 1;
} else if(strncmp(treatpt, "boot_info_table=", 16)==0) {
if(strcmp(treatpt + 16, "off") == 0)
@ -961,6 +1096,8 @@ treatment_patch:;
1 | (2 * (strcmp(treatpt, "grub") == 0));
else
was_ok= 0;
if(was_ok)
is_change= 1;
} else if(strncmp(treatpt, "grub2_boot_info=", 16)==0) {
if(strcmp(treatpt + 16, "off") == 0)
@ -969,6 +1106,8 @@ treatment_patch:;
xorriso->patch_isolinux_image= xorriso->patch_isolinux_image | 512;
else
was_ok= 0;
if(was_ok)
is_change= 1;
} else if(strncmp(treatpt, "load_size=", 10) == 0) {
if(strcmp(treatpt + 10, "full") == 0) {
@ -985,6 +1124,7 @@ treatment_patch:;
xorriso->boot_image_load_size= num;
}
xorriso->boot_img_size_default= 0;
is_change= 1;
} else if(strncmp(treatpt, "id_string=", 10) == 0) {
memset(xorriso->boot_id_string, 0, 29);
@ -994,6 +1134,7 @@ treatment_patch:;
ret= 0;
if(ret <= 0)
strncpy((char *) xorriso->boot_id_string, treatpt + 10, 28);
is_change= 1;
} else if(strncmp(treatpt, "sel_crit=", 9) == 0) {
memset(xorriso->boot_selection_crit, 0, 21);
@ -1006,6 +1147,7 @@ treatment_patch:;
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
is_change= 1;
} else if(strncmp(treatpt, "system_area=", 12) == 0) {
if(strcmp(formpt, "isolinux")==0) {
@ -1017,6 +1159,7 @@ treatment_patch:;
if(strcmp(treatpt + 12, ".") == 0) {
ret= Xorriso_set_system_area_path(xorriso, "", 0);
} else {
/* (checks also for existence of the disk file) */
ret= Xorriso_set_system_area_path(xorriso, treatpt + 12, 0);
}
if(ret <= 0)
@ -1024,6 +1167,7 @@ treatment_patch:;
xorriso->system_area_options&= ~0x4000;
if(strcmp(treatpt + 12, "/dev/zero") == 0)
xorriso->system_area_clear_loaded= 1;
is_change= 1;
} else if(strncmp(treatpt, "partition_table=", 16)==0) {
if(strcmp(treatpt + 16, "off") == 0) {
@ -1038,6 +1182,9 @@ treatment_patch:;
goto ex;
} else
was_ok= 0;
if(was_ok)
is_change= 1;
} else if(strncmp(treatpt, "partition_entry=", 16)==0) {
if(strcmp(formpt, "isolinux") != 0) {
sprintf(xorriso->info_text,
@ -1058,6 +1205,8 @@ treatment_patch:;
xorriso->patch_isolinux_image = (xorriso->patch_isolinux_image & ~0x1fc);
} else
was_ok= 0;
if(was_ok)
is_change= 1;
} else if(strncmp(treatpt, "partition_offset=", 17)==0) {
u= 0;
@ -1070,6 +1219,7 @@ treatment_patch:;
{ret= 0; goto ex;}
}
xorriso->partition_offset= u;
is_change= 1;
} else if(strncmp(treatpt, "appended_part_as=", 17) == 0) {
if(strcmp(treatpt + 17, "gpt") == 0) {
@ -1081,11 +1231,14 @@ treatment_patch:;
xorriso->appended_as_apm = 1;
} else
was_ok= 0;
if(was_ok)
is_change= 1;
} else if(strncmp(treatpt, "gpt_disk_guid=", 14) == 0) {
ret= Xorriso_parse_gpt_guid(xorriso, treatpt + 14, 0);
if(ret <= 0)
goto ex;
is_change= 1;
} else if(strncmp(treatpt, "part_like_isohybrid=", 20) == 0) {
if(strcmp(treatpt + 20, "on") == 0)
@ -1094,9 +1247,12 @@ treatment_patch:;
xorriso->part_like_isohybrid= 0;
else
was_ok= 0;
if(was_ok)
is_change= 1;
} 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) {
@ -1104,8 +1260,16 @@ treatment_patch:;
sscanf(treatpt + 20, "%x", &u);
ret= u;
} else {
sscanf(treatpt + 18, "%d", &ret);
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)",
@ -1114,6 +1278,7 @@ treatment_patch:;
{ret= 0; goto ex;}
}
xorriso->iso_mbr_part_type= ret;
is_change= 1;
} else if(strncmp(treatpt, "partition_hd_cyl=", 17)==0) {
u= 0;
@ -1125,6 +1290,7 @@ treatment_patch:;
{ret= 0; goto ex;}
}
xorriso->partition_heads_per_cyl= u;
is_change= 1;
} else if(strncmp(treatpt, "partition_sec_hd=", 17)==0) {
u= 0;
@ -1136,6 +1302,7 @@ treatment_patch:;
{ret= 0; goto ex;}
}
xorriso->partition_secs_per_head= u;
is_change= 1;
} else if(strncmp(treatpt, "partition_cyl_align=", 20)==0) {
if(strcmp(treatpt + 20, "auto") == 0)
@ -1156,6 +1323,7 @@ treatment_patch:;
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
{ret= 0; goto ex;}
}
is_change= 1;
} else if(strncmp(treatpt, "platform_id=", 12)==0) {
u= 256; /* intentionally too large */
@ -1171,6 +1339,7 @@ treatment_patch:;
{ret= 0; goto ex;}
}
xorriso->boot_platform_id= u;
is_change= 1;
} else if(strncmp(treatpt, "emul_type=", 10)==0) {
if(strcmp(treatpt + 10, "none") == 0 ||
@ -1191,6 +1360,7 @@ treatment_patch:;
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
is_change= 1;
} else if(strncmp(treatpt, "hfsplus_serial=", 15) == 0) {
ret= Hex_to_bin(treatpt + 15, 8, &bin_count, (unsigned char *) sn, 0);
@ -1206,6 +1376,7 @@ treatment_patch:;
} else {
memcpy(xorriso->hfsp_serial_number, sn, 8);
}
is_change= 1;
} else if(strncmp(treatpt, "hfsplus_block_size=", 19) == 0) {
u= 0;
@ -1220,6 +1391,7 @@ treatment_patch:;
ret= 0; goto ex;
}
xorriso->hfsp_block_size= u;
is_change= 1;
} else if(strncmp(treatpt, "apm_block_size=", 15) == 0) {
u= 0;
@ -1234,14 +1406,21 @@ treatment_patch:;
ret= 0; goto ex;
}
xorriso->apm_block_size= u;
is_change= 1;
} else if(strncmp(treatpt, "efi_boot_part=", 14) == 0) {
if(Sfile_str(xorriso->efi_boot_partition, treatpt + 14, 0) <= 0)
{ret= -1; goto ex;}
Xorriso_warn_if_not_exist(xorriso, "-boot_image ", treatment,
treatpt + 14, 1);
is_change= 1;
} else if(strncmp(treatpt, "prep_boot_part=", 15) == 0) {
if(Sfile_str(xorriso->prep_partition, treatpt + 15, 0) <= 0)
{ret= -1; goto ex;}
Xorriso_warn_if_not_exist(xorriso, "-boot_image ", treatment,
treatpt + 15, 1);
is_change= 1;
} else if(strncmp(treatpt, "chrp_boot_part=", 15) == 0) {
if(strcmp(treatpt + 15, "on") == 0) {
@ -1256,6 +1435,7 @@ treatment_patch:;
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
{ret= 0; goto ex;}
}
is_change= 1;
} else if(strncmp(treatpt, "isohybrid=", 10) == 0 &&
strcmp(formpt, "isolinux")==0) {
@ -1280,6 +1460,7 @@ treatment_patch:;
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0);
{ret= 0; goto ex;}
}
is_change= 1;
#else
@ -1303,6 +1484,7 @@ treatment_patch:;
if(strcmp(treatpt + 10, ".") == 0) {
ret= Xorriso_set_system_area_path(xorriso, "", 0);
} else {
/* (checks also for existence of the disk file) */
ret= Xorriso_set_system_area_path(xorriso, treatpt + 10, 0);
}
if(ret <= 0)
@ -1324,10 +1506,42 @@ treatment_patch:;
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
{ret= 0; goto ex;}
}
is_change= 1;
} else
} else if(strncmp(treatpt, "gpt_iso_bootable=", 17) == 0) {
if(strcmp(treatpt + 17, "off") == 0) {
xorriso->system_area_options&= ~(1 << 16);
} else if(strcmp(treatpt + 17, "on") == 0) {
xorriso->system_area_options|= (1 << 16);
} else {
sprintf(xorriso->info_text,
"-boot_image %s gpt_iso_bootable=: unknown mode : %s",
formpt, treatpt + 17);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
{ret= 0; goto ex;}
}
is_change= 1;
} else if(strncmp(treatpt, "gpt_iso_not_ro=", 15) == 0) {
if(strcmp(treatpt + 15, "off") == 0) {
xorriso->system_area_options&= ~(1 << 17);
} else if(strcmp(treatpt + 15, "on") == 0) {
xorriso->system_area_options|= (1 << 17);
} else {
sprintf(xorriso->info_text,
"-boot_image %s gpt_iso_not_ro=: unknown mode : %s",
formpt, treatpt + 15);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
{ret= 0; goto ex;}
}
is_change= 1;
} else {
was_ok= 0;
}
if(is_change)
Xorriso_set_change_pending(xorriso, 1);
if(!was_ok) {
sprintf(xorriso->info_text, "Unrecognized options with -boot_image: %s %s",
form, treatment);
@ -1728,8 +1942,9 @@ ex:;
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;
int ret, quality, pass, was_md5= 0, was_event= 0;
off_t i, count, lba, blocks;
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;
@ -1749,6 +1964,7 @@ int Xorriso_option_check_media(struct XorrisO *xorriso,
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");
@ -1761,6 +1977,12 @@ int Xorriso_option_check_media(struct XorrisO *xorriso,
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) {
@ -1795,7 +2017,7 @@ int Xorriso_option_check_media(struct XorrisO *xorriso,
if(ret <= 0)
goto ex;
if(ret == 1) {
ret= Xorriso_update_iso_lba0(xorriso, job->patch_lba0_msc1, 0,
ret= Xorriso_update_iso_lba0(xorriso, job->patch_lba0_msc1, (off_t) 0,
head_buffer, job,
(8 * (job->patch_lba0 == 1)) |
4 | (job->patch_lba0_msc1 < 0));
@ -1815,7 +2037,12 @@ int Xorriso_option_check_media(struct XorrisO *xorriso,
sprintf(xorriso->result_line,
"MD5 checks : lba , size , result\n");
}
Xorriso_result(xorriso,0);
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);
@ -1835,11 +2062,17 @@ int Xorriso_option_check_media(struct XorrisO *xorriso,
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",
sprintf(xorriso->result_line, "%s: %10.f , %10.f , %s\n",
pass == 0 ? "Media region " : "MD5 tag range",
lba, blocks, Spotlist__quality_name(quality, quality_name,
(double) lba, (double) blocks,
Spotlist__quality_name(quality, quality_name,
xorriso->check_media_bad_limit, 0));
Xorriso_result(xorriso,0);
if(to_info) {
strcpy(xorriso->info_text, xorriso->result_line);
Xorriso_info(xorriso, 0);
} else {
Xorriso_result(xorriso, 0);
}
}
}
}
@ -2135,6 +2368,7 @@ int Xorriso_option_commit(struct XorrisO *xorriso, int flag)
int ret;
char eternal_problem_status_text_mem[80];
xorriso->commit_attempts++;
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);
@ -2649,7 +2883,7 @@ int Xorriso_option_cpx(struct XorrisO *xorriso, int argc, char **argv,
/* 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, 0);
ret= Xorriso_is_split(xorriso, eff_origin, NULL, 4);
if(ret<0)
goto problem_handler;
if(ret==0) {

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2017 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -62,11 +62,11 @@ int Xorriso_option_data_cache_size(struct XorrisO *xorriso, char *num_tiles,
/** @param flag bit0= use as indev
bit1= use as outdev
bit2= do not -reassure
bit3= regard overwriteable media as blank
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 aquiring it
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)
@ -257,6 +257,43 @@ int Xorriso_option_displacement(struct XorrisO *xorriso, char *value, int flag)
}
/* 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)
@ -312,10 +349,27 @@ int Xorriso_option_dvd_obs(struct XorrisO *xorriso, char *obs, int flag)
{
double num;
if(strcmp(obs, "default") == 0)
if(strcmp(obs, "obs_pad") == 0) {
xorriso->do_obs_pad= 1;
return(1);
} else if(strcmp(obs, "no_obs_pad") == 0) {
xorriso->do_obs_pad= 0;
return(1);
} else if(strcmp(obs, "bdr_obs_exempt")== 0) {
xorriso->bdr_obs_exempt= 1;
return(1);
} else if(strcmp(obs, "no_bdr_obs_exempt")== 0) {
xorriso->bdr_obs_exempt= 0;
return(1);
} else if(strcmp(obs, "default") == 0) {
num= 0;
else
} else if(obs[0] >= '0' && obs[0] <= '9') {
num = Scanf_io_size(obs,0);
} else {
sprintf(xorriso->info_text, "-dvd_obs : Unrecognized parameter.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
return(0);
}
if(num != 0 && num != 32768 && num != 65536) {
sprintf(xorriso->info_text,
"-dvd_obs : Bad size. Acceptable are 0, 32k, 64k");
@ -610,6 +664,24 @@ ex:;
}
/* 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)
@ -763,12 +835,14 @@ static int Xorriso_truncate_const_find_name(struct XorrisO *xorriso,
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;
int ret, i, end_idx, type= 0, action, deleter= 0, count;
off_t start_lba, block_count;
int list_extattr_head= 0, bsl_mem, disk_path, name_space, prefix_code;
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;
char *arg1_pt, *namept, *suffix_pt, *value_pt, size_text[40];
off_t size_value, suffix_factor= 1;
struct stat dir_stbuf;
uid_t user= 0;
@ -846,9 +920,16 @@ 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);
ret= Sfile_text_to_off_t(argv[i - 1], &start_lba, 0);
if(ret <= 0) {
off_t_overflow:;
sprintf(xorriso->info_text, "-find[ix]: -lba_range number too large");
goto sorry_ex;
}
ret= Sfile_text_to_off_t(argv[i], &block_count, 0);
if(ret <= 0)
goto off_t_overflow;
Findjob_set_lba_range(job, start_lba, block_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) {
@ -1049,6 +1130,59 @@ not_enough_arguments:;
count, 0, 0);
if(ret <= 0)
goto ex;
} else if(strcmp(argv[i], "-size") == 0) {
if(i + 1 >= end_idx)
goto not_enough_arguments;
i++;
if(strlen(argv[i]) >= sizeof(size_text) - 1) {
sprintf(xorriso->info_text,
"-findi: Number text after -size is much too long");
goto sorry_ex;
}
strcpy(size_text, argv[i]);
value_pt= size_text;
prefix_code= 0;
if(*value_pt == 0)
goto size_value_bad;
if(*value_pt == '-') {
prefix_code= -1;
value_pt++;
} else if(*value_pt == '+') {
prefix_code= 1;
value_pt++;
}
if(*value_pt == 0)
goto size_value_bad;
if(*value_pt == '=') {
prefix_code*= 2;
value_pt++;
}
if(*value_pt == 0) {
size_value_bad:;
sprintf(xorriso->info_text,
"-findi: Number text after -size is not suitable");
}
/* Convert "find -size" suffix to Scanf_io_size suffix */
suffix_pt= value_pt + strlen(value_pt) - 1;
if(*suffix_pt == 'b' || *suffix_pt == 'B') {
*suffix_pt= 'd'; /* 512 bytes */
} else if(*suffix_pt == 'c' || *suffix_pt == 'C') {
*suffix_pt= 0; /* 1 byte */
} else if(*suffix_pt == 'w'|| *suffix_pt == 'W') {
*suffix_pt= 0; /* 2 byte */
suffix_factor= 2;
} else if(*suffix_pt >= '0' && *suffix_pt <= '9') {
suffix_pt++;
*suffix_pt= 'd'; /* 512 bytes */
*(suffix_pt + 1)= 0;
}
size_value= (off_t) Scanf_io_size(value_pt, 1) * (off_t) suffix_factor;
if(size_value < 0)
goto size_value_bad;
ret= Findjob_set_size_filter(job, 27, size_value, prefix_code, 0);
if(ret <= 0)
goto ex;
} else if(strcmp(argv[i], "-exec")==0) {
if(i+1>=end_idx) {
not_enough_exec_arguments:;
@ -1390,15 +1524,15 @@ ex:;
if(deleter && !(flag&2))
Xorriso_pacifier_callback(xorriso, "iso_rr_paths deleted",
xorriso->pacifier_count, 0, "", 1|2);
else if(first_job->action == 28 && !(flag&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->action == 35 && !(flag & 1))
if(first_job != NULL && first_job->action == 35 && !(flag & 1))
Xorriso_report_md5_outcome(xorriso, first_job->target, 0);
if(first_job->action == 40) {
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);
@ -1737,13 +1871,17 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -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\".",
" -grow_blindly \"off\"|predicted_nwa",
" Switch between modifying and blind growing.",
" -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\"|\"m/s\"|\"[x]CD\"|\"[x]DVD\"|\"[x]BD\"]",
" -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.",
" 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.",
@ -1756,7 +1894,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -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 overwriteable media with emulated TOC.",
" 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",
@ -1787,6 +1925,13 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -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.",
@ -1801,6 +1946,9 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -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_#\"",
@ -1835,6 +1983,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" 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",
@ -1858,7 +2007,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" |\"system_area=\"|\"partition_table=on|off\"",
" |\"partition_entry=\"|\"appended_part_as=\"",
" |\"part_like_isohybrid=\"|\"iso_mbr_part_type=\"",
" |\"gpt_disk_guid=\"",
" |\"gpt_disk_guid=\"|\"gpt_iso_bootable\"|\"gpt_iso_not_ro=\"",
" |\"chrp_boot_part=on|off=\"|\"prep_boot_part=\"",
" |\"efi_boot_part=\"|\"efi_boot_part=--efi-boot-image\"",
" |\"mips_path=\"|\"mipsel_path=\"|\"mips_discard\"",
@ -1901,6 +2050,10 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -toc_of \"in\"|\"out\"|\"all\"[\":short\"]",
" Show -toc of either input drive or output drive or both.",
"",
" -assess_indev_features \"plain\"|\"cmd\"|\"as_mkisofs\"|\"replay\"",
" Inspect the filesystem on -indev for features like ISO level,",
" Rock Ridge, or file name relaxations.",
"",
" -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.",
@ -1945,7 +2098,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
"",
" -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 mot contain quotation marks.",
" than 80 characters, may not contain quotation marks.",
"",
"Manipulation commands:",
"disk_path is a path to an object in the local filesystem tree.",
@ -2053,7 +2206,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -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,",
" -name_limit_blocker, -maxdepth, -mindepth, -size,",
" -prune, -decision yes|no, -true, -false",
" Operators: -not, -or, -and, -sub, (, -subend, ),",
" -if, -then, -elseif, -else, -endif",
@ -2137,6 +2290,9 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -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.",
@ -2168,8 +2324,9 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" [:\"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.",
" -dvd_obs \"default\"|\"32k\"|\"64k\"|\"obs_pad\"|\"bdr_obs_exempt\"",
" Set number of bytes per DVD/BD write operation or control",
" end alignment padding with DAO DVD-R[W] or BD-R.",
" -use_immed_bit \"on\"|\"off\"|\"default\"",
" Control whether long running SCSI commands shall run",
" asynchronously with progress messages.",
@ -2255,6 +2412,8 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" [:\"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.",
@ -2270,6 +2429,9 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -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",
@ -2318,7 +2480,7 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" -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 overwriteable media.",
" data track to blank, appendable or overwritable media.",
" -pacifier \"xorriso\"|\"cdrecord\"|\"mkisofs\"",
" Choose format of UPDATE pacifier during write operations.",
"",
@ -2446,6 +2608,14 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
" @@@ 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: <https://www.gnu.org/software/xorriso/>",
"General help using GNU software: <https://www.gnu.org/gethelp/>",
#else
"Report any bugs to bug-xorriso@gnu.org or in private to scdbackup@gmx.net .",
#endif
"",
#endif /* ! Xorriso_no_helP */
@ -2453,25 +2623,22 @@ int Xorriso_option_help(struct XorrisO *xorriso, int flag)
};
char *tpt= NULL;
int i,pass;
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(pass=0;pass<1;pass++) {
for(i=0;1;i++) {
if(pass==0)
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);
}
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);

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2015 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -29,6 +29,35 @@
#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)
{
@ -74,6 +103,22 @@ int Xorriso_option_joliet(struct XorrisO *xorriso, char *mode, int flag)
}
/* 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)
@ -1717,6 +1762,7 @@ 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;
@ -1763,7 +1809,29 @@ int Xorriso_option_osirrox(struct XorrisO *xorriso, char *mode, int flag)
xorriso->do_strict_acl|= 1;
else if(strncmp(cpt, "strict_acl_off", l)==0 && l >= 14)
xorriso->do_strict_acl&= ~1;
else {
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);

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2017 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -143,12 +143,15 @@ int Xorriso_option_paste_in(struct XorrisO *xorriso, char *iso_rr_path,
}
bytecount= num;
sprintf(xorriso->info_text, "-paste_in from %s to %s, byte %.f to %.f",
disk_path, iso_rr_path,
iso_rr_path, disk_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);
}
@ -218,8 +221,7 @@ ex:;
xorriso->allow_graft_points= allow_graft_points_mem;
Sfile_make_argv("", "", &argc, &argv, 2);
Xorriso_free_meM(pathspec);
if(flag & 1)
Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2);
Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2);
if(fp != NULL && fp != stdin)
fclose(fp);
@ -303,9 +305,9 @@ int Xorriso_option_print(struct XorrisO *xorriso, char *text, int flag)
maxl= sizeof(xorriso->mark_text);
else
maxl= sizeof(xorriso->result_line);
if(l >= maxl) {
if(l > maxl - 2) {
sprintf(xorriso->info_text, "Output text too long for -print%s(%d > %d)",
mode == 1 ? "_info" : mode == 2 ? "_mark" : "", l, maxl);
mode == 1 ? "_info" : mode == 2 ? "_mark" : "", l, maxl - 2);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
return(0);
}
@ -331,8 +333,10 @@ int Xorriso_option_print(struct XorrisO *xorriso, char *text, int flag)
*/
int Xorriso_option_print_size(struct XorrisO *xorriso, int flag)
{
int ret, fd;
int fd;
off_t ret;
xorriso->print_size_attempts++;
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);
@ -349,7 +353,7 @@ int Xorriso_option_print_size(struct XorrisO *xorriso, int flag)
return(0);
}
if(flag&1) {
sprintf(xorriso->result_line,"%d\n", ret);
sprintf(xorriso->result_line,"%.f\n", (double) ret);
if(xorriso->packet_output) {
Xorriso_result(xorriso,0);
} else {
@ -361,7 +365,7 @@ int Xorriso_option_print_size(struct XorrisO *xorriso, int flag)
fsync(fd);
}
} else {
sprintf(xorriso->result_line,"Image size : %ds\n", ret);
sprintf(xorriso->result_line,"Image size : %.fs\n", (double) ret);
Xorriso_result(xorriso,0);
}
return(1);
@ -694,7 +698,7 @@ int Xorriso_option_rollback(struct XorrisO *xorriso, int flag)
ret= Xorriso_give_up_drive(xorriso, 1|8);
if(ret<=0)
goto ex;
xorriso->image_start_mode&= ~(1<<31); /* reactivate eventual -load address */
xorriso->image_start_mode&= ~(1u<<31); /* reactivate eventual -load address */
ret= Xorriso_option_dev(xorriso, indev, 1|4);
ex:;
Xorriso_free_meM(indev);
@ -831,12 +835,13 @@ int Xorriso_option_session_log(struct XorrisO *xorriso, char *path, int flag)
int Xorriso_option_setfacl_listi(struct XorrisO *xorriso, char *path, int flag)
{
int ret, eaten, line_size;
size_t buf_size= 0, buf_add= 64 * 1024, l, linecount= 0;
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);
@ -923,11 +928,13 @@ int Xorriso_option_setfacl_listi(struct XorrisO *xorriso, char *path, int flag)
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';
@ -989,9 +996,11 @@ int Xorriso_option_setfacli(struct XorrisO *xorriso, char *acl_text,
ret= Xorriso_normalize_acl_text(xorriso, acl_text,
&access_acl_text, &default_acl_text, 0);
if(access_acl_text != NULL && default_acl_text != NULL) {
sprintf(xorriso->info_text, "Access-ACL :\n%s", access_acl_text);
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);
sprintf(xorriso->info_text, "Default-ACL :\n%s", default_acl_text);
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");
@ -1404,12 +1413,31 @@ int Xorriso_option_sleep(struct XorrisO *xorriso, char *duration, int flag)
/* Commands -speed , -read_speed */
/* @param flag bit0= -read_speed rather than -speed
*/
int Xorriso_option_speed(struct XorrisO *xorriso, char *speed, int flag)
int Xorriso_option_speed(struct XorrisO *xorriso, char *speed_in, int flag)
{
int is_cd= 1, unit_found= 0, ret, profile_number, intspeed= 1;
int is_cd= 1, unit_found= 0, ret, profile_number, intspeed= 1, for_force= 0;
double num= -2.0;
char *cpt, profile_name[80];
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) {
@ -1421,13 +1449,8 @@ int Xorriso_option_speed(struct XorrisO *xorriso, char *speed, int flag)
if(num <= 0)
intspeed= num;
}
if(intspeed <= 0) {
if(flag & 1)
xorriso->read_speed= intspeed;
else
xorriso->write_speed= intspeed;
return(1);
}
if(intspeed <= 0)
goto set_speed_and_exit;
for(cpt= speed+strlen(speed)-1; cpt>=speed; cpt--)
if(isdigit(*cpt) || *cpt=='.')
@ -1468,17 +1491,24 @@ bd_speed:;
if(num> 2.0e9) {
sprintf(xorriso->info_text,
"-speed: Value too large or not recognizable: '%s'", speed);
"%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++;
if(flag & 1)
xorriso->read_speed= intspeed;
else
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);
}
@ -1529,18 +1559,18 @@ int Xorriso_option_status_history_max(struct XorrisO *xorriso, int num,
/* Option -stdio_sync "on"|"off"|"end"|size */
int Xorriso_option_stdio_sync(struct XorrisO *xorriso, char *rythm, int flag)
int Xorriso_option_stdio_sync(struct XorrisO *xorriso, char *rhythm, int flag)
{
double num;
if(strcmp(rythm, "default") == 0 || strcmp(rythm, "on") == 0) {
if(strcmp(rhythm, "default") == 0 || strcmp(rhythm, "on") == 0) {
num= 0;
} else if(strcmp(rythm, "off") == 0) {
} else if(strcmp(rhythm, "off") == 0) {
num= -1;
} else if(strcmp(rythm, "end") == 0) {
} else if(strcmp(rhythm, "end") == 0) {
num= 1;
} else {
num = Scanf_io_size(rythm, 0) / 2048;
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\"");
@ -1594,7 +1624,8 @@ int Xorriso_option_system_id(struct XorrisO *xorriso, char *name, int flag)
/* Option -tell_media_space */
int Xorriso_option_tell_media_space(struct XorrisO *xorriso, int flag)
{
int ret, free_space= 0, media_space= 0;
int ret;
off_t free_space= 0, media_space= 0;
ret= Xorriso_tell_media_space(xorriso, &media_space, &free_space, 0);
if(ret<=0) {
@ -1607,9 +1638,9 @@ int Xorriso_option_tell_media_space(struct XorrisO *xorriso, int flag)
"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);
sprintf(xorriso->result_line, "Media space : %.fs\n", (double) media_space);
Xorriso_result(xorriso, 0);
sprintf(xorriso->result_line, "After commit : %ds\n", free_space);
sprintf(xorriso->result_line, "After commit : %.fs\n", (double) free_space);
Xorriso_result(xorriso, 0);
return(1);
}
@ -1699,6 +1730,18 @@ int Xorriso_option_toc_of(struct XorrisO *xorriso, char *which, int flag)
}
/* 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)
{
@ -1989,7 +2032,7 @@ int Xorriso_option_version(struct XorrisO *xorriso, int flag)
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) 2017, Thomas Schmitt <scdbackup@gmx.net>, libburnia project.\n");
"Copyright (C) 2023, Thomas Schmitt <scdbackup@gmx.net>, libburnia project.\n");
Xorriso_result(xorriso, 0);
sprintf(xorriso->result_line,
"xorriso version : %d.%d.%d%s\n",
@ -2043,6 +2086,8 @@ int Xorriso_option_version(struct XorrisO *xorriso, int flag)
int Xorriso_option_volid(struct XorrisO *xorriso, char *volid, int flag)
{
int warn_shell= 0, warn_ecma= 0, i, ret;
char *result= NULL;
size_t result_len= 0;
static char shell_chars[]= {
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-+=:.,~@"};
static char ecma_chars[]= {"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"};
@ -2064,9 +2109,20 @@ int Xorriso_option_volid(struct XorrisO *xorriso, char *volid, int flag)
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);
ret= Xorriso_conv_name_chars(xorriso, volid, &result, &result_len, 2, 0);
if(result != NULL)
free(result); /* just want the result_len */
xorriso->info_text[0]= 0;
if(ret <= 0) {
sprintf(xorriso->info_text,
"Cannot determine length of -volid text in Joliet character set");
} else if(result_len > 32) {
sprintf(xorriso->info_text,
"-volid text is too long for Joliet (%d > 16)",
(int) (result_len + 1) / 2);
}
if(xorriso->info_text[0])
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
}
if(warn_ecma && !(flag & 1)) {
sprintf(xorriso->info_text,
@ -2211,12 +2267,23 @@ int Xorriso_option_xattr(struct XorrisO *xorriso, char *mode, int flag)
/* Option -zisofs */
int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag)
{
int was_level, was_blocksize, ret, l;
double num;
char *cpt, *npt, text[16];
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,':');
@ -2240,16 +2307,13 @@ int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag)
} 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, "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) {
num= 0.0;
if(l > 11 && l < 27) {
strncpy(text, cpt + 11, l - 11);
text[l - 11]= 0;
num= Scanf_io_size(text, 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)");
@ -2257,16 +2321,111 @@ int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag)
}
xorriso->zisofs_block_size= num;
} else if(strncmp(cpt, "by_magic=", 8)==0) {
if(strncmp(cpt + 9, "on", l - 9) == 0)
} else if(strncmp(cpt, "by_magic=", 9)==0) {
if(strncmp(cpt + 9, "on", l - 9) == 0) {
xorriso->zisofs_by_magic= 1;
else
} 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:;
@ -2278,10 +2437,24 @@ 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= Xorriso_set_zisofs_params(xorriso, 0);
ret= 1;
if(set_isofs_params)
ret= Xorriso_set_zisofs_params(xorriso, 1);
return(ret);
}

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2017 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2022 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -97,7 +97,7 @@ int Xorriso_opt_args(struct XorrisO *xorriso, char *cmd,
else
do_expand= (xorriso->do_iso_rr_pattern==1 && !(flag&4)) || (flag & 512);
if(flag&256) {
if(*optv < argv || (*optv >= argv + argc && argc > 0))
if(argv == NULL || *optv < argv || (*optv >= argv + argc && argc > 0))
Sfile_destroy_argv(optc, optv, 0);
return(1);
}
@ -121,6 +121,7 @@ int Xorriso_opt_args(struct XorrisO *xorriso, char *cmd,
*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++) {
@ -153,7 +154,7 @@ no_memory:;
}
if(nump<=0) { /* Only empty texts. May the caller get happy with them. */
free(patterns);
return(1);
goto copy_args;
}
if(flag&2)
ret= Xorriso_expand_disk_pattern(xorriso, nump, patterns, was_empty,
@ -534,16 +535,17 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
};
static char arg1_commands[][40]= {
"abort_on","acl","add_plainly","application_id","application_use",
"auto_charset","abstract_file",
"auto_charset","abstract_file","assess_indev_features",
"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",
"dummy","dvd_obs","early_stdio_test","ecma119_map","eject",
"iso_rr_pattern","file_name_limit","follow","format","fs",
"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",
"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",
@ -554,7 +556,8 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
"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",
"session_log","setfattr_list","setfattr_listi",
"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",
@ -572,7 +575,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
""
};
static char arg3_commands[][40]= {
"append_partition",
"append_partition", "truncate_overwritable",
""
};
static char arg4_commands[][40]= {
@ -596,7 +599,7 @@ int Xorriso_count_args(struct XorrisO *xorriso, int argc, char **argv,
"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",
"setfattr_r","setfattr_ri",
"set_filter","set_filter_r","show_stream","show_stream_r",
""
};
@ -683,18 +686,21 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
"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",
"drive_class", "assert_volid", "in_charset",
"assert_volid", "in_charset",
"auto_charset", "hardlinks", "acl", "xattr", "md5", "for_backup",
"ecma119_map",
"ecma119_map", "joliet_map",
"disk_dev_ino", "rom_toc_scan", "calm_drive", "ban_stdio_write",
"early_stdio_test", "data_cache_size",
"scsi_dev_family",
"data_cache_size",
"scsi_dev_family", "iso_nowtime",
"* Character sets:",
"charset", "local_charset",
@ -705,6 +711,7 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
"* Drive and media related inquiry actions (2):",
"list_profiles", "list_formats", "list_speeds",
"toc", "toc_of", "pvd_info", "report_system_area", "report_el_torito",
"assess_indev_features",
"* Settings for file insertion:",
"file_name_limit", "file_size_limit",
@ -744,6 +751,7 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
"* 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",
@ -774,7 +782,7 @@ int Xorriso_cmd_sorting_rank(struct XorrisO *xorriso,
"print_size", "tell_media_space",
"* Writing the result, drive control:",
"format", "blank", "close_damaged",
"format", "blank", "truncate_overwritable", "close_damaged",
"rollback", "changes_pending", "commit", "commit_eject",
"eject",
@ -1076,6 +1084,10 @@ next_command:;
(*idx)+= 2;
ret= Xorriso_option_assert_volid(xorriso, arg1, arg2, 0);
} else if(strcmp(cmd,"assess_indev_features")==0) {
(*idx)++;
ret= Xorriso_option_assess_indev_features(xorriso, arg1, 0);
} else if(strcmp(cmd,"auto_charset")==0) {
(*idx)++;
ret= Xorriso_option_auto_charset(xorriso, arg1, 0);
@ -1254,6 +1266,10 @@ next_command:;
(*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);
@ -1308,11 +1324,22 @@ next_command:;
(*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 so_rr_path");
"-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
@ -1406,6 +1433,10 @@ next_command:;
(*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);
@ -1418,6 +1449,10 @@ next_command:;
(*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);
@ -1917,7 +1952,7 @@ if (0) {
fprintf(stderr, " stop\n");
fprintf(stderr, " perform Xorriso_stop_msg_watcher()\n");
} else {
fprintf(stderr, "xorriso -test: unknwon mode: %s\n", arg1);
fprintf(stderr, "xorriso -test: unknown mode: %s\n", arg1);
}
ret= 0;
}
@ -1929,6 +1964,10 @@ if (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);
@ -2288,7 +2327,7 @@ int Xorriso_prescan_args(struct XorrisO *xorriso, int argc, char **argv,
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;
@ -2574,7 +2613,10 @@ ex:;
*/
int Xorriso_source_date_epoch(struct XorrisO *xorriso, int flag)
{
char *sec_text, double_text[40];
/* 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;
@ -2584,10 +2626,10 @@ int Xorriso_source_date_epoch(struct XorrisO *xorriso, int flag)
return(2);
sscanf(sec_text, "%lf", &dsec);
sprintf(double_text, "%.f", dsec);
sprintf(num_text, "%.f", dsec);
tsec= dsec;
if(dsec < 0 || ((double) tsec) != dsec ||
strcmp(sec_text, double_text) != 0) {
strcmp(sec_text, num_text) != 0) {
malformed:;
Xorriso_msgs_submit(xorriso, 0,
"Malformed environment variable SOURCE_DATE_EPOCH encountered",
@ -2600,11 +2642,21 @@ malformed:;
gmt= gmtime(&tsec);
if(gmt == NULL)
goto malformed;
sprintf(xorriso->vol_uuid, "%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d00",
1900 + gmt->tm_year, gmt->tm_mon + 1, gmt->tm_mday,
gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
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);
@ -2617,8 +2669,12 @@ malformed:;
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 volume_date_uuid");
"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);
}
@ -3076,28 +3132,43 @@ int Xorriso_pipe_open(struct XorrisO *xorriso, char *purpose, char *cmd,
/* @param flag bit0= path is a command parameter
bit1= prepend xorriso->wdx if path is relative
bit2= do not issue note about excluded parameter
*/
int Xorriso_path_is_excluded(struct XorrisO *xorriso, char *path, int flag)
{
int ret;
char *path_pt, *local_path_mem= NULL;
if(!(xorriso->disk_excl_mode&1)) /* exclusion is off */
return(0);
{ret= 0; goto ex;}
if((flag&1) && !(xorriso->disk_excl_mode&2)) /* params are exempted */
return(0);
ret= Exclusions_match(xorriso->disk_exclusions, path,
{ret= 0; goto ex;}
path_pt= path;
if((flag & 2) && path[0] != '/' && path[0] != 0) {
Xorriso_alloc_meM(local_path_mem, char,
strlen(xorriso->wdx) + 1 + strlen(path) + 1);
strcpy(local_path_mem, xorriso->wdx);
strcat(local_path_mem, "/");
strcat(local_path_mem, path);
path_pt= local_path_mem;
}
ret= Exclusions_match(xorriso->disk_exclusions, path_pt,
!!(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)) {
if(ret > 0 && (flag & 1) && !(flag & 4)) {
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);
}
ex:;
Xorriso_free_meM(local_path_mem);
return(ret);
}

View File

@ -2,7 +2,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2015 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -41,6 +41,7 @@
#include "iso_manip.h"
#include "read_run.h"
#include "sort_cmp.h"
#include "disk_ops.h"
int Xorriso__read_pacifier(IsoImage *image, IsoFileSource *filesource)
@ -199,7 +200,7 @@ int Xorriso_restore_is_identical(struct XorrisO *xorriso, void *in_node,
IsoImage *volume;
IsoNode *node;
struct stat stbuf;
int dummy;
off_t dummy;
memset(type_text, 0, 5);
if(!Xorriso_change_is_pending(xorriso, 0))
@ -533,6 +534,278 @@ ex:;
}
/* 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
@ -552,7 +825,7 @@ int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node,
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 *buf= NULL, type_text[5], *temp_path= NULL, *buf_pt, *reason;
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;
@ -564,11 +837,17 @@ int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node,
IsoBoot *bootcat;
uint32_t lba;
char *catcontent = NULL;
off_t catsize;
off_t catsize, iso_node_size, wanted_size, cap;
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);
@ -583,19 +862,55 @@ int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node,
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;
if(ret != -1) {
wanted_size= disk_offset + bytes;
iso_node_size= iso_file_get_size((IsoFile *) node);
if(wanted_size > disk_offset + iso_node_size)
wanted_size= disk_offset + iso_node_size;
cap= wanted_size;
ret= Xorriso_determine_capacity(xorriso, open_path_pt, &cap, &reason,
3);
if(ret <= 0 || (cap <= 0 && !S_ISREG(stbuf.st_mode))) {
if(ret > 0)
reason= "has addressable range 0";
sprintf(xorriso->info_text,
"Restore offset demanded. But target file (%s) ",
Ftypetxt(stbuf.st_mode, 0));
Text_shellsafe(disk_path, xorriso->info_text, 1);
strcat(xorriso->info_text, reason);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE",0); l_errno= 0;
goto cannot_restore;
}
if(cap < wanted_size && !S_ISREG(stbuf.st_mode)) {
/* >>> non-regular file might be too small to take the interval */;
}
}
} else {
/* If source and target are the same disk file then do not copy content */
@ -655,6 +970,9 @@ int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node,
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)
@ -696,6 +1014,8 @@ int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node,
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 */
@ -705,7 +1025,11 @@ int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node,
ret= read_count - img_offset;
}
wret= write(write_fd, buf_pt, ret);
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;
@ -724,9 +1048,35 @@ int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node,
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, errno, "FAILURE",0);
break;
}
}
if(write_fd != -1)
}
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);
@ -749,6 +1099,12 @@ int Xorriso_tree_restore_node(struct XorrisO *xorriso, IsoNode *node,
}
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";
@ -847,6 +1203,10 @@ ex:;
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);
}
@ -1036,6 +1396,7 @@ int Xorriso_register_node_target(struct XorrisO *xorriso, int node_idx,
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
bit10= do not restore properties
@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
@ -1046,7 +1407,7 @@ int Xorriso_restore_disk_object(struct XorrisO *xorriso,
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;
int record_hl_path= 0, node_idx, cannot_register= 0, no_props;
off_t total_bytes;
char *part_name, *part_path= NULL, *img_path_pt= NULL;
IsoImage *volume;
@ -1056,13 +1417,15 @@ int Xorriso_restore_disk_object(struct XorrisO *xorriso,
Xorriso_alloc_meM(part_path, char, SfileadrL);
no_props= !!(flag & 1024);
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|2);
&split_parts, &split_count, &stbuf, 1 | 4);
if(leaf_is_split) {
/* map all files in directory img_path into regular file disk_path */
@ -1090,7 +1453,7 @@ int Xorriso_restore_disk_object(struct XorrisO *xorriso,
if(ret == 4)
goto ex;
}
if(first_part_node!=NULL)
if(first_part_node != NULL && !no_props)
Xorriso_restore_properties(xorriso, disk_path, first_part_node,
!!(flag&64));
goto went_well;
@ -1132,10 +1495,11 @@ int Xorriso_restore_disk_object(struct XorrisO *xorriso,
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)));
(flag&(4 | 8 | 128)) | (!!(flag&64)) | ((flag&1)<<1) | ( 16 * !(flag&2))
| (no_props << 3));
if(ret == 4)
goto ex;
if(ret>0 && (flag&8))
if(ret > 0 && (flag & 8) && !no_props)
ret= Xorriso_restore_properties(xorriso, disk_path, node, 2 | !!(flag&64));
if(ret<=0) {
restoring_failed:;
@ -1249,7 +1613,6 @@ ex:;
/* @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,
@ -1389,9 +1752,14 @@ much_too_long:;
{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 */
/* name and disk_name are pointers into img_path and disk_path */
strcpy(name, leaf_name);
strcpy(disk_name, leaf_name);
ret= Xorriso_path_is_excluded(xorriso, disk_path, 2);
if(ret < 0)
goto was_problem;
if(ret > 0)
continue;
stbuf_src= srcpt;
ret= Xorriso_fake_stbuf(xorriso, img_path, &stbuf, &node, 1);
@ -1437,7 +1805,7 @@ much_too_long:;
source_is_dir= 1;
source_is_split= 0;
if(source_is_dir)
source_is_split= Xorriso_is_split(xorriso, img_path, node, 1|2);
source_is_split= Xorriso_is_split(xorriso, img_path, node, 1 | 2 | 4);
if(source_is_split)
do_not_dive= 1;
@ -1469,6 +1837,8 @@ much_too_long:;
} else {
ret= Xorriso_restore_disk_object(xorriso, img_path, node, disk_path,
(off_t) 0, (off_t) 0, hflag);
if(ret == 3) /* intentionally not restored */
do_not_dive= 1;
}
if(ret<=0)
goto was_problem;
@ -1509,7 +1879,7 @@ ex:
if(link_target!=NULL)
free(link_target);
Xorriso_findi_iter(xorriso, dir, &mem, &iter, &node_array, &node_count,
&node_idx, &node, (1<<31));
&node_idx, &node, (1u<<31));
Xorriso_process_msg_queues(xorriso,0);
@ -1543,6 +1913,7 @@ ex:
3= count nodes in xorriso->node_counter,
create no directory
bit9= with operation mode 1 do net register prefixes
bit10= with bit3: do not restore properties to leaf file
@return <=0 = error , 1 = added leaf file object , 2 = added directory ,
3 = rejected
*/
@ -1555,7 +1926,7 @@ int Xorriso_restore(struct XorrisO *xorriso,
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;
int leaf_is_split= 0, source_is_split= 0, new_dir_made= 0, no_props;
struct stat stbuf;
struct PermiteM *perm_stack_mem;
@ -1569,6 +1940,7 @@ int Xorriso_restore(struct XorrisO *xorriso,
break; case 2: node_register= 1;
break; case 3: node_count= 1;
}
no_props= (!!(flag & 8)) * (flag & 1024);
if(dir_create && !(flag & (1 << 9))) {
ret= Xorriso_lst_append_binary(&(xorriso->node_disk_prefixes),
@ -1581,11 +1953,18 @@ int Xorriso_restore(struct XorrisO *xorriso,
goto ex;
}
ret= Xorriso_path_is_excluded(xorriso, disk_path, !(flag&4));
if(ret<0)
goto ex;
if(ret>0)
ret= Xorriso_path_is_excluded(xorriso, disk_path, 4 | 2 | !(flag & 4));
if(ret < 0)
{ret= 0; goto ex;}
if(ret > 0) {
if(!(flag & 4)) {
strcpy(xorriso->info_text,
"Excluded from restoring by -not_path or -not_leaf :");
Text_shellsafe(disk_path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
}
{ret= 3*!!(flag&16); goto ex;}
}
ret= Xorriso_get_volume(xorriso, &volume, 0);
if(ret<=0)
@ -1627,7 +2006,7 @@ int Xorriso_restore(struct XorrisO *xorriso,
ret= 0; goto ex;
}
if(is_dir && xorriso->do_concat_split)
leaf_is_split= Xorriso_is_split(xorriso, img_path, node, 1|2);
leaf_is_split= Xorriso_is_split(xorriso, img_path, node, 1 | 2 | 4);
}
for(npt= apt; !done; apt= npt+1) {
npt= strchr(apt, '/');
@ -1650,7 +2029,7 @@ int Xorriso_restore(struct XorrisO *xorriso,
if((flag&8) && done) {
/* ??? move down from Xorriso_paste_in() :
check whether target does not exist or both are regular */;
check whether target does not exist or both are suitable */;
} else if(source_is_dir || !(dir_create || node_count || node_register)) {
ret= Xorriso_handle_collision(xorriso, node, img_path, path, disk_path,
@ -1723,7 +2102,7 @@ attach_source:;
}
} else {
ret= Xorriso_restore_disk_object(xorriso, img_path, node, path,
offset, bytes, (flag & (2|4|64)) | !!(flag&8));
offset, bytes, (flag & (2|4|64)) | no_props | !!(flag&8));
if(ret <= 0) {
hret= Xorriso_eval_problem_status(xorriso, ret, 1 | 2);
if(hret < 0)
@ -1784,7 +2163,11 @@ int Xorriso_restore_node_array(struct XorrisO *xorriso, int flag)
img_path, disk_path, hflag);
if(ret<=0)
goto was_problem;
/* (Exclusion must already be handled when the node array gets filled,
because of no distinction between parameter and tree passenger here.)
*/
ret= Xorriso_handle_collision(xorriso, node, img_path, disk_path, disk_path,
&stbuf_ret, 64);
if(ret<=0 || ret==3)
@ -1859,9 +2242,10 @@ ex:;
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;
int ret, no_props= 0;
off_t wanted_size, cap;
char *eff_source= NULL, *eff_dest= NULL, *reason;
struct stat stbuf, disk_stbuf;
IsoNode *node;
Xorriso_alloc_meM(eff_source, char, SfileadrL);
@ -1871,18 +2255,15 @@ int Xorriso_paste_in(struct XorrisO *xorriso, char *disk_path,
2|4);
if(ret<=0)
goto ex;
ret= Xorriso_path_is_excluded(xorriso, disk_path, !(flag&1));
ret= Xorriso_path_is_excluded(xorriso, disk_path, 4 | 2 | !(flag & 1));
if(ret > 0 && !(flag & 1)) {
strcpy(xorriso->info_text,
"Excluded from restoring by -not_path or -not_leaf :");
Text_shellsafe(disk_path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
}
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);
@ -1900,9 +2281,37 @@ int Xorriso_paste_in(struct XorrisO *xorriso, char *disk_path,
{ret= 0; goto ex;}
}
/* >>> eventually obtain parameters from file name */;
/* >>> ??? flag bit to obtain startbyte and bytecount from file name */;
ret= Xorriso_restore(xorriso, eff_source, eff_dest, startbyte, bytecount, 8);
ret= lstat(eff_dest, &disk_stbuf);
if(ret != -1) {
no_props= 1 << 10;
wanted_size= startbyte + bytecount;
if(wanted_size > stbuf.st_size)
wanted_size= stbuf.st_size;
cap= wanted_size;
ret= Xorriso_determine_capacity(xorriso, eff_dest, &cap, &reason, 3);
if(ret <= 0 || (cap <= 0 && !S_ISREG(disk_stbuf.st_mode))) {
Xorriso_msgs_submit(xorriso, 0, eff_dest, 0, "ERRFILE", 0);
if(ret > 0)
reason= "has addressable range 0";
sprintf(xorriso->info_text, "-paste_in: DISK file (%s) ",
Ftypetxt(disk_stbuf.st_mode, 0));
Text_shellsafe(eff_dest, xorriso->info_text, 1);
sprintf(xorriso->info_text + strlen(xorriso->info_text),
" exists but %s", reason);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
if(cap < wanted_size && !S_ISREG(disk_stbuf.st_mode)) {
/* >>> non-regular file might be too small to take the interval */;
}
}
ret= Xorriso_restore(xorriso, eff_source, eff_dest, startbyte, bytecount,
8 | no_props);
ex:;
Xorriso_free_meM(eff_source);
Xorriso_free_meM(eff_dest);
@ -1937,13 +2346,16 @@ int Xorriso_extract_cut(struct XorrisO *xorriso,
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= Xorriso_path_is_excluded(xorriso, eff_disk_path, 1 | 2 | 4);
if(ret < 0)
goto ex;
if(ret > 0) {
strcpy(xorriso->info_text,
"Excluded from restoring by -not_path or -not_leaf :");
Text_shellsafe(eff_disk_path, xorriso->info_text, 1);
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "SORRY", 0);
{ret= 0; goto ex;}
}
/* If it is a non-filtered stream from the ISO image
and img_offset is a multiple of 2048
@ -1957,6 +2369,13 @@ int Xorriso_extract_cut(struct XorrisO *xorriso,
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
}
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;}
Xorriso_pacifier_reset(xorriso, 0);
mem_lut= xorriso->last_update_time;
read_raw= 0;
if((img_offset % 2048) == 0) {
ret= Xorriso_is_plain_image_file(xorriso, node, "", 0);
@ -1990,15 +2409,19 @@ ex:;
}
/* @param flag bit1= for Xorriso_check_interval(): no pacifier messages
/* @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 ret, i, lba_count= 0, read_chunk= 16;
int quality, bad_extract= 0;
off_t lba, count, blocks, spot, *start_lbas= NULL, *end_lbas= NULL;
int data_to_skip= 0;
off_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;
@ -2006,25 +2429,33 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
struct CheckmediajoB *job= NULL;
upto_file_bytes= img_offset + bytes;
data_to_skip= img_offset % (off_t) 2048;
/* >>> make Xorriso_check_interval() ready for copying in byte granularity */
if(img_offset % (off_t) 2048) {
sprintf(xorriso->info_text,
"Image address offset is not a multiple of 2048");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
ret= 0; goto ex;
}
ret= Xorriso__start_end_lbas(node, &lba_count, &start_lbas, &end_lbas,
&section_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(flag & 1) {
lba_count= 1;
Xorriso_alloc_meM(start_lbas, off_t, 1);
Xorriso_alloc_meM(end_lbas, off_t, 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]= 0x7ffffffffffffffe;
size= end_lbas[0] * (off_t) 2048;
section_sizes[0]= size;
} else {
ret= Xorriso__start_end_lbas(node, &lba_count, &start_lbas, &end_lbas,
&section_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;
@ -2051,7 +2482,7 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
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;
new_file_base_bytes= file_base_bytes + count * (off_t) 2048;
/* skip intervals before img_offset */
if(new_file_base_bytes <= img_offset) {
@ -2059,7 +2490,7 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
continue;
}
/* Eventually adjust first interval start */
img_adr= ((off_t) lba) * (off_t) 2048;
img_adr= lba * (off_t) 2048;
if(file_base_bytes < img_offset) {
img_adr+= img_offset - file_base_bytes;
lba= img_adr / (off_t) 2048;
@ -2067,14 +2498,15 @@ int Xorriso_read_file_data(struct XorrisO *xorriso, IsoNode *node,
file_base_bytes= img_offset;
}
/* Eventually omit surplus blocks */
/* 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;
file_processed_bytes+= ((off_t) count) * (off_t) 2048;
job->data_to_skip= data_to_skip;
data_to_skip= 0;
file_processed_bytes+= count * (off_t) 2048;
ret= Xorriso_check_interval(xorriso, spotlist, job, lba, count, read_chunk,
0, (flag & 2));
if(ret <= 0)
@ -2129,6 +2561,103 @@ ex:;
}
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

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2014 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -330,7 +330,7 @@ char *Sfile_datestr(time_t tim, short int flag)
int Sfile_scale(double value, char *result, int siz, double thresh, int flag)
/*
bit0= eventually ommit 'b'
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)
*/
@ -430,6 +430,32 @@ int Sfile_off_t_text(char text[80], off_t num, int flag)
}
/* @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
@ -807,7 +833,7 @@ int Sfile_make_argv(char *progname, char *line, int *argc, char ***argv,
/* @param flag bit0= append */
int Sfile_str(char target[SfileadrL], char *source, int flag)
int Sfile_str(char *target, char *source, int flag)
{
int l;

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2014 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2020 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -27,13 +27,14 @@
#define Xorriso_free_meM(pt) { \
if(pt != NULL) \
free((char *) pt); \
pt= NULL; \
}
#define SfileadrL 4096
int Sfile_str(char target[SfileadrL], char *source, int flag);
int Sfile_str(char *target, char *source, int flag);
double Sfile_microtime(int flag);
@ -105,6 +106,7 @@ int Sfile_sep_make_argv(char *progname, char *line, char *separators,
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);

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2016 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -105,7 +105,7 @@ int Xorriso__search_node(void *node_array[], int n,
break;
p+= l;
/* NULL elements may indicate invalid nodes. Their first valid right neigbor
/* 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++)
@ -308,7 +308,7 @@ int Xorriso_search_di_range(struct XorrisO *xorriso, IsoNode *node,
int Xorriso__node_lba_cmp(const void *node1, const void *node2)
{
int ret;
int lba1= 0, lba2= 0;
off_t lba1= 0, lba2= 0;
ret= Xorriso__file_start_lba(*((IsoNode **) node1), &lba1, 0);
if(ret!=1)
@ -316,7 +316,11 @@ int Xorriso__node_lba_cmp(const void *node1, const void *node2)
ret= Xorriso__file_start_lba(*((IsoNode **) node2), &lba2, 0);
if(ret!=1)
lba2= 0;
return(lba1-lba2);
if(lba1 > lba2)
return(1);
if(lba1 < lba2)
return(-1);
return(0);
}

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2016 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -725,8 +725,11 @@ int Xorriso_read_lines(struct XorrisO *xorriso, FILE *fp, int *linecount,
if(*argv == NULL)
{ret= -1; goto ex;}
(*argv)[0]= strdup(line);
if((*argv)[0] == NULL)
if((*argv)[0] == NULL) {
free(*argv);
(*argv)= NULL;
{ret= -1; goto ex;}
}
*argc= 1;
}
ret= 1;
@ -2055,6 +2058,8 @@ int Xorriso_sieve_big(struct XorrisO *xorriso, int flag)
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},
@ -2079,6 +2084,8 @@ int Xorriso_sieve_big(struct XorrisO *xorriso, int flag)
10000, 1},
{"Image size :", 3, "Image size :", "", 1, { 0, -1, -1, -1, -1, -1},
1, 0},
{"Indev feature:", 3, "Indev feature:", "= ", 2, { 0, 1, -1, -1, -1, -1},
10000, 1},
{"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},
@ -2109,6 +2116,8 @@ int Xorriso_sieve_big(struct XorrisO *xorriso, int flag)
2, 0},
{"Modif. Time :", 3, "Modif. Time : ", "", 1, { 0, -1, -1, -1, -1, -1},
1, 1},
{"Overburnt by :", 3, "Overburnt by :", "", 1, { 0, -1, -1, -1, -1, -1},
2, 0},
{"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},
@ -2657,9 +2666,9 @@ int Xorriso_write_session_log(struct XorrisO *xorriso, int flag)
*(wpt++)= *rpt;
}
*wpt= 0;
fprintf(fp, "%s %d %d %s\n",
Ftimetxt(time(0), timetext, 2), xorriso->session_lba,
xorriso->session_blocks, sfe);
fprintf(fp, "%s %.f %.f %s\n",
Ftimetxt(time(0), timetext, 2), (double) xorriso->session_lba,
(double) xorriso->session_blocks, sfe);
fclose(fp);
ret= 1;
ex:;
@ -2768,6 +2777,7 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
{
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;
@ -2909,7 +2919,7 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (xorriso->img_read_error_mode==2);
is_default= (xorriso->img_read_error_mode == 1);
treatment= "best_effort";
if(xorriso->img_read_error_mode==1)
treatment= "failure";
@ -2984,16 +2994,30 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(xorriso->allow_restore == -1)
sprintf(line,"-osirrox %s\n", mode_pt);
else
sprintf(line,"-osirrox %s:%s:%s:%s:%s:%s\n", mode_pt,
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",
(xorriso->do_strict_acl & 1) ? "strict_acl_on" : "strict_acl_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)) == 64 &&
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");
@ -3043,6 +3067,18 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= ((xorriso->system_area_options & (1 << 16)) == 0);
sprintf(line, "-boot_image any gpt_iso_bootable=%s\n",
(xorriso->system_area_options & (1 << 16)) ? "on" : "off");
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= ((xorriso->system_area_options & (1 << 17)) == 0);
sprintf(line, "-boot_image any gpt_iso_not_ro=%s\n",
(xorriso->system_area_options & (1 << 17)) ? "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");
@ -3067,11 +3103,15 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
is_default= (xorriso->iso_mbr_part_type == -1);
sprintf(line, "-boot_image any iso_mbr_part_type=");
if(xorriso->iso_mbr_part_type == -1)
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
} 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);
@ -3209,6 +3249,14 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
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" :
@ -3413,6 +3461,16 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
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);
@ -3483,6 +3541,20 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
sprintf(line,"-dvd_obs %s\n", mode);
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (xorriso->do_obs_pad == 0);
strcpy(mode, "no_obs_pad");
if(xorriso->do_obs_pad)
strcpy(mode, "obs_pad");
sprintf(line,"-dvd_obs %s\n", mode);
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso, filter, fp, flag & 2);
is_default= (xorriso->bdr_obs_exempt == 0);
strcpy(mode, "no_bdr_obs_exempt");
if(xorriso->bdr_obs_exempt)
strcpy(mode, "bdr_obs_exempt");
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 ");
@ -3634,7 +3706,7 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
Xorriso_status_result(xorriso,filter,fp,flag&2);
is_default= (xorriso->grow_blindly_msc2<0);
sprintf(sfe, "%d", xorriso->grow_blindly_msc2);
sprintf(sfe, "%.f", (double) xorriso->grow_blindly_msc2);
sprintf(line,"-grow_blindly %s\n",
xorriso->grow_blindly_msc2 < 0 ? "off" : sfe);
if(!(is_default && no_defaults))
@ -3739,6 +3811,15 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(!(is_default && no_defaults))
Xorriso_status_result(xorriso,filter,fp,flag&2);
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 ");
@ -3799,13 +3880,20 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
}
}
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= 0;
do_single= do_drive_access= 0;
dev_filter= filter;
if(dev_filter != NULL) {
show_dev= Xorriso_status_filter(xorriso, filter, "-dev", 0);
@ -3818,43 +3906,52 @@ int Xorriso_status(struct XorrisO *xorriso, char *filter, FILE *fp, int flag)
if(show_outdev > 0 || show_indev > 0)
do_single= 1;
}
if(xorriso->drives_exclusive != xorriso->indev_is_exclusive &&
xorriso->indev[0])
if((xorriso->drives_exclusive != xorriso->indev_is_exclusive ||
xorriso->drives_access != xorriso->indev_access) && xorriso->indev[0]) {
do_single= 1;
else if(xorriso->drives_exclusive != xorriso->outdev_is_exclusive &&
xorriso->outdev[0])
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 {
if(xorriso->drives_exclusive != xorriso->indev_is_exclusive &&
xorriso->indev[0] && show_indev) {
sprintf(line,"-osirrox o_excl_%s\n",
xorriso->indev_is_exclusive ? "on" : "off");
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(xorriso->drives_exclusive != xorriso->indev_is_exclusive &&
xorriso->indev[0] && show_indev) {
sprintf(line,"-osirrox o_excl_%s\n",
xorriso->drives_exclusive ? "on" : "off");
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);
}
if(xorriso->drives_exclusive != xorriso->outdev_is_exclusive &&
xorriso->outdev[0] && show_outdev) {
sprintf(line,"-osirrox o_excl_%s\n",
xorriso->outdev_is_exclusive ? "on" : "off");
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(xorriso->drives_exclusive != xorriso->outdev_is_exclusive &&
xorriso->outdev[0] && show_outdev) {
sprintf(line,"-osirrox o_excl_%s\n",
xorriso->drives_exclusive ? "on" : "off");
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);
}
}
@ -3882,7 +3979,7 @@ 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, preferrably in past
@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.
@ -4031,7 +4128,7 @@ int Xorriso_much_too_long(struct XorrisO *xorriso, int len, int flag)
{
if(len>=SfileadrL || (flag&2)) {
sprintf(xorriso->info_text,
"Path given for %s is much too long (%d)",
"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);
@ -4695,3 +4792,27 @@ char *Xorriso_esc_filepath(struct XorrisO *xorriso,
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);
}

View File

@ -58,7 +58,7 @@ 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, preferrably in past
@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.
@ -105,6 +105,9 @@ int Xorriso_named_pipe_loop(struct XorrisO *xorriso,
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

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
/* xorriso - creates, loads, manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2010 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -31,14 +31,17 @@ 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,
off_t 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 Xorriso_set_system_area(struct XorrisO *xorriso,
struct burn_drive *in_drive,
struct burn_drive *out_drive,
IsoImage *img,
struct isoburn_imgen_opts *sopts,
int flag);
int Xorriso_check_burn_abort(struct XorrisO *xorriso, int flag);

View File

@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH XORRECORD 1 "Version 1.5.0, Sep 15, 2018"
.TH XORRECORD 1 "Version 1.5.7, Apr 19, 2024"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -232,7 +232,7 @@ with non\-zero exit value.
.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 upcomming
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
@ -289,7 +289,7 @@ Minimally blank an entire CD\-RW or blank an unformatted DVD\-RW.
.br
deformat
.br
Like blank=all but with the additional ability to blank overwriteable DVD\-RW.
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)
@ -299,7 +299,7 @@ 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 unpredicatable size.
writing tracks of unpredictable size.
Multi\-session will not be possible either.
.br
(Note: blank=deformat_quickest is not an original cdrecord option.)
@ -346,7 +346,7 @@ 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 overwriteable DVD or BD media, \-multi cannot mark the end of the session.
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.
@ -397,7 +397,7 @@ 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 upcomming track.
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
@ -511,7 +511,7 @@ 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 verbous log, one needs to read SCSI
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,
@ -531,6 +531,16 @@ Afterwards end emulation without performing any drive operation.
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
@ -551,7 +561,7 @@ 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 overwriteable media which
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
@ -568,10 +578,10 @@ 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 overwriteable media and no option blank=fast|all present it expands an
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.
Overwriteable media with a recognizable ISO 9660 size will be regarded as
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.
@ -595,12 +605,34 @@ 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.
or BD media. With most write types, tracks get padded up to the next
multiple of this write size (see option \-\-obs_pad). 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
\fB\--obs_pad\fR
Pad the data of the last write operation of a DVD\-R[W] DAO session, or BD\-R
session, or stdio: pseudo\-drive session up to the full size of an output chunk.
This padding has to be applied automatically to the other DVD and BD media
types, where it causes e.g. ISO images to have trailing unclaimed blocks.
Whether it is applied automatically to BD\-R depends on option
\-\-bdr_obs_exempt.
.br
Use this option if there is the suspicion that DVD\-R[W] DAO or BD\-R sessions
abort with your kernel and/or DVD drive, if their size is not a multiple of
16 blocks.
.br
This option may also get enabled at compile time of libburn.
.TP
\fB\--bdr_obs_exempt\fR
Exempt BD\-R media from automatic unconditional transaction end padding,
provided that this padding is not requested by \-\-obs_pad and that
no stream_recording is requested.
.br
This is a new feature introduced with version 1.5.6. It might become default
in later versions.
.TP
\fBmodesty_on_drive=parameter[:parameters]\fR
Control whether the drive buffer shall be kept from getting completely filled.
@ -657,8 +689,8 @@ formatting will show no progress indication.
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.
\fBwrite_start_address=byte_offset\fR
Set the byte 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.
@ -736,18 +768,19 @@ 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
It is advised to load the tray manually
or via dd by the CD\-ROM driver, rather than letting xorrecord do this
by its own SCSI driver. Many system CD\-ROM drivers do not take notice
of xorrecord's activities.
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
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
.br
Now get the \-msinfo numbers:
Get the \-msinfo numbers (and properly reload the tray if it has a motor) by:
.br
$ m=$(xorrecord dev=/dev/sr0 \-msinfo)
.br
and use them with xorrisofs to add ./tree2 to the image as /dir2:
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
@ -766,7 +799,19 @@ 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:
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
@ -779,7 +824,7 @@ in a pipeline without storing the ISO 9660 image as file on hard disk:
\-eject padsize=300k \-
.br
This is also the main use case of program \fBxorriso\fR itself,
where this run would look like:
where the run would need no system workarounds and simply look like:
.br
$ xorriso \-dev /dev/sr0 \-joliet on \-speed 12 \-fs 8m \\
.br
@ -857,7 +902,7 @@ Thomas Schmitt <scdbackup@gmx.net>
.br
for libburnia\-project.org
.SH COPYRIGHT
Copyright (c) 2011 \- 2018 Thomas Schmitt
Copyright (c) 2011 \- 2024 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

View File

@ -3,9 +3,9 @@ xorrecord.texi.
xorrecord - Emulation of CD/DVD/BD program cdrecord by program xorriso
Copyright (C) 2011 - 2018 Thomas Schmitt
Copyright (C) 2011 - 2023 Thomas Schmitt
Permission is granted to distrubute this text freely.
Permission is granted to distribute this text freely.
INFO-DIR-SECTION Archiving
START-INFO-DIR-ENTRY
* Xorrecord: (xorrecord). Emulates CD/DVD/BD program cdrecord
@ -14,7 +14,7 @@ END-INFO-DIR-ENTRY

File: xorrecord.info, Node: Top, Next: Overview, Up: (dir)
xorrecord 1.5.0
xorrecord 1.5.7
***************
xorrecord - Emulation of CD/DVD/BD program cdrecord by program xorriso
@ -148,7 +148,7 @@ File: xorrecord.info, Node: Options, Next: Examples, Prev: Xorriso, Up: Top
* DriveAddr:: Drive addressing
* Inquire:: Inquiring drive and media
* SetBurn:: Settings for the burn run
* Verbous:: Program version and verbosity
* Verbose:: Program version and verbosity
* NonCdrecord:: Options not compatible to cdrecord

@ -241,14 +241,14 @@ File: xorrecord.info, Node: Inquire, Next: SetBurn, Prev: DriveAddr, Up: Opt
with non-zero exit value.

File: xorrecord.info, Node: SetBurn, Next: Verbous, Prev: Inquire, Up: Options
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
upcomming session. The medium state must be either blank or
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
@ -296,7 +296,7 @@ blank=mode
deformat
Like blank=all but with the additional ability to blank
overwriteable DVD-RW. This will destroy their formatting and make
overwritable DVD-RW. This will destroy their formatting and make
them sequentially recordable.
(Note: blank=deformat is not an original cdrecord options)
@ -304,7 +304,7 @@ blank=mode
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 unpredicatable size. Multi-session will not be possible
tracks of unpredictable size. Multi-session will not be possible
either.
(Note: blank=deformat_quickest is not an original cdrecord option.)
@ -341,7 +341,7 @@ blank=mode
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 overwriteable DVD or BD media, -multi cannot mark the end of
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*.
@ -384,12 +384,12 @@ tsize=size
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 upcomming 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.
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
@ -457,7 +457,7 @@ minbuf=percentage
Eject the drive tray after alll other work is done.

File: xorrecord.info, Node: Verbous, Next: NonCdrecord, Prev: SetBurn, Up: Options
File: xorrecord.info, Node: Verbose, Next: NonCdrecord, Prev: SetBurn, Up: Options
5.4 Program version and verbosity
=================================
@ -479,7 +479,7 @@ File: xorrecord.info, Node: Verbous, Next: NonCdrecord, Prev: SetBurn, Up: O
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 verbous
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
@ -491,7 +491,7 @@ File: xorrecord.info, Node: Verbous, Next: NonCdrecord, Prev: SetBurn, Up: O
Afterwards end emulation without performing any drive operation.

File: xorrecord.info, Node: NonCdrecord, Next: ExDevices, Prev: Verbous, Up: Options
File: xorrecord.info, Node: NonCdrecord, Next: ExDevices, Prev: Verbose, Up: Options
5.5 Options not compatible to cdrecord
======================================
@ -501,6 +501,14 @@ File: xorrecord.info, Node: NonCdrecord, Next: ExDevices, Prev: Verbous, Up:
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*
@ -519,7 +527,7 @@ drive_scsi_dev_family=sr|scd|sg|default
well be given as /dev/sr* but will nevertheless get used as
/dev/sg*.
--grow_overwriteable_iso
Enable emulation of multi-session writing on overwriteable media
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
@ -531,10 +539,10 @@ drive_scsi_dev_family=sr|scd|sg|default
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 overwriteable media and no option blank=fast|all present it
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. Overwriteable media with a recognizable ISO 9660
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.
@ -556,12 +564,29 @@ stream_recording="on"|"off"|number
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.
Set the number of bytes to be transmitted with each write operation
to DVD or BD media. With most write types, tracks get padded up to
the next multiple of this write size (see option -obs_pad). 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.
-obs_pad
Pad the data of the last write operation of a DVD-R[W] DAO session,
or BD-R session, or stdio: pseudo-drive session up to the full size
of an output chunk. This padding has to be applied automatically
to the other DVD and BD media types, where it causes e.g. ISO
images to have trailing unclaimed blocks. Whether it is applied
automatically to BD-R depends on option --bdr_obs_exempt. .br Use
this option if there is the suspicion that DVD-R[W] DAO or BD-R
sessions abort with your kernel and/or DVD drive, if their size is
not a multiple of 16 blocks. .br This option may also get enabled
at compile time of libburn.
-bdr_obs_exempt
Exempt BD-R media from automatic unconditional transaction end
padding, provided that this padding is not requested by -obs_pad
and that no stream_recording is requested.
This is a new feature introduced with version 1.5.6. It might
become default in later versions.
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
@ -608,8 +633,8 @@ use_immed_bit="on"|"off"|"default"
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
write_start_address=byte_offset
Set the byte 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.
@ -718,15 +743,18 @@ 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.
It is advised to load the tray manually or via dd by the CD-ROM driver,
rather than letting xorrecord do this by its own SCSI driver. Many
system CD-ROM drivers do not take notice of xorrecord's activities.
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
Now get the -msinfo numbers:
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)
and use them with xorrisofs to add ./tree2 to the image as /dir2:
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
@ -748,7 +776,18 @@ File: xorrecord.info, Node: ExIsoFly, Next: ExAfio, Prev: ExIsoMulti, Up: Ex
=====================================
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:
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 \
@ -756,8 +795,8 @@ pipeline without storing the ISO 9660 image as file on hard disk:
-waiti -multi -grow_overwriteable_iso \
-eject padsize=300k -
This is also the main use case of program *xorriso* itself, where
this run would look like:
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
@ -854,7 +893,7 @@ for libburnia-project.org
10.2 Copyright
==============
Copyright (c) 2011 - 2018 Thomas Schmitt
Copyright (c) 2011 - 2024 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
@ -879,24 +918,28 @@ File: xorrecord.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: T
[index]
* Menu:
* --bdr_obs_exempt write transaction end padding: NonCdrecord.
(line 92)
* --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 29)
(line 37)
* --multi_if_possible apply -multi if medium is suitable: NonCdrecord.
(line 49)
(line 57)
* --no_rc do not execute xorriso startup files: NonCdrecord. (line 8)
* --obs_pad write transaction end padding: NonCdrecord. (line 81)
* -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: Verbous. (line 30)
* -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 73)
* -modesty_on_drive keep drive buffer hungry: NonCdrecord. (line 98)
* -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)
@ -904,27 +947,27 @@ File: xorrecord.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: T
* -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: Verbous. (line 16)
* -V log SCSI command transactions to stderr: Verbous. (line 20)
* -version report emulation and xorriso version: Verbous. (line 8)
* -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 12)
* dvd_obs= set write transaction payload size: NonCdrecord. (line 66)
(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 125)
* stdio_sync= control stdio buffer: NonCdrecord. (line 150)
* stream_recording= try to get full speed on DVD-RAM, BD: NonCdrecord.
(line 56)
(line 64)
* tsize= set a fixed track size: SetBurn. (line 126)
* use_immed_bit= control use of Immed bit: NonCdrecord. (line 110)
* use_immed_bit= control use of Immed bit: NonCdrecord. (line 135)
* write_start_address= set block address for write start: NonCdrecord.
(line 119)
(line 144)

File: xorrecord.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
@ -936,25 +979,27 @@ File: xorrecord.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Menu:
* Accessing drive, wait for stdin, -waiti: SetBurn. (line 113)
* Blank, format, Immed bit, use_immed_bit=: NonCdrecord. (line 110)
* Blank, format, Immed bit, use_immed_bit=: NonCdrecord. (line 135)
* Bugs, reporting: Bugreport. (line 6)
* Data track, announce, -data: SetBurn. (line 157)
* Defect management, control, stream_recording=: NonCdrecord. (line 56)
* 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 56)
(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 49)
* 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)
@ -962,14 +1007,14 @@ File: xorrecord.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* MMC, _definiton: Standards. (line 6)
* multi-session info, retrieve, -msinfo: Inquire. (line 43)
* Multi-session, emulate ISO 9660, --grow_overwriteable_iso: NonCdrecord.
(line 29)
* Options, overview, -help: Verbous. (line 30)
(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: Verbous. (line 20)
* 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)
@ -977,21 +1022,24 @@ File: xorrecord.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* 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 66)
* Transaction end padding, BD-R, -bdr_obs_exempt: NonCdrecord.
(line 92)
* Transaction end padding, enforce, -obs_pad: NonCdrecord. (line 81)
* Transaction size, set, dvd_obs=: NonCdrecord. (line 74)
* Tray, eject, -eject: SetBurn. (line 214)
* Verbosity, increase, -v: Verbous. (line 16)
* Verbosity, SCSI commands, -V: Verbous. (line 20)
* Version, report, -version: Verbous. (line 8)
* 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 119)
(line 144)
* 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 125)
* Write, buffer syncing, stdio_sync=: NonCdrecord. (line 150)
* Write, drive buffer, -immed: SetBurn. (line 208)
* Write, drive buffer, minbuf=: SetBurn. (line 205)
* Write, drive buffer, modesty_on_drive=: NonCdrecord. (line 73)
* Write, drive buffer, modesty_on_drive=: NonCdrecord. (line 98)
* xorriso, mkisofs emulation: Xorriso. (line 6)
* xorriso, options: Options. (line 6)
@ -1007,23 +1055,23 @@ Node: Options5885
Node: DriveAddr6253
Node: Inquire7618
Node: SetBurn10487
Node: Verbous21115
Node: NonCdrecord22665
Node: Examples30005
Node: ExDevices30666
Node: ExMedium30884
Node: ExBlank31147
Node: ExFormat31368
Node: ExDeformat31886
Node: ExIsoSingle32153
Node: ExIsoMulti32437
Node: ExIsoFly34071
Node: ExAfio34742
Node: Files35740
Node: Seealso36296
Node: Bugreport36659
Node: Legal37250
Node: CommandIdx38179
Node: ConceptIdx41669
Node: Verbose21111
Node: NonCdrecord22661
Node: Examples31496
Node: ExDevices32157
Node: ExMedium32375
Node: ExBlank32638
Node: ExFormat32859
Node: ExDeformat33377
Node: ExIsoSingle33644
Node: ExIsoMulti33928
Node: ExIsoFly35672
Node: ExAfio36864
Node: Files37862
Node: Seealso38418
Node: Bugreport38781
Node: Legal39372
Node: CommandIdx40301
Node: ConceptIdx44073

End Tag Table

View File

@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename xorrecord.info
@settitle GNU xorrecord 1.5.0
@settitle GNU xorrecord 1.5.7
@c %**end of header
@c
@c man-ignore-lines begin
@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRECORD 1 "Version 1.5.0, Sep 15, 2018"
@c man .TH XORRECORD 1 "Version 1.5.7, Apr 19, 2024"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -68,15 +68,15 @@
@copying
xorrecord - Emulation of CD/DVD/BD program cdrecord by program xorriso
Copyright @copyright{} 2011 - 2018 Thomas Schmitt
Copyright @copyright{} 2011 - 2023 Thomas Schmitt
@quotation
Permission is granted to distrubute this text freely.
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.0
@title Manual of GNU xorriso personality xorrecord 1.5.7
@author Thomas Schmitt
@page
@vskip 0pt plus 1filll
@ -85,7 +85,7 @@ Permission is granted to distrubute this text freely.
@contents
@ifnottex
@node Top
@top xorrecord 1.5.0
@top xorrecord 1.5.7
@c man-ignore-lines 1
@c man .SH NAME
@ -240,7 +240,7 @@ run ends or before cdrecord emulation ends.
* DriveAddr:: Drive addressing
* Inquire:: Inquiring drive and media
* SetBurn:: Settings for the burn run
* Verbous:: Program version and verbosity
* Verbose:: Program version and verbosity
* NonCdrecord:: Options not compatible to cdrecord
@end menu
@c man .PP
@ -364,12 +364,12 @@ with non-zero exit value.
@end table
@c man .TP
@c man .B Settings for the burn run:
@node SetBurn, Verbous, Inquire, Options
@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 upcomming
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
@ -435,7 +435,7 @@ Minimally blank an entire CD-RW or blank an unformatted DVD-RW.
@*
deformat
@*
Like blank=all but with the additional ability to blank overwriteable DVD-RW.
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)
@ -446,7 +446,7 @@ 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 unpredicatable size.
writing tracks of unpredictable size.
Multi-session will not be possible either.
@*
(Note: blank=deformat_quickest is not an original cdrecord option.)
@ -497,7 +497,7 @@ 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 overwriteable DVD or BD media, -multi cannot mark the end of the session.
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}.
@ -558,7 +558,7 @@ will work only if the program's fifo size is at least 64k. See option fs=.
@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 upcomming track.
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
@ -674,7 +674,7 @@ Eject the drive tray after alll other work is done.
@end table
@c man .TP
@c man .B Program version and verbosity:
@node Verbous, NonCdrecord, SetBurn, Options
@node Verbose, NonCdrecord, SetBurn, Options
@section Program version and verbosity
@table @asis
@sp 1
@ -707,7 +707,7 @@ 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 verbous log, one needs to read SCSI
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,
@ -725,7 +725,7 @@ Afterwards end emulation without performing any drive operation.
@end table
@c man .TP
@c man .B Options not compatible to cdrecord:
@node NonCdrecord, ExDevices, Verbous, Options
@node NonCdrecord, ExDevices, Verbose, Options
@section Options not compatible to cdrecord
@table @asis
@sp 1
@ -736,6 +736,18 @@ Afterwards end emulation without performing any drive operation.
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
@ -760,7 +772,7 @@ drive_scsi_dev_family="sg". The drive addresses may then well be given as
@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 overwriteable media which
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
@*
@ -777,10 +789,10 @@ 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 overwriteable media and no option blank=fast|all present it expands an
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.
Overwriteable media with a recognizable ISO 9660 size will be regarded as
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.
@ -811,12 +823,38 @@ addresses below that number. Any number below 16s is the same as "off".
@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.
or BD media. With most write types, tracks get padded up to the next
multiple of this write size (see option --obs_pad). 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 --obs_pad
@kindex --obs_pad write transaction end padding
@cindex Transaction end padding, enforce, --obs_pad
Pad the data of the last write operation of a DVD-R[W] DAO session, or BD-R
session, or stdio: pseudo-drive session up to the full size of an output chunk.
This padding has to be applied automatically to the other DVD and BD media
types, where it causes e.g. ISO images to have trailing unclaimed blocks.
Whether it is applied automatically to BD-R depends on option
@minus{}@minus{}bdr_obs_exempt.
.br
Use this option if there is the suspicion that DVD-R[W] DAO or BD-R sessions
abort with your kernel and/or DVD drive, if their size is not a multiple of
16 blocks.
.br
This option may also get enabled at compile time of libburn.
@c man .TP
@item --bdr_obs_exempt
@kindex --bdr_obs_exempt write transaction end padding
@cindex Transaction end padding, BD-R, --bdr_obs_exempt
Exempt BD-R media from automatic unconditional transaction end padding,
provided that this padding is not requested by --obs_pad and that
no stream_recording is requested.
@*
This is a new feature introduced with version 1.5.6. It might become default
in later versions.
@c man .TP
@item modesty_on_drive=parameter[:parameters]
@kindex -modesty_on_drive keep drive buffer hungry
@ -877,10 +915,10 @@ 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
@item write_start_address=byte_offset
@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.
Set the byte 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.
@ -998,20 +1036,21 @@ 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.
@*
It is advised to load the tray manually
or via dd by the CD-ROM driver, rather than letting xorrecord do this
by its own SCSI driver. Many system CD-ROM drivers do not take notice
of xorrecord's activities.
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.
@*
@sp 1
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
@*
Now get the -msinfo numbers:
Get the -msinfo numbers (and properly reload the tray if it has a motor) by:
@*
$ m=$(xorrecord dev=/dev/sr0 -msinfo)
@*
@sp 1
and use them with xorrisofs to add ./tree2 to the image as /dir2:
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 \
@ -1036,7 +1075,21 @@ of the second session and show both directories /dir1 and /dir2.
@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:
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 \
@ -1051,7 +1104,7 @@ in a pipeline without storing the ISO 9660 image as file on hard disk:
@*
@sp 1
This is also the main use case of program @strong{xorriso} itself,
where this run would look like:
where the run would need no system workarounds and simply look like:
@*
@sp 1
$ xorriso -dev /dev/sr0 -joliet on -speed 12 -fs 8m \
@ -1170,7 +1223,7 @@ Thomas Schmitt <scdbackup@@gmx.net>
for libburnia-project.org
@c man .SH COPYRIGHT
@section Copyright
Copyright (c) 2011 - 2018 Thomas Schmitt
Copyright (c) 2011 - 2024 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

View File

@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH XORRISO-TCLTK 1 "Version 1.4.9, Sep 29, 2017"
.TH XORRISO-TCLTK 1 "Version 1.5.7, Jun 07, 2023"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -119,7 +119,7 @@ Thomas Schmitt <scdbackup@gmx.net>
.br
for libburnia\-project.org
.SH COPYRIGHT
Copyright (c) 2011 \- 2017 Thomas Schmitt
Copyright (c) 2011 \- 2023 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.

Binary file not shown.

View File

@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename xorriso-tcltk.info
@settitle GNU xorriso-tcltk 1.4.9
@settitle GNU xorriso-tcltk 1.5.7
@c %**end of header
@c
@c man-ignore-lines begin
@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISO-TCLTK 1 "Version 1.4.9, Sep 29, 2017"
@c man .TH XORRISO-TCLTK 1 "Version 1.5.7, Jun 07, 2023"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -68,15 +68,15 @@
@copying
xorriso-tcltk - Educational GUI frontend for xorriso
Copyright @copyright{} 2011 - 2017 Thomas Schmitt
Copyright @copyright{} 2011 - 2023 Thomas Schmitt
@quotation
Permission is granted to distrubute this text freely.
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.4.9
@title Manual of GNU xorriso frontend xorriso-tcltk 1.5.7
@author Thomas Schmitt
@page
@vskip 0pt plus 1filll
@ -85,7 +85,7 @@ Permission is granted to distrubute this text freely.
@contents
@ifnottex
@node Top
@top xorriso-tcltk 1.4.9
@top xorriso-tcltk 1.5.7
@c man-ignore-lines 1
@c man .SH NAME
@ -237,7 +237,7 @@ Thomas Schmitt <scdbackup@@gmx.net>
for libburnia-project.org
@c man .SH COPYRIGHT
@section Copyright
Copyright (c) 2011 - 2017 Thomas Schmitt
Copyright (c) 2011 - 2023 Thomas Schmitt
@*
Permission is granted to distribute this text freely. It shall only be
modified in sync with the technical properties of xorriso-tcltk.

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,7 @@
/* xorriso - libisoburn higher level API which creates, loads, manipulates
and burns ISO 9660 filesystem images.
Copyright 2007-2018 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2023 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -74,7 +74,7 @@ struct XorrisO;
*/
#define Xorriso_header_version_majoR 1
#define Xorriso_header_version_minoR 5
#define Xorriso_header_version_micrO 0
#define Xorriso_header_version_micrO 7
/** If needed: Something like ".pl01" to indicate a bug fix. Normally empty.
@ -207,16 +207,20 @@ int Xorriso_startup_libraries(struct XorrisO *xorriso, int flag);
functions from the Command API.
Wenn all desired activities are done, you may check whether there are
uncommited changes pending, compute an exit value, destroy the XorrisO
object, and exit your program.
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
@param flag bit0= do not return 1 if -as mkisofs -print-size was
performed on the current image.
@since 0.6.6
bit1= issue NOTE if return is 0,
indev and outdev point to different drives,
and no write run has happened
@since 1.5.8
@return 0= -commit would have nothing to do
1= a new image session would emerge at -commit
*/
@ -820,6 +824,9 @@ int Xorriso_sieve_dispose(struct XorrisO *xorriso, int flag);
(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
@ -864,6 +871,9 @@ int Xorriso_sieve_dispose(struct XorrisO *xorriso, int flag);
argv[3]= Volume Id
"Image size :" up to 1 result from -print_size
argv[0]= number of blocks with "s" appended
"Indev feature:" up to 10000 results from -assess_indev_features plain
argv[0]= name
argv[1]= value
"Jigdo files :" up to 1 result from -list_extras
argv[0]= "yes" or "no"
"Local ACL :" up to 1 result from -list_extras
@ -905,6 +915,9 @@ int Xorriso_sieve_dispose(struct XorrisO *xorriso, int flag);
"Modif. Time :" up to 1 result from -pvd_info
argv[0]= YYYYMMDDhhmmsscc
(Note: prefix is "Modif. Time : ")
"Overburnt by :" up to 2 results from -toc
argv[0]= number of readable blocks beyond ATIP leadout
(Note: only reported with overburnt CD-RW)
"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
@ -1287,6 +1300,11 @@ int Xorriso_option_as(struct XorrisO *xorriso, int argc, char **argv,
int Xorriso_option_assert_volid(struct XorrisO *xorriso, char *pattern,
char *severity, int flag);
/* Command -assess_indev_features */
/* @since 1.5.6 */
int Xorriso_option_assess_indev_features(struct XorrisO *xorriso, char *mode,
int flag);
/* Command -auto_charset "on"|"off" */
/* @since 0.3.8 */
int Xorriso_option_auto_charset(struct XorrisO *xorriso, char *mode, int flag);
@ -1502,6 +1520,10 @@ int Xorriso_option_disk_pattern(struct XorrisO *xorriso, char *mode, int flag);
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,
@ -1561,6 +1583,11 @@ int Xorriso_option_external_filter(struct XorrisO *xorriso,
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,
@ -1645,6 +1672,10 @@ int Xorriso_option_hide(struct XorrisO *xorriso, char *hide_state,
/* @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,
@ -1659,6 +1690,9 @@ int Xorriso_option_jigdo(struct XorrisO *xorriso, char *aspect, char *arg,
/* @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,
@ -2085,7 +2119,7 @@ int Xorriso_option_status_history_max(struct XorrisO *xorriso, int num1,
/* Command -stdio_sync "on"|"off"|"end"|size */
/* @since 0.4.6 */
int Xorriso_option_stdio_sync(struct XorrisO *xorriso, char *rythm, int flag);
int Xorriso_option_stdio_sync(struct XorrisO *xorriso, char *rhythm, int flag);
/* Command -stream_recording */
/* @since 0.1.8 */
@ -2115,6 +2149,12 @@ int Xorriso_option_toc(struct XorrisO *xorriso, int flag);
/* @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);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -127,7 +127,8 @@ File content may get zisofs or gzip compressed or filtered by external
processes.
</LI>
<LI>
Can activate ISOLINUX and GRUB boot images by El Torito boot record and MBR.
Can activate ISOLINUX and GRUB boot equipment by El Torito boot record,
MBR code for BIOS, or EFI System Partition.
</LI>
<LI>
Writes result as completely new image or as add-on session
@ -200,7 +201,7 @@ libburnia git: libisoburn/frontend/xorriso-tcltk
You will probably have to give it x-permission after download. Some browsers
insist in adding &quot;.htm&quot; to the file name.
<BR>
Further you need xorriso >= 1.5.0, Tcl, Tk >= 8.4,
Further you need xorriso >= 1.5.6, Tcl, Tk >= 8.4,
Tcl/Tk package &quot;BWidget&quot;.
</P>
@ -506,29 +507,38 @@ files or trees to disk:
<P>
<DL>
<DT><H3>Download as source code (see README):</H3></DT>
<DD><A HREF="xorriso-1.5.0.tar.gz">xorriso-1.5.0.tar.gz</A>
(2625 KiB).
<DD><A HREF="xorriso-1.5.6.pl02.tar.gz">xorriso-1.5.6.pl02.tar.gz</A>
(2780 KiB).
</DD>
<DD>(Released 15 Sep 2018)</DD>
<DD><A HREF="xorriso-1.5.0.tar.gz.sig">xorriso-1.5.0.tar.gz.sig</A></DD>
<DD>(Released 14 Jun 2023)</DD>
<DD><A HREF="xorriso-1.5.6.pl02.tar.gz.sig">xorriso-1.5.6.pl02.tar.gz.sig</A></DD>
<DD>
(detached GPG signature for verification by
<KBD>gpg --verify xorriso-1.5.0.tar.gz.sig xorriso-1.5.0.tar.gz</KBD>
(detached GPG signature for verification by either
<BR>
<KBD>wget https://ftp.gnu.org/gnu/gnu-keyring.gpg</KBD>
<BR>
<KBD>gpg --with-fingerprint --keyring ./gnu-keyring.gpg --verify xorriso-1.5.6.pl02.tar.gz.sig</KBD>
<BR>
or
<BR>
<KBD>gpg --keyserver keyserver.ubuntu.com --recv-keys ABC0A854</KBD>
<BR>
<KBD>gpg --with-fingerprint --verify xorriso-1.5.6.pl02.tar.gz.sig</KBD>
<BR>
Both should confirm
<BR>
which should confirm
<KBD>gpg: Good signature from "Thomas Schmitt &lt;scdbackup@gmx.net&gt;"</KBD>
<BR>
<KBD>
Primary key fingerprint: 44BC 9FD0 D688 EB00 7C4D D029 E9CB DFC0 ABC0 A854
</KBD>
)
<BR>
after <KBD>gpg --keyserver keys.gnupg.net --recv-keys ABC0A854</KBD>
).
</DD>
<DD>
Also on <A HREF="http://www.gnu.org/prep/ftp.html">
mirrors of ftp://ftp.gnu.org/gnu/ </A>
as xorriso/xorriso-1.5.0.tar.gz
as xorriso/xorriso-1.5.6.pl02.tar.gz
</DD>
</DL>
</DD>
@ -563,21 +573,54 @@ describes the cdrecord emulation</DD>
<HR>
<P>
Bug fixes towards previous stable version xorriso-1.4.8:
Bug fixes towards previous stable version xorriso-1.5.4.pl02:
<UL>
<LI>
Reading beyond array end for HFS+ production caused SIGSEGV with
FreeBSD 11 CLANG -O2. Thanks ASX of GhostBSD.
False -status failure with -boot_image --interval:appended_partition
</LI>
<LI>
Multi-session emulation was not recognized with non-zero partition offset
-no_rc prevented pre-scanning of arguments for stdio output and others.
</LI>
<LI>
SIGSEGV could happen if a track ended by reaching its fixed size
while the track source still was willing to deliver bytes
-not_leaf and -not_paths were not applied to -extract and alike
</LI>
<LI>
Device file comparison parameters were recorded wrong with Linux sg
-report_system_area cmd misperceived -part_like_isohybrid with
-isohybrid-gpt-basdat
</LI>
<LI>
-report_system_area cmd misperceived combination of isohybrid and
appended partition in GPT
</LI>
<LI>
-as mkisofs option -part_like_isohybrid did not cause a MBR
partition table if the partitions are data files in the ISO
rather than appended
</LI>
<LI>
Split file directories (-split_size) were created with wrong permissions
<LI>
libisofs did not mark clones of imported files as imported.
This could cause that original and clone occupy data storage
in the newly written session. Thanks to Ivan Shmakov.
</LI>
<LI>
Partition offset was preserved from -indev rather than from -outdev
</LI>
<LI>
libisofs could misrepresent Rock Ridge information if many symbolic links
or AAIP data were recorded in a directory
</LI>
<LI>
Data files named /boot.catalog or ./boot.cat could be left out of
the emerging ISO if the boot catalog was set to be hidden
</LI>
<LI>
-toc reported wrong track LBA with overwritable media with
unrecognized content (pseudo-closed)
</LI>
<LI>
-find test -has_xattr matched "isofs." attributes in -xattr mode "any"
</LI>
<!--
<LI>- none -</LI>
@ -586,12 +629,46 @@ Device file comparison parameters were recorded wrong with Linux sg
</P>
<P>
Enhancements towards previous stable version xorriso-1.4.8:
Bug fixes towards deprecated version xorriso-1.5.6:
<UL>
<LI>New -xattr mode "any" to process all xattr namespaces of local filesystem
<LI>
On non-GNU/Linux systems ssize_t was not defined in libisofs file
rockridge.h . Report and fix proposal by Rui Chen.
</LI>
</UL>
</P>
<P>
Enhancements towards previous stable version xorriso-1.5.4.pl02:
<UL>
<LI>
New -boot_image settings gpt_iso_bootable= and gpt_iso_not_ro=
</LI>
<LI>
New -as mkisofs options --gpt-iso-bootable and --gpt-iso-not-ro
</LI>
<LI>
New -as cdrecord option --obs_pad. Automatic no_emul_toc with -as cdrecord.
</LI>
<LI>
New parameters "obs_pad" and "bdr_obs_exempt" for -dvd_obs
</LI>
<LI>
New -as cdrecord option --bdr_obs_exempt
</LI>
<LI>
New command -assess_indev_features
</LI>
<LI>
New -find test -size
</LI>
<LI>
New -compliance rules max_ce_entries=, max_ce_drop=
</LI>
<LI>
Allowed lseekable device files with -cut_out.
Proof-of-concept by Ivan Shmakov on bugs.debian.org.
</LI>
<LI>New -as mkisofs option --xattr-any</LI>
<LI>New -as mkisofs options -uid and -gid</LI>
<!--
<LI>- none -</LI>
-->
@ -614,23 +691,25 @@ libburnia project and the legal intentions of
<A HREF="http://www.fsf.org/"> FSF </A> match completely.
</DT>
<DD>&nbsp;</DD>
<DT>libburn-1.5.0</DT>
<DT>libburn-1.5.6</DT>
<DD>reads and writes data from and to CD, DVD, BD.</DD>
<DD>(founded by Derek Foreman and Ben Jansens,
developed and maintained since August 2006 by
Thomas Schmitt from team of libburnia-project.org)</DD>
<DT>libisofs-1.5.0</DT>
<DT>libisofs-1.5.6</DT>
<DD>operates on ISO 9660 filesystem images.</DD>
<DD>(By Vreixo Formoso, Mario Danic and Thomas Schmitt
from team of libburnia-project.org. HFS+ code by Vladimir Serbinenko.)</DD>
<DT>libisoburn-1.5.0</DT>
<DT>libisoburn-1.5.6</DT>
<DD>coordinates libburn and libisofs, emulates multi-session where needed,
and hosts the original source code of program xorriso.</DD>
<DD>It provides the complete functionality of xorriso via
a C language API.</DD>
<DD>(By Vreixo Formoso and Thomas Schmitt
from team of libburnia-project.org)</DD>
<DT>libjte-1.0.0</DT>
from team of libburnia-project.org</DD>
<DD>The helper script xorriso-dd-target is developed in cooperation with
Nio Wiklund alias sudodus.)</DD>
<DT>libjte-2.0.0</DT>
<DD>produces jigdo and template file together with the emerging ISO image.</DD>
<DD>(By Free Software Foundation, Steve McIntyre, George Danchev,
Thomas Schmitt)</DD>
@ -644,19 +723,37 @@ cdrecord and mkisofs.</DT>
<P>
<DL>
<DT><H3>Development snapshot, version 1.5.1 :</H3></DT>
<DD>Bug fixes towards xorriso-1.5.0:
<DT><H3>Development snapshot, version 1.5.7 :</H3></DT>
<DD>Bug fixes towards stable version 1.5.6:
<UL>
<LI>- none yet -</LI>
<LI>
On non-GNU/Linux systems ssize_t was not defined in libisofs file
rockridge.h . Report and fix proposal by Rui Chen.
</LI>
<LI>
-boot_image and -append_partition were not perceived as image
manipulation which makes production of an ISO image worthwhile.
Thanks Cameron Seader.
</LI>
<!--
<LI>- none yet -</LI>
-->
</UL>
</DD>
<DD>Enhancements towards stable version 1.5.0:
<DD>Enhancements towards stable version 1.5.6:
<UL>
<LI>- none yet -</LI>
<LI>
New -append_partition pseudo partition_number "all" and
pseudo type_code "revoke"
</LI>
<LI>
New -as mkisofs options -cut_out and -hide_iso_path
</LI>
<LI>
Improved handling of hidden boot images in -boot_image cmd/as_mkisofs/replay
</LI>
<!--
<LI>- none yet -</LI>
-->
</UL>
@ -664,13 +761,13 @@ cdrecord and mkisofs.</DT>
<DD>&nbsp;</DD>
<DD><A HREF="README_xorriso_devel">README 1.5.1</A>
<DD><A HREF="xorriso_help_devel">xorriso-1.5.1 -help</A></DD>
<DD><A HREF="xorrisofs_help_devel">xorriso-1.5.1 -as mkisofs -help</A></DD>
<DD><A HREF="xorrecord_help_devel">xorriso-1.5.1 -as cdrecord -help</A></DD>
<DD><A HREF="man_1_xorriso_devel.html">man xorriso (as of 1.5.1)</A></DD>
<DD><A HREF="man_1_xorrisofs_devel.html">man xorrisofs (as of 1.5.1)</A></DD>
<DD><A HREF="man_1_xorrecord_devel.html">man xorrecord (as of 1.5.1)</A></DD>
<DD><A HREF="README_xorriso_devel">README 1.5.7</A>
<DD><A HREF="xorriso_help_devel">xorriso-1.5.7 -help</A></DD>
<DD><A HREF="xorrisofs_help_devel">xorriso-1.5.7 -as mkisofs -help</A></DD>
<DD><A HREF="xorrecord_help_devel">xorriso-1.5.7 -as cdrecord -help</A></DD>
<DD><A HREF="man_1_xorriso_devel.html">man xorriso (as of 1.5.7)</A></DD>
<DD><A HREF="man_1_xorrisofs_devel.html">man xorrisofs (as of 1.5.7)</A></DD>
<DD><A HREF="man_1_xorrecord_devel.html">man xorrecord (as of 1.5.7)</A></DD>
<DD>&nbsp;</DD>
<DT>If you want to distribute development versions of xorriso, then use
this tarball which produces static linking between xorriso and the
@ -680,8 +777,8 @@ libburnia libraries.
installation see README)
</DD>
<DD>
<A HREF="xorriso-1.5.1.tar.gz">xorriso-1.5.1.tar.gz</A>
(2625 KiB).
<A HREF="xorriso-1.5.7.tar.gz">xorriso-1.5.7.tar.gz</A>
(2780 KiB).
</DD>
<DT>A dynamically linked development version of xorriso can be obtained
from repositories of
@ -710,16 +807,16 @@ versions for dynamic linking. Only release versions are safe for that.
But after the run of <KBD>./bootstrap</KBD>, only
vanilla tools like make and gcc are needed.
</DT>
<DT>GNU xorriso contains a copy of libjte-1.0.0 from package jigit
<DT>GNU xorriso contains a copy of libjte-2.0.0 from package jigit
which produces jigdo and template file together with the emerging ISO image.
(By Free Software Foundation, Steve McIntyre, George Danchev,
Thomas Schmitt)
</DT>
<DD>Important: If desired, libjte has to be already installed when libisofs
and libisoburn get built.</DD>
<DD>Download: <KBD><B>wget http://www.einval.com/~steve/software/JTE/download/jigit_1.17.orig.tar.gz</B>
<DD>Download: <KBD><B>wget https://www.einval.com/~steve/software/JTE/download/jigit-1.22.tar.xz</B>
</KBD></DD>
<DD>Install: <KBD><B>tar xzf jigit_1.17.orig.tar.gz ; cd jigit-1.17 ; make ; make install</B>
<DD>Install: <KBD><B>unxz &lt;jigit-1.22.tar.xz | tar xf - ; cd jigit-1.22 ; make ; make install</B>
</KBD></DD>
<DD>&nbsp;</DD>
@ -734,7 +831,7 @@ Many thanks to Derek Foreman and Ben Jansens for starting libburn.
Very special thanks to Andy Polyakov whose
<A HREF="http://fy.chalmers.se/~appro/linux/DVD+RW/tools">dvd+rw-tools</A>
provide the libburnia project with invaluable examples on how to deal
with DVD media and how to emulate multi-session on overwriteable media.
with DVD media and how to emulate multi-session on overwritable media.
</P>
<HR>
@ -753,8 +850,8 @@ with DVD media and how to emulate multi-session on overwriteable media.
<A HREF="http://www.gnu.org">Dedicated to the GNU Operating System</A><BR>
Enjoying free hosting by<BR>
<A HREF="http://www.webframe.org">www.webframe.org</A><BR>
<A HREF="http://sourceforge.net">sourceforge.net</A><BR>
<A HREF="http://www.webframe.org">www.webframe.org</A><BR>
</FONT></CENTER>
</P>
@ -762,11 +859,11 @@ Enjoying free hosting by<BR>
<HR>
<DL>
<DT>Links to related free software projects of Thomas Schmitt:</DT>
<DD><A HREF=http://scdbackup.webframe.org/cdrskin_eng.html>
<DD><A HREF=http://scdbackup.sourceforge.net/cdrskin_eng.html>
cdrskin, a cdrecord emulator</A></DD>
<DD><A HREF=http://scdbackup.webframe.org/main_eng.html>
<DD><A HREF=http://scdbackup.sourceforge.net/main_eng.html>
scdbackup, multi volume CD/DVD/BD backup</A></DD>
<DL><DD><A HREF=http://scdbackup.sourceforge.net/main_eng.html>
<DL><DD><A HREF=http://scdbackup.webframe.org/main_eng.html>
(a second source of above)</A></DD></DL>
</DL>
@ -775,7 +872,7 @@ scdbackup, multi volume CD/DVD/BD backup</A></DD>
<BR>
Legal statement: This website does not serve any commercial purpose.
<BR><BR>
Copyright &copy; 2008 - 2018 Thomas Schmitt.
Copyright &copy; 2008 - 2023 Thomas Schmitt.
<BR>
This text is freely distributable. It shall only be modified in sync with
the factual properties of xorriso and its public storage locations.

View File

@ -2,7 +2,7 @@
/* xorriso - Command line oriented batch and dialog tool which creates, loads,
manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2018 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2023 Thomas Schmitt, <scdbackup@gmx.net>
Initial code of this program was derived from program src/askme.c out
of scdbackup-0.8.8, Copyright 2007 Thomas Schmitt, BSD-License.
@ -111,7 +111,7 @@
*/
#define Xorriso_req_majoR 1
#define Xorriso_req_minoR 5
#define Xorriso_req_micrO 0
#define Xorriso_req_micrO 7
static void yell_xorriso()
@ -135,7 +135,7 @@ static void check_compatibility()
int lib_major, lib_minor, lib_micro;
/* First an ugly compile time check for header version compatibility.
If everthing matches, then no C code is produced. In case of mismatch,
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
@ -155,7 +155,7 @@ static void check_compatibility()
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 indendation is an advise of man gcc to help old compilers ignoring */
/* 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
@ -276,7 +276,7 @@ int main(int argc, char **argv)
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))
if(Xorriso_change_is_pending(xorriso, 1 | 2))
Xorriso_option_end(xorriso, 2);
Xorriso_process_msg_queues(xorriso, 0);
ret= Xorriso_make_return_value(xorriso, 0);

View File

@ -1,5 +1,5 @@
# Copyright (c) 2007 - 2012 Thomas Schmitt <scdbackup@gmx.net>
# Copyright (c) 2007 - 2019 Thomas Schmitt <scdbackup@gmx.net>
# Provided under GPL version 2 or later.
# ts A90315 : LIBBURNIA_PKGCONFDIR is defined OS specific in acinclude.m4
@ -242,22 +242,25 @@ noinst_PROGRAMS = \
# 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_CPPFLAGS = -I $(top_builddir)/xorriso
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_CPPFLAGS = -I $(top_builddir)/xorriso
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
# A Proof-of-concept for frontends, and xorriso-dd-target if on Linux kernel
bin_SCRIPTS = \
frontend/xorriso-tcltk
frontend/xorriso-tcltk \
$(XORRISO_DD_TARGET)
EXTRA_SCRIPTS = xorriso-dd-target/xorriso-dd-target
# Install symbolic links to the xorriso binary
@ -315,13 +318,24 @@ man_MANS = \
xorriso/xorriso.1 \
xorriso/xorrisofs.1 \
xorriso/xorrecord.1 \
xorriso/xorriso-tcltk.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/xorriso-tcltk.texi \
xorriso-dd-target/xorriso-dd-target.texi
# xorriso-dd-target.texi is hardcoded for now because of
# Makefile.am: error: texinfo file '@XORRISO_DD_TARGET_TEXI@' has
# unrecognized extension
# $(XORRISO_DD_TARGET_TEXI)
#
# EXTRA_TEXINFOS = xorriso-dd-target/xorriso-dd-target.texi
EXTRA_DIST = \
xorriso.pc.in \
@ -339,6 +353,7 @@ EXTRA_DIST = \
doc/susp_aaip_2_0.txt \
doc/susp_aaip_isofs_names.txt \
doc/zisofs_format.txt \
doc/zisofs2_format.txt \
doc/startup_file.txt \
frontend/frontend_pipes_xorriso.c \
frontend/README-tcltk \
@ -346,6 +361,7 @@ EXTRA_DIST = \
frontend/sh_on_named_pipes.sh \
frontend/xorriso_broker.sh \
frontend/grub-mkrescue-sed.sh \
xorriso-dd-target/xorriso-dd-target \
libisofs/aaip-os-dummy.c \
libisofs/aaip-os-linux.c \
libisofs/aaip-os-freebsd.c \

View File

@ -2,7 +2,7 @@
/* Command line oriented batch and dialog tool which creates, loads,
manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2017 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -150,6 +150,7 @@ struct XorrisO { /* the global context of xorriso */
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
@ -173,9 +174,11 @@ struct XorrisO { /* the global context of xorriso */
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 overwriteables:
int no_emul_toc; /* bit0= On overwritables:
write first session to LBA 0 rather than 32.
*/
@ -210,8 +213,8 @@ struct XorrisO { /* the global context of xorriso */
mode_t global_dir_mode;
mode_t global_file_mode;
int do_tao; /* 1= Use TAO resp. Incremental
-1= Use SAO resp. DAO
int do_tao; /* 1= Use TAO or Incremental
-1= Use SAO or DAO
0= let libburn choose */
struct Xorriso_lsT *filters;
@ -222,10 +225,31 @@ struct XorrisO { /* the global context of xorriso */
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];
@ -246,8 +270,8 @@ struct XorrisO { /* the global context of xorriso */
char application_use[SfileadrL];
char session_logfile[SfileadrL];
int session_lba;
int session_blocks;
off_t session_lba;
off_t session_blocks;
/* >>> put libburn/isoburn aspects here */
@ -258,7 +282,7 @@ struct XorrisO { /* the global context of xorriso */
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 overwriteable media
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()
@ -288,6 +312,7 @@ struct XorrisO { /* the global context of xorriso */
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 */
@ -314,6 +339,7 @@ struct XorrisO { /* the global context of xorriso */
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. */
@ -331,6 +357,11 @@ struct XorrisO { /* the global context of xorriso */
3= change pending, but the attempt to write it
failed
*/
int commit_attempts; /* For Xorriso_change_is_pending bit1 */
int print_size_attempts; /* For Xorriso_change_is_pending bit1 */
int write_session_counter; /* For Xorriso_change_is_pending bit1 */
int print_size_counter; /* For Xorriso_change_is_pending bit1 */
int no_volset_present; /* set to 1 on first failure */
struct CheckmediajoB *check_media_default;
@ -345,13 +376,14 @@ struct XorrisO { /* the global context of xorriso */
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
*/
off_t 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;
@ -361,6 +393,9 @@ struct XorrisO { /* the global context of xorriso */
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 */
@ -376,6 +411,11 @@ struct XorrisO { /* the global context of xorriso */
>=16 means yes with number as start LBA */
int dvd_obs; /* DVD write chunk size: 0, 32k or 64k */
int do_obs_pad; /* 1= pad up end on all media types */
int bdr_obs_exempt; /* 1= do not unconditionally apply do_obs_pad=1
to BD-R if not stream recording
*/
int modesty_on_drive; /* "enable" of burn_drive_set_buffer_waiting()
0= disable , 1= enable waiting ,
@ -422,7 +462,8 @@ struct XorrisO { /* the global context of xorriso */
int boot_image_isohybrid; /* 0=off , deprecated: 1=auto , 2=on , 3=force */
int boot_efi_default; /* 0= no effect ,
1= appy --efi-boot parameters when attaching to img */
1= apply --efi-boot parameters when attaching to img
*/
char system_area_disk_path[SfileadrL];
int system_area_clear_loaded;
@ -495,6 +536,11 @@ struct XorrisO { /* the global context of xorriso */
/* 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 */
@ -507,11 +553,20 @@ struct XorrisO { /* the global context of xorriso */
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;
/* See libisoburn.h isoburn_igopt_set_max_ce_entries() */
uint32_t max_ce_entries;
uint32_t max_ce_entries_flag;
/* Eventual name of the non-ISO aspect of the image. E.g. SUN ASCII label.
*/
char ascii_disc_label[Xorriso_disc_label_sizE];
@ -544,6 +599,12 @@ struct XorrisO { /* the global context of xorriso */
*/
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;
@ -553,14 +614,15 @@ struct XorrisO { /* the global context of xorriso */
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= md5_path , 5= min_size
6= checksum_iso , 7= checksum_template
8= compression , 9= exclude , 10= demand_md5
11= mapping
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;
off_t loaded_boot_bin_lba;
/* Path of the catalog node after image loading */
char loaded_boot_cat_path[SfileadrL];
@ -651,7 +713,7 @@ struct XorrisO { /* the global context of xorriso */
struct ExclusionS *disk_exclusions;
int disk_excl_mode; /* bit0= on (else off)
bit1= parameter too (else rekursion only)
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
@ -826,6 +888,9 @@ struct XorrisO { /* the global context of xorriso */
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;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2018.09.15.133001"
#define Xorriso_timestamP "2024.05.13.101913"

View File

@ -4,7 +4,7 @@
a command line oriented batch and dialog tool which creates, loads,
manipulates and burns ISO 9660 filesystem images.
Copyright 2007-2018 Thomas Schmitt, <scdbackup@gmx.net>
Copyright 2007-2024 Thomas Schmitt, <scdbackup@gmx.net>
Provided under GPL version 2 or later.
@ -19,7 +19,7 @@
*/
#define xorriso_libisoburn_req_major 1
#define xorriso_libisoburn_req_minor 5
#define xorriso_libisoburn_req_micro 0
#define xorriso_libisoburn_req_micro 7
struct SpotlisT; /* List of intervals with different read qualities */
@ -34,8 +34,8 @@ int Xorriso_detach_libraries(struct XorrisO *xorriso, int flag);
int Xorriso_create_empty_iso(struct XorrisO *xorriso, int flag);
/* @param flag bit0=aquire as isoburn input drive
bit1=aquire as libburn output drive (as isoburn drive if bit0)
/* @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,
@ -43,7 +43,7 @@ int Xorriso_aquire_drive(struct XorrisO *xorriso, char *adr, char *show_adr,
int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag);
int Xorriso_write_session(struct XorrisO *xorriso, int flag);
off_t Xorriso_write_session(struct XorrisO *xorriso, int flag);
int Xorriso_retry_write_session(struct XorrisO *xorriso, int flag);
@ -76,7 +76,7 @@ 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);
off_t *media_space, off_t *free_space, int flag);
/* @param flag bit0=fast , bit1=deformat
@return 0=failure, did not touch medium , -1=failure, altered medium
@ -151,6 +151,12 @@ int Xorriso_ls_filev(struct XorrisO *xorriso, char *wd,
*/
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.
@ -166,6 +172,8 @@ int Xorriso_normalize_img_path(struct XorrisO *xorriso, char *wd,
/* @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);
@ -320,7 +328,8 @@ int Xorriso_libburn_adr(struct XorrisO *xorriso, char *address_string,
/* @param flag bit1= obtain info from outdev
*/
int Xorriso_msinfo(struct XorrisO *xorriso, int *msc1, int *msc2, int flag);
int Xorriso_msinfo(struct XorrisO *xorriso, off_t *msc1, off_t *msc2,
int flag);
/*
@param flag bit0= obtain iso_lba from indev
@ -328,10 +337,14 @@ int Xorriso_msinfo(struct XorrisO *xorriso, int *msc1, int *msc2, int flag);
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,
int Xorriso_update_iso_lba0(struct XorrisO *xorriso,
off_t iso_lba, off_t 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);
@ -369,6 +382,8 @@ 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);
@ -631,6 +646,9 @@ 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);
@ -642,12 +660,38 @@ int Xorriso_truncate_path_comps(struct XorrisO *xorriso, char *path,
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, off_t *blocks,
int flag);
int Xorriso_assess_written_features(struct XorrisO *xorriso, char *mode,
int flag);
/* Frontend to isoburn_conv_name_chars() */
int Xorriso_conv_name_chars(struct XorrisO *xorriso, char *name,
char **result, size_t *result_len,
int name_space, int flag);
int Xorriso_warn_if_not_exist(struct XorrisO *xorriso, char *prefix,
char *purpose, char *path, int flag);
int Xorriso_warn_if_not_bootcat(struct XorrisO *xorriso, char *prefix,
char *purpose, char *path, int flag);
#endif /* Xorrisoburn_includeD */

View File

@ -9,7 +9,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH XORRISOFS 1 "Version 1.5.0, Sep 15, 2018"
.TH XORRISOFS 1 "Version 1.5.7, May 07, 2024"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@ -167,7 +167,7 @@ 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 upcomming directory tree as add\-on session.
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
@ -194,11 +194,7 @@ 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. Do not let it load the drive, but rather do this manually
or by a program like dd which reads a few bytes. Only then it is sure that
the device driver knows the true readable size of the medium.
.br
dd if=/dev/... count=1 >/dev/null 2>&1
cdrecord emulation.
.br
values=$(xorriso \-as cdrecord dev=/dev/... \-msinfo)
.br
@ -228,6 +224,19 @@ 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\-cut_out\fR disk_path byte_offset byte_count iso_rr_path
Map a byte interval of a regular disk file or of a device file into a regular
file in the ISO image. The file depicted by disk_path has to support random
read access.
.br
byte_offset and byte_count may be plain numbers counting bytes, or numbers
with appended letter "d", "s", "k", "m", "g" to count disk blocks (512 bytes),
disc sectors (2048 bytes), KiB (1024 bytes), MiB (1024 KiB), or GiB (1024 MiB).
.br
E.g:
.br
\-cut_out bootable.iso 562s 18s /formerly_hidden_boot_image
.TP
\fB\-f\fR
.br
Resolve symbolic links on disk rather than storing them as symbolic
@ -271,6 +280,31 @@ deliver their content in uncompressed form.
\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.
@ -672,7 +706,7 @@ restore them on the same systems when extracting files from the ISO image.
\fB--xattr-any\fR
.br
Enable recording and loading of GNU/Linux or FreeBSD extended attributes in
all namespaces. This might need adminstrator privileges, even if the owner
all namespaces. This might need administrator privileges, even if the owner
of the disk file tries to read the attributes.
.TP
\fB--md5\fR
@ -753,6 +787,13 @@ 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"
@ -828,6 +869,22 @@ if their disk_path matches the given shell parser pattern.
Perform \-hide\-hfsplus using each line out of file disk_path as argument
disk_path_pattern.
.TP
\fB\-hide_iso_path\fR hide_state iso_rr_path
Prevent the name of the given file from showing up in the directory trees
of ISO 9660 and/or Joliet and/or HFS+ when the image gets written.
Other than the above hide options, this one takes the path of a file
in the emerging ISO filesystem, not the path of a file on hard disk.
.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\-catalog\-hide
.TP
.B ISO image ID strings:
.PP
The following strings and file addresses get stored in the Primary Volume
@ -1213,13 +1270,14 @@ but may be set to 64 disk blocks by option \-partition_offset 16.
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 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.
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 of type 0xef in MBR.
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
@ -1245,19 +1303,27 @@ 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
\fB\-iso_mbr_part_type\fR "default"|number|type_guid
Set the partition type
of the MBR partition which represents the ISO or at least protects it.
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.
.br
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
@ -1272,6 +1338,17 @@ 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--gpt-iso-bootable\fR
Set bit 2 of the GPT partition flags for the ISO 9660 partition if such a GPT
partition emerges. This bit is specified as "Legacy BIOS bootable" but its
true significance is unclear.
Some GPT\-aware BIOS might want to see it in some partition.
.TP
\fB--gpt-iso-not-ro\fR
Do not set bit 60 of the GPT partition flags for the ISO 9660 partition if such
a GPT partition emerges. This bit is specified as "Read\-only" and thus
appropriate. But it is unusual in GPT disk partitions.
.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
@ -1339,7 +1416,16 @@ 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".
This code matters only with MBR, not with GPT.
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
@ -1352,9 +1438,21 @@ 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.
.br
This option raises the maximum number of appended partitions from 4 to 8.
But it is not guaranteed that the resulting GPT partition will have the
given partition_number. Other GPT partitions may emerge. The final sorting by
start block address may put one of them in the partition entry with the desired
number, so that the appended partition will get a higher number.
.br
Given MBR partition types get translated.
0xef becomes C12A7328\-F81F\-11D2\-BA4B\-00A0C93EC93B, others become
EBD0A0A2\-B9E5\-4433\-87C0\-68B6B72699C7.
.TP
\fB\-appended_part_as_apm\fR
Marks partitions from \-append_partition in Apple Partition Map, too.
The partition number in APM will not be influenced by \-append_partition
parameter partition_number.
.br
By default, appended partitions get marked in APM only if APM is produced
because of other options and \-part_like_isohybrid is enabled.
@ -1519,15 +1617,20 @@ 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 .md5 file which lists those data files which may be
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 .md5 file by a single text line:
Each designated file is represented in the checksum file by a single text line:
.br
MD5 as 32 hex digits, 2 blanks, size as 12 decimal digits or blanks, 2 blanks,
Checksum as hex digits, 2 blanks, size as 12 decimal digits or blanks, 2 blanks,
symbolic file address
.br
The file address in an .md5 line has to bear the same basename as the
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
@ -1538,6 +1641,10 @@ 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.
@ -1553,12 +1660,16 @@ 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-md5\fR disk_path_pattern
\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 .md5
list. A match causes a MISHAP event, which normally does not abort the
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
@ -1567,13 +1678,17 @@ stay in .template in any case.
\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 .md5 file. This file address gets checked
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
Set the disk_path where to find the .md5 input file.
Outdated alias of \-checksum\-list.
.TP
\fB\-jigdo-template-compress\fR "gzip"|"bzip2"
Choose one of "bzip2" or "gzip" for the compression of
@ -1727,7 +1842,7 @@ 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 overwriteable media.
in order to enable multi\-session emulation on overwritable media.
.br
The first session is written like this:
.br
@ -1737,11 +1852,12 @@ The first session is written like this:
.br
| xorriso \-as cdrecord \-v dev=/dev/sr0 blank=fast \-multi \-eject \-
.br
Follow\-up sessions are written like this:
.br
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
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
@ -1749,14 +1865,25 @@ Follow\-up sessions are written like this:
.br
| xorriso \-as cdrecord \-v dev=/dev/sr0 \-waiti \-multi \-eject \-
.br
Always eject the drive tray between sessions. The old sessions
get read via /dev/sr0. Its device driver might not be aware
of the changed content before it loads the medium again.
In this case the previous session would not be loaded and the
new session would contain only the newly added files.
Always eject the drive tray between sessions.
.br
For the same reason do not let xorriso \-as cdrecord load the medium,
but rather do this manually or by a program that reads from /dev/sr0.
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
@ -1809,12 +1936,13 @@ 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
Do not let xorriso \-as cdrecord load the medium,
but rather do this manually or by a program that reads from /dev/sr0.
.br
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
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
@ -1859,7 +1987,7 @@ 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 overwriteable media written by xorriso can tell
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
@ -1909,12 +2037,13 @@ With the first session:
With the second session, option \-old\-root refers to /session1 and the
new \-root is /session2.
.br
Do not let xorriso \-as cdrecord load the medium,
but rather do this manually or by a program that reads from /dev/sr0.
.br
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
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
@ -2109,6 +2238,8 @@ 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
@ -2163,7 +2294,7 @@ Thomas Schmitt <scdbackup@gmx.net>
.br
for libburnia\-project.org
.SH COPYRIGHT
Copyright (c) 2011 \- 2018 Thomas Schmitt
Copyright (c) 2011 \- 2024 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

View File

@ -3,9 +3,9 @@ xorrisofs.texi.
xorrisofs - Emulation of ISO 9660 program mkisofs by program xorriso
Copyright (C) 2011 - 2017 Thomas Schmitt
Copyright (C) 2011 - 2023 Thomas Schmitt
Permission is granted to distrubute this text freely.
Permission is granted to distribute this text freely.
INFO-DIR-SECTION Archiving
START-INFO-DIR-ENTRY
* Xorrisofs: (xorrisofs). Emulates ISO 9660 program mkisofs
@ -14,7 +14,7 @@ END-INFO-DIR-ENTRY

File: xorrisofs.info, Node: Top, Next: Overview, Up: (dir)
xorrisofs 1.5.0
xorrisofs 1.5.7
***************
xorrisofs - Emulation of ISO 9660 program mkisofs by program xorriso
@ -184,7 +184,7 @@ 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 upcomming directory tree as add-on
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.
@ -205,12 +205,7 @@ then a new image is composed from scratch.
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. Do not let it load the drive, but
rather do this manually or by a program like dd which reads a few
bytes. Only then it is sure that the device driver knows the true
readable size of the medium.
dd if=/dev/... count=1 >/dev/null 2>&1
in its cdrecord emulation.
values=$(xorriso -as cdrecord dev=/dev/... -msinfo)
echo $values
@ -241,6 +236,16 @@ File: xorrisofs.info, Node: SetInsert, Next: SetProduct, Prev: Loading, Up:
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.
-cut_out disk_path byte_offset byte_count iso_rr_path
Map a byte interval of a regular disk file or of a device file into
a regular file in the ISO image. The file depicted by disk_path
has to support random read access.
byte_offset and byte_count may be plain numbers counting bytes, or
numbers with appended letter "d", "s", "k", "m", "g" to count disk
blocks (512 bytes), disc sectors (2048 bytes), KiB (1024 bytes),
MiB (1024 KiB), or GiB (1024 MiB).
E.g:
-cut_out bootable.iso 562s 18s /formerly_hidden_boot_image
-f
Resolve symbolic links on disk rather than storing them as symbolic
@ -274,6 +279,26 @@ File: xorrisofs.info, Node: SetInsert, Next: SetProduct, Prev: Loading, Up:
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
@ -614,7 +639,7 @@ File: xorrisofs.info, Node: SetExtras, Next: SetHide, Prev: SetCompl, Up: Op
--xattr-any
Enable recording and loading of GNU/Linux or FreeBSD extended
attributes in all namespaces. This might need adminstrator
attributes in all namespaces. This might need administrator
privileges, even if the owner of the disk file tries to read the
attributes.
--md5
@ -682,6 +707,12 @@ File: xorrisofs.info, Node: SetExtras, Next: SetHide, Prev: SetCompl, Up: Op
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+
@ -749,6 +780,18 @@ File: xorrisofs.info, Node: SetHide, Next: ImageId, Prev: SetExtras, Up: Opt
-hide-hfsplus-list disk_path
Perform -hide-hfsplus using each line out of file disk_path as
argument disk_path_pattern.
-hide_iso_path hide_state iso_rr_path
Prevent the name of the given file from showing up in the directory
trees of ISO 9660 and/or Joliet and/or HFS+ when the image gets
written. Other than the above hide options, this one takes the
path of a file in the emerging ISO filesystem, not the path of a
file on hard disk.
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-catalog-hide

File: xorrisofs.info, Node: ImageId, Next: Bootable, Prev: SetHide, Up: Options
@ -1063,15 +1106,17 @@ Examples:
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
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
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 of type 0xef in MBR. 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.
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
@ -1091,18 +1136,25 @@ Examples:
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
Set 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.
-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.
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
@ -1114,6 +1166,16 @@ Examples:
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.
--gpt-iso-bootable
Set bit 2 of the GPT partition flags for the ISO 9660 partition if
such a GPT partition emerges. This bit is specified as "Legacy
BIOS bootable" but its true significance is unclear. Some
GPT-aware BIOS might want to see it in some partition.
--gpt-iso-not-ro
Do not set bit 60 of the GPT partition flags for the ISO 9660
partition if such a GPT partition emerges. This bit is specified
as "Read-only" and thus appropriate. But it is unusual in GPT disk
partitions.
-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
@ -1168,8 +1230,18 @@ Examples:
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". This code matters only
with MBR, not with GPT.
"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.
@ -1179,9 +1251,19 @@ Examples:
covers the whole output data.
By default, appended partitions get marked in GPT only if GPT is
produced because of other options.
This option raises the maximum number of appended partitions from 4
to 8. But it is not guaranteed that the resulting GPT partition
will have the given partition_number. Other GPT partitions may
emerge. The final sorting by start block address may put one of
them in the partition entry with the desired number, so that the
appended partition will get a higher number.
Given MBR partition types get translated. 0xef becomes
C12A7328-F81F-11D2-BA4B-00A0C93EC93B, others become
EBD0A0A2-B9E5-4433-87C0-68B6B72699C7.
-appended_part_as_apm
Marks partitions from -append_partition in Apple Partition Map,
too.
too. The partition number in APM will not be influenced by
-append_partition parameter partition_number.
By default, appended partitions get marked in APM only if APM is
produced because of other options and -part_like_isohybrid is
enabled.
@ -1325,21 +1407,29 @@ One may determine the ability for Jigdo by:
.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 .md5 file which lists those data
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 .md5
file by a single text line:
MD5 as 32 hex digits, 2 blanks, size as 12 decimal digits or blanks, 2
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 file address in an .md5 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.
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.
@ -1351,12 +1441,14 @@ counted as part of the ISO image.
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-md5 disk_path_pattern
-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 .md5
list. 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.
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
@ -1364,13 +1456,17 @@ counted as part of the ISO image.
-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 .md5 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.
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
Set the disk_path where to find the .md5 input file.
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.
@ -1522,29 +1618,39 @@ File: xorrisofs.info, Node: ExMkisofs, Next: ExGrowisofs, Prev: ExGraft, Up:
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
overwriteable media.
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:
Follow-up sessions are written like this (the run of dd is only to
give demons a chance to spoil it):
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
$ m=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo)
$ 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 old sessions get
read via /dev/sr0. Its device driver might not be aware of the changed
content before it loads the medium again. In this case the previous
session would not be loaded and the new session would contain only the
newly added files.
For the same reason do not let xorriso -as cdrecord load the medium, but
rather do this manually or by a program that reads from /dev/sr0.
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
@ -1597,11 +1703,11 @@ get excluded explicitly.
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.
Do not let xorriso -as cdrecord load the medium, but rather do this
manually or by a program that reads from /dev/sr0.
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.
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
$ msinfo=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo)
$ 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' \
@ -1631,7 +1737,7 @@ MD5 sums against the current file content on hard disk.
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 overwriteable media written by xorriso can
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
@ -1676,11 +1782,11 @@ With the first session:
With the second session, option -old-root refers to /session1 and the
new -root is /session2.
Do not let xorriso -as cdrecord load the medium, but rather do this
manually or by a program that reads from /dev/sr0.
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.
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
$ msinfo=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo)
$ 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 \
@ -1846,7 +1952,9 @@ 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".
--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.
@ -1904,7 +2012,7 @@ for libburnia-project.org
11.2 Copyright
==============
Copyright (c) 2011 - 2018 Thomas Schmitt
Copyright (c) 2011 - 2024 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
@ -1936,13 +2044,16 @@ File: xorrisofs.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: T
* --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 231)
* --gpt-iso-bootable Set Legacy BIOS bootable flag: SystemArea.
(line 159)
* --gpt-iso-not-ro Do not set Read-only flag: SystemArea. (line 164)
* --gpt_disk_guid GPT GUID: SystemArea. (line 270)
* --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 286)
* --grub2-sparc-core SUN SPARC core file: SystemArea. (line 325)
* --hardlinks Recording of hardlink relations: SetExtras. (line 130)
* --mbr-force-bootable Enforce MBR bootable/active flag: SystemArea.
(line 139)
(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)
@ -1951,12 +2062,12 @@ File: xorrisofs.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: T
* --old-empty old block addresses for empty files: SetProduct.
(line 105)
* --old-root-devno enable disk idevno with -old-root: SetInsert.
(line 84)
(line 114)
* --old-root-no-ino disable disk ino with -old-root: SetInsert.
(line 73)
* --old-root-no-md5 disable MD5 with -old-root: SetInsert. (line 91)
(line 103)
* --old-root-no-md5 disable MD5 with -old-root: SetInsert. (line 121)
* --protective-msdos-label Patch System Area partition table: SystemArea.
(line 135)
(line 143)
* --quoted_path_list read pathspecs from disk file: SetInsert.
(line 12)
* --scdbackup_tag Recording of MD5 checksum: SetExtras. (line 138)
@ -1970,42 +2081,50 @@ File: xorrisofs.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: T
(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 65)
* --zisofs2-susp-z2 produce Z2 for version 2 instead of ZF: SetInsert.
(line 76)
* --zisofs2-susp-zf produce ZF for version 2 instead of Z2: SetInsert.
(line 80)
* -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 309)
* -alpha-boot DEC Alpha SRM bootloader: SystemArea. (line 348)
* -appended_part_as_apm Appended partitions in APM: SystemArea.
(line 215)
(line 253)
* -appended_part_as_gpt Appended partitions in GPT: SystemArea.
(line 209)
(line 238)
* -append_partition Append MBR or GPT partition after image: SystemArea.
(line 189)
(line 208)
* -appid set Application Id: ImageId. (line 41)
* -b El Torito PC-BIOS boot image: Bootable. (line 38)
* -B SUN SPARC boot images: SystemArea. (line 271)
* -B SUN SPARC boot images: SystemArea. (line 310)
* -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 46)
* -checksum_algorithm_iso choose .jigdo checksums: Jigdo. (line 72)
(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 78)
* -chrp-boot CHRP partition: SystemArea. (line 253)
* -chrp-boot-part CHRP partition: SystemArea. (line 244)
(line 92)
* -chrp-boot CHRP partition: SystemArea. (line 292)
* -chrp-boot-part CHRP partition: SystemArea. (line 283)
* -copyright set Copyright File path: ImageId. (line 66)
* -D allow deep directory hierachies: SetExtras. (line 60)
* -cut_out insert piece of data file or device: SetInsert. (line 22)
* -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 hierachies: SetExtras.
* -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 221)
* -efi-boot-part EFI boot partition: SystemArea. (line 260)
* -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)
@ -2013,31 +2132,31 @@ File: xorrisofs.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: T
* -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)
* -exclude exclude disk files from inserting: SetInsert. (line 47)
* -exclude-list exclude disk files from inserting: SetInsert. (line 54)
* -f follow symbolic links on disk: SetInsert. (line 32)
* -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)
* -follow-links follow symbolic links on disk: SetInsert. (line 36)
* -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)
* -graft-points enable target=source pathspecs: SetInsert. (line 38)
* -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 215)
* -hfs-bless-by HFS+ blessing: SetExtras. (line 205)
* -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 195)
* -hfsplus-block-size set APM block size: SetExtras. (line 201)
* -hfsplus-block-size set HFS+ allocation block size: SetExtras.
(line 191)
(line 197)
* -hfsplus-file-creator-type HFS+ creator-type attribute: SetExtras.
(line 202)
* -hfsplus-serial-no set HFS+ serial number: SetExtras. (line 187)
(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)
@ -2051,50 +2170,57 @@ File: xorrisofs.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: T
(line 15)
* -hide-rr-moved set deep directory relocation target: SetExtras.
(line 90)
* -hppa-bootloader HP-PA bootloader file: SystemArea. (line 298)
* -hppa-cmdline HP-PA PALO command line: SystemArea. (line 292)
* -hppa-hdrversion HP-PA PALO header version: SystemArea. (line 306)
* -hppa-kernel_32 HP-PA kernel_32 file: SystemArea. (line 300)
* -hppa-kernel_64 HP-PA kernel_64 file: SystemArea. (line 302)
* -hppa-ramdisk HP-PA ramdisk file: SystemArea. (line 304)
* -hide_iso_path keep a file invisible in ISO tree: SetHide. (line 31)
* -hppa-bootloader HP-PA bootloader file: SystemArea. (line 337)
* -hppa-cmdline HP-PA PALO command line: SystemArea. (line 331)
* -hppa-hdrversion HP-PA PALO header version: SystemArea. (line 345)
* -hppa-kernel_32 HP-PA kernel_32 file: SystemArea. (line 339)
* -hppa-kernel_64 HP-PA kernel_64 file: SystemArea. (line 341)
* -hppa-ramdisk HP-PA ramdisk file: SystemArea. (line 343)
* -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 112)
* -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 108)
* -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 127)
(line 129)
* -J enable production of Joliet directory tree: SetExtras. (line 147)
* -jigdo-exclude add exclusion pattern for .md5: Jigdo. (line 55)
* -jigdo-force-md5 add check pattern for .md5: Jigdo. (line 49)
* -jigdo-jigdo set name of .jigdo file: Jigdo. (line 38)
* -jigdo-map add address translation for .jigdo: Jigdo. (line 59)
* -jigdo-min-file-size set minimum extract size: Jigdo. (line 44)
* -jigdo-template set name of .template file: Jigdo. (line 41)
* -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 69)
(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 exclude disk files from inserting: SetInsert. (line 41)
* -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 readable .md5: Jigdo. (line 67)
* -mips-boot MIPS Big Endian boot image: SystemArea. (line 260)
* -mipsel-boot MIPS Little Endian boot image: SystemArea. (line 266)
* -md5-list set path of input checksum file: Jigdo. (line 81)
* -mips-boot MIPS Big Endian boot image: SystemArea. (line 299)
* -mipsel-boot MIPS Little Endian boot image: SystemArea. (line 305)
* -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 60)
* -old-exclude exclude disk files from inserting: SetInsert. (line 52)
* -old-root enable incremental insertion: SetInsert. (line 90)
* -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)
@ -2104,15 +2230,15 @@ File: xorrisofs.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: T
* -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 178)
* -partition_hd_cyl MBR heads per cylinder: SystemArea. (line 161)
* -partition_cyl_align Image size alignment: SystemArea. (line 197)
* -partition_hd_cyl MBR heads per cylinder: SystemArea. (line 180)
* -partition_offset Make mountable by partition 1: SystemArea.
(line 150)
* -partition_sec_hd MBR sectors per head: SystemArea. (line 164)
(line 169)
* -partition_sec_hd MBR sectors per head: SystemArea. (line 183)
* -part_like_isohybrid Mark partitions like with isohybrid: SystemArea.
(line 120)
(line 122)
* -path-list read pathspecs from disk file: SetInsert. (line 8)
* -prep-boot-part PReP partition: SystemArea. (line 255)
* -prep-boot-part PReP partition: SystemArea. (line 294)
* -preparer set Preparer Id: ImageId. (line 55)
* -prev-session set path for loading existing ISO image: Loading.
(line 21)
@ -2126,27 +2252,27 @@ File: xorrisofs.info, Node: CommandIdx, Next: ConceptIdx, Prev: Legal, Up: T
* -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 55)
* -root redirect ISO root directory: SetInsert. (line 85)
* -rr_reloc_dir set deep directory relocation target: SetExtras.
(line 74)
* -sparc-boot SUN SPARC boot images: SystemArea. (line 282)
* -sparc-label SUN Disk Label text: SystemArea. (line 284)
* -sparc-boot SUN SPARC boot images: SystemArea. (line 321)
* -sparc-label SUN Disk Label text: SystemArea. (line 323)
* -sysid set System Id: ImageId. (line 43)
* -transparent-compression enable recognition of zisofs files: SetInsert.
(line 53)
(line 63)
* -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 verbous messages: Miscellaneous. (line 38)
* -v enable verbose messages: Miscellaneous. (line 38)
* -V set Volume Id: ImageId. (line 13)
* -verbose enable verbous messages: Miscellaneous. (line 41)
* -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)
* -x exclude disk files from inserting: SetInsert. (line 49)
* -z enable recognition of zisofs files: SetInsert. (line 57)

File: xorrisofs.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
@ -2160,7 +2286,7 @@ File: xorrisofs.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* 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 215)
(line 253)
* APM, _definition: SystemArea. (line 16)
* Application Id, set, -A, -appid: ImageId. (line 34)
* Backup, enable fidelity, --for_backup: SetExtras. (line 92)
@ -2184,51 +2310,55 @@ File: xorrisofs.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* Bootability, boot image patching, -boot-info-table: Bootable.
(line 104)
* Bootability, bootable MBR partition, --mbr-force-bootable: SystemArea.
(line 139)
* Bootability, control, --grub2-sparc-core: SystemArea. (line 286)
(line 148)
* Bootability, control, --grub2-sparc-core: SystemArea. (line 325)
* Bootability, control, --efi-boot: Bootable. (line 59)
* Bootability, control, -alpha-boot: SystemArea. (line 309)
* Bootability, control, -alpha-boot: SystemArea. (line 348)
* Bootability, control, -b, -eltorito-boot: Bootable. (line 38)
* Bootability, control, -B, -sparc-boot: SystemArea. (line 271)
* Bootability, control, -B, -sparc-boot: SystemArea. (line 310)
* Bootability, control, -e: Bootable. (line 53)
* Bootability, control, -eltorito-platform: Bootable. (line 63)
* Bootability, control, -hppa-bootloader: SystemArea. (line 298)
* Bootability, control, -hppa-cmdline: SystemArea. (line 292)
* Bootability, control, -hppa-hdrversion: SystemArea. (line 306)
* Bootability, control, -hppa-kernel_32: SystemArea. (line 300)
* Bootability, control, -hppa-kernel_64: SystemArea. (line 302)
* Bootability, control, -hppa-ramdisk: SystemArea. (line 304)
* Bootability, control, -mips-boot: SystemArea. (line 260)
* Bootability, control, -mipsel-boot: SystemArea. (line 266)
* Bootability, control, -hppa-bootloader: SystemArea. (line 337)
* Bootability, control, -hppa-cmdline: SystemArea. (line 331)
* Bootability, control, -hppa-hdrversion: SystemArea. (line 345)
* Bootability, control, -hppa-kernel_32: SystemArea. (line 339)
* Bootability, control, -hppa-kernel_64: SystemArea. (line 341)
* Bootability, control, -hppa-ramdisk: SystemArea. (line 343)
* Bootability, control, -mips-boot: SystemArea. (line 299)
* Bootability, control, -mipsel-boot: SystemArea. (line 305)
* 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 244)
* Bootability, for EFI, -efi-boot-part: SystemArea. (line 221)
* Bootability, for PReP, -prep-boot-part: SystemArea. (line 255)
* Bootability, for CHRP, -chrp-boot-part: SystemArea. (line 283)
* Bootability, for EFI, -efi-boot-part: SystemArea. (line 260)
* Bootability, for PReP, -prep-boot-part: SystemArea. (line 294)
* Bootability, GPT Legacy BIOS bootable, --gpt-iso-bootable: SystemArea.
(line 159)
* Bootability, GPT Read-only flag, --gpt-iso-not-ro: SystemArea.
(line 164)
* 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 112)
(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 108)
(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 120)
(line 122)
* Bootability, patch System Area partition table, --protective-msdos-label: SystemArea.
(line 135)
* Bootability, SUN Disk Label text, -sparc-label: SystemArea. (line 284)
(line 143)
* Bootability, SUN Disk Label text, -sparc-label: SystemArea. (line 323)
* Bootability, type of ISO MBR partition, -iso_mbr_part_type: SystemArea.
(line 127)
(line 129)
* Bugs, reporting: Bugreport. (line 6)
* Character Set, for disk file names, -input-charset: Charset.
(line 17)
@ -2242,10 +2372,10 @@ File: xorrisofs.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
(line 90)
* Deep directories, relocation target, -rr_reloc_dir: SetExtras.
(line 74)
* Disk files, exclude, -hide-list: SetInsert. (line 44)
* Disk files, exclude, -exclude-list: SetInsert. (line 54)
* Disk files, exclude, -m, -exclude, -x, -old-exclude: SetInsert.
(line 31)
* Disk GUID, for GPT, --gpt_disk_guid: SystemArea. (line 231)
(line 41)
* Disk GUID, for GPT, --gpt_disk_guid: SystemArea. (line 270)
* disk_path, _definition: Insert. (line 7)
* ECMA-119, _definition: Standards. (line 6)
* El Torito, _definition: Bootable. (line 13)
@ -2254,32 +2384,34 @@ File: xorrisofs.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* 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 209)
(line 238)
* 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 215)
* HFS+, issue blessing, -hfs-bless-by: SetExtras. (line 205)
* HFS+, set allocation block size: SetExtras. (line 191)
* HFS+, set APM block size: SetExtras. (line 195)
* 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 202)
* HFS+, set serial number: SetExtras. (line 187)
(line 208)
* HFS+, set serial number: SetExtras. (line 193)
* HFS+, _definition: Standards. (line 32)
* Hiding, by ISO RR path, -hide_iso_path: SetHide. (line 31)
* 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 178)
* Image size, alignment, -partition_cyl_align: SystemArea. (line 197)
* Incremental insertion, disable disk ino, --old-root-no-ino: SetInsert.
(line 73)
(line 103)
* Incremental insertion, disable MD5, --old-root-no-md5: SetInsert.
(line 91)
(line 121)
* Incremental insertion, enable disk devno, --old-root-devno: SetInsert.
(line 84)
* Incremental insertion, enable, -old-root: SetInsert. (line 60)
(line 114)
* Incremental insertion, enable, -old-root: SetInsert. (line 90)
* Insert, piece of data file or device, -cut_out: SetInsert. (line 22)
* Interval reader for system area and partitions: SystemArea. (line 24)
* ISO 9660, _definition: Standards. (line 6)
* ISO 9660:1999, _definition: Standards. (line 26)
@ -2307,42 +2439,46 @@ File: xorrisofs.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
(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 55)
* ISO root directory, redirect, -root: SetInsert. (line 85)
* iso_rr_path, _definition: Insert. (line 8)
* Jigdo Template Extraction, -checksum_algorithm_iso: Jigdo. (line 72)
* 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 78)
* Jigdo Template Extraction, -jigdo-exclude: Jigdo. (line 55)
* Jigdo Template Extraction, -jigdo-force-md5: Jigdo. (line 49)
* Jigdo Template Extraction, -jigdo-jigdo: Jigdo. (line 38)
* Jigdo Template Extraction, -jigdo-map: Jigdo. (line 59)
* Jigdo Template Extraction, -jigdo-min-file-size: Jigdo. (line 44)
* Jigdo Template Extraction, -jigdo-template: Jigdo. (line 41)
* Jigdo Template Extraction, -jigdo-template-compress: Jigdo. (line 69)
* Jigdo Template Extraction, -md5-list: Jigdo. (line 67)
(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, follow on disk, -f, -follow-links: SetInsert. (line 32)
* Links, record and load hard links, --hardlinks: SetExtras. (line 130)
* MBR, GPT, append partition, -append_partition: SystemArea. (line 189)
* MBR, sectors per head, -partition_sec_hd: SystemArea. (line 161)
* MBR, sectors per head, -partition_sec_hd <1>: SystemArea. (line 164)
* MBR, GPT, append partition, -append_partition: SystemArea. (line 208)
* MBR, sectors per head, -partition_sec_hd: SystemArea. (line 180)
* MBR, sectors per head, -partition_sec_hd <1>: SystemArea. (line 183)
* 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 150)
(line 169)
* 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, enable target=source, -graft-points: SetInsert. (line 38)
* pathspec, read list of, --quoted_path_list: SetInsert. (line 12)
* pathspec, read list of, -path-list: SetInsert. (line 8)
* pathspec, _definition: Insert. (line 11)
@ -2374,8 +2510,14 @@ File: xorrisofs.info, Node: ConceptIdx, Prev: CommandIdx, Up: Top
* 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 76)
* ZF instead of Z2 for version 2, -zisofs2-susp-zf: SetInsert.
(line 80)
* zisofs file, enable recognition, -z, -transparent-compression: SetInsert.
(line 47)
(line 57)
* zisofs2 file, enable recognition, -zisofs-version-2: SetInsert.
(line 65)

@ -2387,31 +2529,31 @@ Node: Insert3770
Node: Xorriso5616
Node: Options6762
Node: Loading7489
Node: SetInsert9789
Node: SetProduct14198
Node: SetCompl19769
Node: SetExtras22361
Node: SetHide33655
Node: ImageId34959
Node: Bootable39241
Node: SystemArea45527
Node: Charset62893
Node: Jigdo63918
Node: Miscellaneous68195
Node: Examples69840
Node: ExSimple70334
Node: ExGraft70817
Node: ExMkisofs72117
Node: ExGrowisofs73383
Node: ExIncBackup74573
Node: ExIncBckAcc77734
Node: ExBootable79423
Node: Files83605
Node: Environ84700
Node: Seealso85471
Node: Bugreport86122
Node: Legal86715
Node: CommandIdx87612
Node: ConceptIdx103479
Node: SetInsert9530
Node: SetProduct15465
Node: SetCompl21036
Node: SetExtras23628
Node: SetHide35237
Node: ImageId37236
Node: Bootable41518
Node: SystemArea47804
Node: Charset67532
Node: Jigdo68557
Node: Miscellaneous73527
Node: Examples75172
Node: ExSimple75666
Node: ExGraft76149
Node: ExMkisofs77449
Node: ExGrowisofs79257
Node: ExIncBackup80447
Node: ExIncBckAcc83623
Node: ExBootable85328
Node: Files89510
Node: Environ90605
Node: Seealso91478
Node: Bugreport92129
Node: Legal92722
Node: CommandIdx93619
Node: ConceptIdx110757

End Tag Table

View File

@ -1,7 +1,7 @@
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename xorrisofs.info
@settitle GNU xorrisofs 1.5.0
@settitle GNU xorrisofs 1.5.7
@c %**end of header
@c
@c man-ignore-lines begin
@ -50,7 +50,7 @@
@c man .\" First parameter, NAME, should be all caps
@c man .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
@c man .\" other parameters are allowed: see man(7), man(1)
@c man .TH XORRISOFS 1 "Version 1.5.0, Sep 15, 2018"
@c man .TH XORRISOFS 1 "Version 1.5.7, May 07, 2024"
@c man .\" Please adjust this date whenever revising the manpage.
@c man .\"
@c man .\" Some roff macros, for reference:
@ -68,15 +68,15 @@
@copying
xorrisofs - Emulation of ISO 9660 program mkisofs by program xorriso
Copyright @copyright{} 2011 - 2017 Thomas Schmitt
Copyright @copyright{} 2011 - 2023 Thomas Schmitt
@quotation
Permission is granted to distrubute this text freely.
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.0
@title Manual of GNU xorriso personality xorrisofs 1.5.7
@author Thomas Schmitt
@page
@vskip 0pt plus 1filll
@ -85,7 +85,7 @@ Permission is granted to distrubute this text freely.
@contents
@ifnottex
@node Top
@top xorrisofs 1.5.0
@top xorrisofs 1.5.7
@c man-ignore-lines 1
@c man .SH NAME
@ -294,7 +294,7 @@ If they are missing then a new image is composed from scratch.
@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 upcomming directory tree as add-on session.
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.
@*
@ -325,12 +325,7 @@ 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. Do not let it load the drive, but rather do this manually
or by a program like dd which reads a few bytes. Only then it is sure that
the device driver knows the true readable size of the medium.
@*
@sp 1
dd if=/dev/... count=1 >/dev/null 2>&1
cdrecord emulation.
@*
values=$(xorriso -as cdrecord dev=/dev/... -msinfo)
@*
@ -371,6 +366,21 @@ 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 -cut_out disk_path byte_offset byte_count iso_rr_path
@kindex -cut_out insert piece of data file or device
@cindex Insert, piece of data file or device, -cut_out
Map a byte interval of a regular disk file or of a device file into a regular
file in the ISO image. The file depicted by disk_path has to support random
read access.
@*
byte_offset and byte_count may be plain numbers counting bytes, or numbers
with appended letter "d", "s", "k", "m", "g" to count disk blocks (512 bytes),
disc sectors (2048 bytes), KiB (1024 bytes), MiB (1024 KiB), or GiB (1024 MiB).
@*
E.g:
@*
-cut_out bootable.iso 562s 18s /formerly_hidden_boot_image
@c man .TP
@item -f
@kindex -f follow symbolic links on disk
@cindex Links, follow on disk, -f, -follow-links
@ -413,7 +423,7 @@ 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
@cindex Disk files, exclude, -exclude-list
Perform -m using each line out of file disk_path as argument disk_pattern.
@c man .TP
@item -z
@ -429,6 +439,37 @@ deliver their content in uncompressed form.
@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
@ -849,7 +890,7 @@ 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 hierachies
@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
@ -865,7 +906,7 @@ 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 hierachies
@kindex -disable-deep-relocation allow deep directory hierarchies
Alias of -D.
@c man .TP
@item -rr_reloc_dir name
@ -937,7 +978,7 @@ restore them on the same systems when extracting files from the ISO image.
@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 adminstrator privileges, even if the owner
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
@ -1033,6 +1074,13 @@ 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
@ -1136,6 +1184,24 @@ if their disk_path matches the given shell parser pattern.
@cindex Hiding, from HFS+, -hide-hfsplus-list
Perform -hide-hfsplus using each line out of file disk_path as argument
disk_path_pattern.
@c man .TP
@item -hide_iso_path hide_state iso_rr_path
@kindex -hide_iso_path keep a file invisible in ISO tree
@cindex Hiding, by ISO RR path, -hide_iso_path
Prevent the name of the given file from showing up in the directory trees
of ISO 9660 and/or Joliet and/or HFS+ when the image gets written.
Other than the above hide options, this one takes the path of a file
in the emerging ISO filesystem, not the path of a file on hard disk.
@*
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: @minus{}@minus{}boot-catalog-hide
@end table
@c man .TP
@c man .B ISO image ID strings:
@ -1612,13 +1678,14 @@ For the meaning of special disk_path "." see option -G.
@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 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.
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 of type 0xef in MBR.
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
@ -1650,23 +1717,31 @@ 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
@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 partition which represents the ISO or at least protects it.
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
@ -1683,6 +1758,21 @@ 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 @minus{}@minus{}gpt-iso-bootable
@kindex @minus{}@minus{}gpt-iso-bootable Set Legacy BIOS bootable flag
@cindex Bootability, GPT Legacy BIOS bootable, @minus{}@minus{}gpt-iso-bootable
Set bit 2 of the GPT partition flags for the ISO 9660 partition if such a GPT
partition emerges. This bit is specified as "Legacy BIOS bootable" but its
true significance is unclear.
Some GPT-aware BIOS might want to see it in some partition.
@c man .TP
@item @minus{}@minus{}gpt-iso-not-ro
@kindex @minus{}@minus{}gpt-iso-not-ro Do not set Read-only flag
@cindex Bootability, GPT Read-only flag, @minus{}@minus{}gpt-iso-not-ro
Do not set bit 60 of the GPT partition flags for the ISO 9660 partition if such
a GPT partition emerges. This bit is specified as "Read-only" and thus
appropriate. But it is unusual in GPT disk partitions.
@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
@ -1760,7 +1850,16 @@ 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".
This code matters only with MBR, not with GPT.
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
@ -1775,11 +1874,23 @@ 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.
@*
This option raises the maximum number of appended partitions from 4 to 8.
But it is not guaranteed that the resulting GPT partition will have the
given partition_number. Other GPT partitions may emerge. The final sorting by
start block address may put one of them in the partition entry with the desired
number, so that the appended partition will get a higher number.
@*
Given MBR partition types get translated.
0xef becomes C12A7328-F81F-11D2-BA4B-00A0C93EC93B, others become
EBD0A0A2-B9E5-4433-87C0-68B6B72699C7.
@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.
The partition number in APM will not be influenced by -append_partition
parameter partition_number.
@*
By default, appended partitions get marked in APM only if APM is produced
because of other options and -part_like_isohybrid is enabled.
@ -1995,15 +2106,20 @@ 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 .md5 file which lists those data files which may be
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 .md5 file by a single text line:
Each designated file is represented in the checksum file by a single text line:
@*
MD5 as 32 hex digits, 2 blanks, size as 12 decimal digits or blanks, 2 blanks,
Checksum as hex digits, 2 blanks, size as 12 decimal digits or blanks, 2 blanks,
symbolic file address
@*
The file address in an .md5 line has to bear the same basename as the
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
@ -2016,6 +2132,12 @@ 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
@ -2037,16 +2159,22 @@ 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-md5 disk_path_pattern
@kindex -jigdo-force-md5 add check pattern for .md5
@cindex Jigdo Template Extraction, -jigdo-force-md5
@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 .md5
list. A match causes a MISHAP event, which normally does not abort the
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 .md5
@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
@ -2057,15 +2185,21 @@ stay in .template in any case.
@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 .md5 file. This file address gets checked
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 readable .md5
@kindex -md5-list set path of input checksum file
@cindex Jigdo Template Extraction, -md5-list
Set the disk_path where to find the .md5 input file.
Outdated alias of -checksum-list.
@c man .TP
@item -jigdo-template-compress "gzip"|"bzip2"
@kindex -jigdo-template-compress choose compression algorithm
@ -2146,13 +2280,13 @@ 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 verbous messages
@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 verbous messages
@kindex -verbose enable verbose messages
Alias of -v.
@c man .TP
@item -version
@ -2283,7 +2417,7 @@ 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 overwriteable media.
in order to enable multi-session emulation on overwritable media.
@*
The first session is written like this:
@*
@ -2295,12 +2429,13 @@ The first session is written like this:
| xorriso -as cdrecord -v dev=/dev/sr0 blank=fast -multi -eject -
@*
@sp 1
Follow-up sessions are written like this:
Follow-up sessions are written like this (the run of dd is only to give demons
a chance to spoil it):
@*
@sp 1
$ dd if=/dev/sr0 count=1 >/dev/null 2>&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 \
@*
@ -2309,14 +2444,25 @@ Follow-up sessions are written like this:
| xorriso -as cdrecord -v dev=/dev/sr0 -waiti -multi -eject -
@*
@sp 1
Always eject the drive tray between sessions. The old sessions
get read via /dev/sr0. Its device driver might not be aware
of the changed content before it loads the medium again.
In this case the previous session would not be loaded and the
new session would contain only the newly added files.
Always eject the drive tray between sessions.
@*
For the same reason do not let xorriso -as cdrecord load the medium,
but rather do this manually or by a program that reads from /dev/sr0.
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
@ -2379,13 +2525,14 @@ 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.
@*
Do not let xorriso -as cdrecord load the medium,
but rather do this manually or by a program that reads from /dev/sr0.
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
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
@*
$ msinfo=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo)
@*
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
@*
$ load_opts=
@*
@ -2434,7 +2581,7 @@ 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 overwriteable media written by xorriso can tell
Multi-session media and most overwritable media written by xorriso can tell
the sbsectors of their sessions by xorriso option -toc:
@*
@sp 1
@ -2496,13 +2643,14 @@ With the first session:
With the second session, option -old-root refers to /session1 and the
new -root is /session2.
@*
Do not let xorriso -as cdrecord load the medium,
but rather do this manually or by a program that reads from /dev/sr0.
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
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
@*
$ msinfo=$(xorriso -as cdrecord dev=/dev/sr0 -msinfo)
@*
$ dd if=/dev/sr0 count=1 >/dev/null 2>&1
@*
$ load_opts=
@*
@ -2731,6 +2879,8 @@ 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
@ -2827,7 +2977,7 @@ Thomas Schmitt <scdbackup@@gmx.net>
for libburnia-project.org
@c man .SH COPYRIGHT
@section Copyright
Copyright (c) 2011 - 2018 Thomas Schmitt
Copyright (c) 2011 - 2024 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