12 #include "../config.h"
16 #include <sys/types.h>
37 for(i= 0; i < argc; i++) {
38 if(strcmp(argv[i],
"dev=-") == 0 ||
39 strcmp(argv[i],
"dev=stdio:/dev/fd/1") == 0 ||
40 strcmp(argv[i],
"-dev=-") == 0 ||
41 strcmp(argv[i],
"-dev=stdio:/dev/fd/1") == 0)
50 static char helptext[][80]= {
51 "Usage: xorriso -as cdrecord [options|source_addresses]",
52 "Note: This is not cdrecord. See xorriso -help, xorriso -version, man xorrecord",
54 "\t-version\tprint version information and exit emulation",
55 "\t--devices\tprint list of available MMC drives and exit emulation",
56 "\tdev=target\tpseudo-SCSI target to use as CD-Recorder",
57 "\tdrive_scsi_dev_family=sr|scd|sg\t\tselect Linux device type",
58 "\t--drive_not_exclusive\tdo not try to prevent use of busy drive",
59 "\t-v\t\tincrement verbose level by one",
60 "\t-V\t\tincrement SCSI command transport verbose level by one",
61 "\t-checkdrive\tcheck if a driver for the drive is present",
62 "\t-inq\t\tdo an inquiry for the drive",
63 "\tspeed=#\t\tset speed of drive",
64 "\tblank=type\tblank a CD-RW disc (see blank=help)",
65 "\tfs=#\t\tSet fifo size to # (0 to disable, default is 4 MB)",
66 "\t-eject\t\teject the disk after doing the work",
67 "\t-dummy\t\tdo everything with laser turned off",
68 "\t-msinfo\t\tretrieve multi-session info for mkisofs >= 1.10",
69 "\t-toc\t\tretrieve and print TOC/PMA data",
70 "\t-atip\t\tretrieve media state, print \"Is *erasable\"",
71 "\t-multi\t\tgenerate a TOC that allows multi session",
72 "\t--multi_if_possible\tapply -multi if the medium supports it",
73 "\t-waiti\t\twait until input is available before opening SCSI",
74 "\t-tao\t\tWrite disk in TAO mode.",
75 "\t-dao\t\tWrite disk in SAO mode.",
76 "\t-sao\t\tWrite disk in SAO mode.",
77 "\ttsize=#\t\tannounces exact size of source data",
78 "\tpadsize=#\tAmount of padding",
79 "\t-data\t\tSubsequent tracks are CD-ROM data mode 1 (default)",
80 "\t-isosize\tUse iso9660 file system size for next data track",
81 "\t-pad\t\tpadsize=30k",
82 "\t-nopad\t\tDo not pad",
83 "\tminbuf=\t\tKeep drive buffer hungry",
84 "\tmodesty_on_drive=\tLike minbuf=, but with more parameters",
85 "\t-immed\t\tEquivalent to minbuf=75",
86 "\t--grow_overwriteable_iso\temulate multi-session on DVD+RW, BD-RE",
87 "\twrite_start_address=#\t\twrite to byte address on DVD+RW, BD-RE",
88 "\tstream_recording=on|number\ttry to get full speed on DVD-RAM, BD",
89 "\tuse_immed_bit=on|off|default\tcontrol use of Immed bit",
90 "\tdvd_obs=default|32k|64k\t\tbytes per DVD/BD write operation",
91 "\tstdio_sync=on|off|end|number\twhether to fsync output to \"stdio:\"",
92 "\t--no_rc\t\tDo not execute xorriso startup files",
93 "\t-help\t\tprint this text to stderr and exit emulation",
94 "Actually this is the integrated ISO RockRidge filesystem manipulator xorriso",
95 "lending its libburn capabilities to a very limited cdrecord emulation. Only",
96 "a single data track can be burnt to blank, appendable or overwritable media.",
97 "A much more elaborate cdrecord emulator is cdrskin from the libburn package.",
99 #ifdef Xorriso_GNU_xorrisO
100 "Report bugs to: bug-xorriso@gnu.org , or in private to: scdbackup@gmx.net .",
101 "xorriso home page: <https://www.gnu.org/software/xorriso/>",
102 "General help using GNU software: <https://www.gnu.org/gethelp/>",
104 "Report any bugs to bug-xorriso@gnu.org or in private to scdbackup@gmx.net .",
110 for(i= 0; strcmp(helptext[i],
"@End_of_helptexT@")!=0; i++) {
111 sprintf(xorriso->
info_text,
"%s\n", helptext[i]);
122 int ret, i, k, mem_do_close, aq_ret, eject_ret, msc1, msc2, hflag;
123 int do_atip= 0, do_checkdrive= 0, do_eject= 0, do_scanbus= 0;
124 int do_toc= 0, do_verbous= 0, do_version= 0, do_help= 0, do_waiti= 0;
125 int do_multi= 0, do_msinfo= 0, do_grow= 0, do_isosize= 0, do_xa1= 0;
126 int do_auto_close= 0;
127 double write_start_address= -1.0, tsize= -1.0, mem_auto_close;
128 char *track_source= NULL, *dev_adr= NULL, *cpt;
129 char mem_report_about_text[80], *report_about=
"SORRY", blank_mode[80];
130 char speed[80], *argpt;
133 static char ignored_partial_options[][41]= {
134 "timeout=",
"debug=",
"kdebug=",
"kd=",
"driver=",
"ts=",
135 "pregap=",
"defpregap=",
"mcn=",
"isrc=",
"index=",
"textfile=",
136 "pktsize=",
"cuefile=",
139 "assert_write_lba=",
"fifo_start_at=",
"dev_translation=",
143 "direct_write_amount=",
"msifile=",
147 static char ignored_full_options[][41]= {
148 "-d",
"-silent",
"-s",
"-setdropts",
"-prcap",
149 "-reset",
"-abort",
"-overburn",
"-ignsize",
"-useinfo",
151 "-raw",
"-raw96p",
"-raw16",
153 "-cdi",
"-preemp",
"-nopreemp",
"-copy",
"-nocopy",
154 "-scms",
"-shorttrack",
"-noshorttrack",
"-packet",
"-noclose",
155 "-media-info",
"-minfo",
156 "-load",
"-lock",
"-raw96r",
"-swab",
159 "--adjust_speed_to_drive",
"--allow_emulated_drives",
"--allow_setuid",
160 "--allow_untested_media",
"--any_track",
"--demand_a_drive",
161 "--fifo_disable",
"--fifo_start_empty",
"--fill_up_media",
162 "--list_ignored_options",
"--no_rc",
"--no_convert_fs_adr",
163 "--prodvd_cli_compatible",
"--single_track",
164 "--tell_media_space",
169 static char blank_help[][80]= {
171 "\tall\t\tblank the entire disk",
172 "\tdisc\t\tblank the entire disk",
173 "\tdisk\t\tblank the entire disk",
174 "\tfast\t\tminimally blank the entire disk",
175 "\tminimal\t\tminimally blank the entire disk",
176 "\tas_needed\tblank or format medium to make it ready for (re-)use",
177 "\tdeformat\t\tblank a formatted DVD-RW",
178 "\tdeformat_quickest\tminimally blank a formatted DVD-RW to DAO only",
179 "\tformat_overwrite\tformat a DVD-RW to \"Restricted Overwrite\"",
203 for(i= 0; i<argc; i++) {
204 sprintf(xorriso->
info_text,
"-as %s: ", whom);
209 if (strncmp(argpt,
"--", 2) == 0 && strlen(argpt) > 3)
212 for(k=0;ignored_partial_options[k][0]!=0;k++) {
214 if(strncmp(argpt+1,ignored_partial_options[k],
215 strlen(ignored_partial_options[k]))==0) {
219 if(strncmp(argpt,ignored_partial_options[k],
220 strlen(ignored_partial_options[k]))==0)
223 for(k=0;ignored_full_options[k][0]!=0;k++)
224 if(strcmp(argpt,ignored_full_options[k])==0)
228 sprintf(xorriso->
info_text,
"-as %s: Ignored option ", whom);
234 if(strcmp(argpt,
"-atip")==0) {
236 }
else if(strcmp(argpt,
"-audio")==0) {
237 sprintf(xorriso->
info_text,
"-as %s: Option -audio not supported.", whom);
240 }
else if(strncmp(argpt,
"-blank=", 7)==0 ||
241 strncmp(argpt,
"blank=", 6)==0) {
242 cpt= strchr(argpt,
'=')+1;
243 if(strcmp(cpt,
"all")==0 || strcmp(cpt,
"disc")==0
244 || strcmp(cpt,
"disk")==0) {
245 strcpy(blank_mode,
"all");
246 }
else if(strcmp(cpt,
"fast")==0 || strcmp(cpt,
"minimal")==0) {
247 strcpy(blank_mode,
"fast");
248 }
else if(strcmp(cpt,
"help")==0) {
249 strcpy(blank_mode,
"help");
250 }
else if(strcmp(cpt,
"deformat")==0 ||
251 strcmp(cpt,
"deformat_sequential")==0 ||
252 strcmp(cpt,
"deformat_quickest")==0 ||
253 strcmp(cpt,
"deformat_sequential_quickest")==0) {
254 strcpy(blank_mode, cpt);
255 }
else if(strcmp(cpt,
"format_overwrite")==0) {
256 strcpy(blank_mode,
"format_overwrite");
257 }
else if(strcmp(cpt,
"as_needed")==0) {
258 strcpy(blank_mode,
"as_needed");
260 sprintf(xorriso->
info_text,
"-as %s: blank=", whom);
262 strcat(xorriso->
info_text,
" not supported. See blank=help .");
266 }
else if(strcmp(argpt,
"-checkdrive")==0) {
268 }
else if(strcmp(argpt,
"-dao")==0) {
270 }
else if(strcmp(argpt,
"-data")==0) {
272 }
else if(strncmp(argpt,
"-dev=", 5)==0 ||
273 strncmp(argpt,
"dev=", 4)==0) {
274 cpt= strchr(argpt,
'=')+1;
275 strcpy(dev_adr, cpt);
276 }
else if(strcmp(argv[i],
"--devices")==0) {
278 }
else if(strcmp(argv[i],
"--drive_not_exclusive") == 0) {
280 }
else if(strncmp(argpt,
"driveropts=", 11)==0 ||
281 strncmp(argpt,
"-driveropts=", 12)==0) {
282 if(strcmp(argpt+11,
"help")==0) {
283 fprintf(stderr,
"Driver options:\n");
285 "burnfree\tPrepare writer to use BURN-Free technology\n");
287 }
else if(strcmp(argpt,
"-dummy")==0) {
289 }
else if(strncmp(argpt,
"-dvd_obs=", 9)==0 ||
290 strncmp(argpt,
"dvd_obs=", 8)==0) {
291 cpt= strchr(argpt,
'=') + 1;
293 }
else if(strcmp(argpt,
"-eject")==0) {
295 }
else if(strncmp(argpt,
"-fs=", 4)==0 || strncmp(argpt,
"fs=", 3)==0) {
296 cpt= strchr(argpt,
'=')+1;
300 }
else if(strcmp(argv[i],
"--grow_overwriteable_iso")==0 ||
301 strcmp(argv[i],
"--grow_overwritable_iso")==0 ||
302 strcmp(argv[i],
"--grow_overriteable_iso")==0
306 }
else if(strcmp(argpt,
"-help")==0) {
308 }
else if(strcmp(argpt,
"-isosize")==0) {
310 }
else if(strcmp(argpt,
"-inq")==0) {
312 }
else if(strcmp(argpt,
"-mode2")==0) {
314 "Defaulting option -mode2 to option -data", 0,
"NOTE", 0);
315 }
else if(strcmp(argpt,
"-msinfo")==0) {
317 }
else if(strcmp(argpt,
"-multi")==0) {
320 }
else if(strcmp(argv[i],
"--multi_if_possible") == 0) {
323 }
else if(strcmp(argpt,
"-nopad")==0) {
325 }
else if(strcmp(argv[i],
"--no_rc")==0) {
327 }
else if(strcmp(argpt,
"-pad")==0) {
329 }
else if(strncmp(argpt,
"-padsize=", 9)==0 ||
330 strncmp(argpt,
"padsize=", 8)==0) {
331 cpt= strchr(argpt,
'=')+1;
335 }
else if(strcmp(argpt,
"-sao")==0) {
337 }
else if(strcmp(argpt,
"-scanbus")==0) {
338 sprintf(xorriso->
info_text,
"-as %s: Option -scanbus not supported.",
342 }
else if(strncmp(argpt,
"-speed=", 7)==0 ||
343 strncmp(argpt,
"speed=", 6)==0) {
344 cpt= strchr(argpt,
'=')+1;
345 strncpy(speed, cpt, 79);
347 }
else if(strncmp(argpt,
"-stream_recording=", 18)==0 ||
348 strncmp(argpt,
"stream_recording=", 17)==0) {
349 cpt= strchr(argpt,
'=')+1;
352 }
else if(strncmp(argpt,
"-use_immed_bit=", 15) == 0 ||
353 strncmp(argpt,
"use_immed_bit=", 14) == 0) {
354 cpt= strchr(argpt,
'=') + 1;
357 }
else if(strcmp(argpt,
"-immed") == 0) {
360 }
else if(strncmp(argpt,
"-minbuf=", 8) == 0 ||
361 strncmp(argpt,
"minbuf=", 7) == 0 ||
362 strncmp(argpt,
"-modesty_on_drive=", 18) == 0 ||
363 strncmp(argpt,
"modesty_on_drive=", 17) == 0) {
364 cpt= strchr(argpt,
'=') + 1;
367 }
else if(strncmp(argpt,
"-drive_scsi_dev_family=", 23) == 0 ||
368 strncmp(argpt,
"drive_scsi_dev_family=", 22) == 0) {
369 cpt= strchr(argpt,
'=') + 1;
372 }
else if(strncmp(argpt,
"-stdio_sync=", 12)==0 ||
373 strncmp(argpt,
"stdio_sync=", 11)==0) {
374 cpt= strchr(argpt,
'=') + 1;
376 }
else if(strcmp(argpt,
"-tao")==0) {
378 }
else if(strcmp(argpt,
"-toc")==0 || strcmp(argv[i],
"--long_toc")==0) {
381 }
else if(strncmp(argpt,
"-tsize=", 7)==0 ||
382 strncmp(argpt,
"tsize=", 6)==0) {
383 cpt= strchr(argpt,
'=')+1;
385 if(tsize > 1024.0*1024.0*1024.0*1024.0*1024.0) {
386 sprintf(xorriso->
info_text,
"-as %s: much too large: %s",whom, argpt);
390 }
else if(strcmp(argv[i],
"-V")==0 || strcmp(argpt,
"-Verbose")==0) {
392 }
else if(strcmp(argv[i],
"-v")==0 || strcmp(argpt,
"-verbose")==0) {
394 }
else if(strcmp(argv[i],
"-vv")==0) {
396 }
else if(strcmp(argv[i],
"-vvv")==0) {
398 }
else if(strcmp(argpt,
"-version")==0) {
400 }
else if(strcmp(argpt,
"-waiti")==0) {
402 }
else if(strncmp(argv[i],
"write_start_address=", 20)==0) {
405 }
else if(strcmp(argpt,
"-xa")==0) {
407 "Defaulting option -xa to option -data", 0,
"NOTE", 0);
408 }
else if(strcmp(argpt,
"-xa1")==0) {
411 }
else if(strcmp(argv[i],
"--xa1-ignore")==0) {
413 }
else if(strcmp(argpt,
"-xa2")==0) {
415 "Defaulting option -xa2 to option -data", 0,
"NOTE", 0);
416 }
else if(strcmp(argpt,
"-xamix")==0) {
418 "Option -xamix not implemented and data not yet convertible to other modes",
421 }
else if(argpt[0]==
'-' && argpt[1]!=0) {
422 sprintf(xorriso->
info_text,
"-as %s: Unknown option ", whom);
427 if(track_source[0]) {
428 sprintf(xorriso->
info_text,
"-as %s: Surplus track source ", whom);
431 sprintf(xorriso->
info_text,
"First and only track source is ");
436 if(
Sfile_str(track_source, argv[i], 0)<=0)
444 sprintf(xorriso->
result_line,
"Cdrecord 2.01-Emulation Copyright (C) 2019 see libburnia-project.org xorriso\n");
452 if(strcmp(blank_mode,
"help")==0) {
453 for(i= 0; strcmp(blank_help[i],
"@End_of_helptexT@")!=0; i++) {
454 sprintf(xorriso->
info_text,
"%s\n", blank_help[i]);
458 if(do_help || strcmp(blank_mode,
"help") == 0 || do_version) {
463 report_about=
"NOTE";
464 else if(do_verbous<=2)
465 report_about=
"UPDATE";
466 else if(do_verbous==3)
467 report_about=
"DEBUG";
480 if(!(do_checkdrive || do_atip || do_toc || blank_mode[0] || track_source[0] ||
481 do_eject || do_msinfo)) {
483 "-as cdrskin: No option specified, which would cause an action.");
490 "xorriso: Option -waiti pauses program until input appears at stdin\n");
492 sprintf(xorriso->
result_line,
"Waiting for data on stdin...\n");
494 for(ret= 0; ret==0; )
496 if(ret<0 || feof(stdin)) {
498 "stdin produces exception rather than data", 0,
"NOTE", 0);
500 sprintf(xorriso->
info_text,
"xorriso: Option -waiti pausing is done.\n");
512 sprintf(xorriso->
info_text,
"-as %s: No output drive selected", whom);
521 sprintf(xorriso->
result_line,
"%d,%d\n", msc1, msc2);
546 if(strcmp(blank_mode,
"format_overwrite")==0) {
550 }
else if(blank_mode[0]) {
555 if(track_source[0]) {
559 track_source, (off_t) tsize,
560 (!!do_grow) | ((!!do_isosize) << 1) | ((do_xa1 == 1) << 2));
563 track_source, (off_t) tsize,
564 (!!do_grow) | ((!!do_isosize) << 1) | ((do_xa1 == 1) << 2));
567 if(ret<=0 && ret<aq_ret)
570 {ret= aq_ret;
goto ex;}
575 if(do_eject && ret>=0) {
581 sprintf(xorriso->
info_text,
"-as %s: Job could not be performed properly.",
598 int *count,
int flag)
603 static char partial_options[][41]= {
605 "isolinux_mbr=",
"--modification-date=",
608 static char arg0_options[][41]= {
609 "-allow-leading-dots",
"-ldots",
"-allow-lowercase",
"-allow-multidot",
610 "-cache-inodes",
"-no-cache-inodes",
"-eltorito-alt-boot",
611 "-hard-disk-boot",
"-no-emul-boot",
"-no-boot",
"-boot-info-table",
612 "-check-oldnames",
"-d",
"-D",
"-dvd-video",
"-f",
"-gui",
"-graft-points",
613 "-hide-joliet-trans-tbl",
"-hide-rr-moved",
"-J",
"-joliet-long",
"-l",
614 "-L",
"-max-iso9660-filenames",
"-N",
"-nobak",
"-no-bak",
615 "-no-limit-pathtables",
"-force-rr",
"-no-rr",
616 "-no-split-symlink-components",
"-no-split-symlink-fields",
"-pad",
617 "-no-pad",
"-posix-H",
"-posix-L",
"-posix-P",
"-print-size",
618 "-quiet",
"-R",
"-r",
"-relaxed-filenames",
"-rrip110",
"-rrip112",
619 "-split-output",
"-T",
"-UDF",
"-udf",
"-udf-symlinks",
"-no-udf-symlinks",
620 "-U",
"-no-iso-translate",
"-v",
"-XA",
"-xa",
"-z",
621 "-hfs",
"-no-hfs",
"-apple",
"-probe",
"-no-desktop",
"-mac-name",
622 "-part",
"-icon-position",
"-chrp-t",
"-hfs-unlock",
"--cap",
"--netatalk",
623 "--double",
"--ethershare",
"--ushare",
"--exchange",
"--sgi",
"--xinet",
624 "--macbin",
"--single",
"--dave",
"--sfm",
"--osx-double",
"--osx-hfs",
625 "-debug",
"-omit-period",
"-disable-deep-relocation",
"-joliet",
626 "-full-iso9660-filenames",
"-follow-links",
"-help",
627 "-transparent-compression",
628 "-omit-version-number",
"-rational-rock",
"-rock",
"-translation-table",
629 "-untranslated-filenames",
"-verbose",
"-version",
"-g",
"-h",
630 "-no-mac-files",
"-chrp-boot",
631 "--hardlinks",
"--acl",
"--xattr",
"--xattr-any",
"--md5",
"--for_backup",
632 "--protective-msdos-label",
"--boot-catalog-hide",
"--no-emul-toc",
633 "--emul-toc",
"-disallow_dir_id_ext",
"--old-empty",
634 "--old-root-no-md5",
"--old-root-devno",
"--old-root-no-ino",
635 "--no_rc",
"--norock",
"-hfsplus",
"-fat",
"-chrp-boot-part",
636 "-isohybrid-gpt-basdat",
"-isohybrid-gpt-hfsplus",
637 "-isohybrid-apm-hfsplus",
"--grub2-boot-info",
"-joliet-utf16",
638 "-appended_part_as_gpt",
"-appended_part_as_apm",
"--mbr-force-bootable",
639 "-part_like_isohybrid",
"--zisofs-version-2",
"--zisofs2-susp-z2",
643 static char arg1_options[][41]= {
644 "-abstract",
"-A",
"-appid",
"--application_use",
645 "-biblio",
"-b",
"-B",
"-boot-load-seg",
646 "-boot-load-size",
"-C",
"-c",
"-check-session",
"-copyright",
647 "-dir-mode",
"-eltorito-id",
"-eltorito-selcrit",
648 "-file-mode",
"-G",
"-gid",
"-hide",
"-hide-list",
649 "-hidden",
"-hidden-list",
"-hide-joliet",
"-hide-joliet-list",
650 "-hide-hfsplus",
"-hide-hfsplus-list",
651 "-hide-udf",
"-hide-udf-list",
"-input-charset",
"-output-charset",
652 "-iso-level",
"-jcharset",
"-log-file",
"-m",
"-exclude-list",
"-M",
653 "-dev",
"-new-dir-mode",
"-o",
"-p",
"-preparer",
654 "-path-list",
"-publisher",
"-root",
655 "-old-root",
"-s",
"-sectype",
"-sort",
"-sparc-boot",
"-sparc-label",
656 "-stream-media-size",
"-stream-file-name",
"-sunx86-boot",
"-sunx86-label",
657 "-sysid",
"-table-name",
"-ucs-level",
"-uid",
"-V",
"-volset",
658 "-volset-size",
"-volset-seqno",
"-x",
"-P",
659 "-map",
"-magic",
"-hfs-creator",
"-hfs-type",
"-boot-hfs-file",
"-auto",
660 "-cluster-size",
"-hide-hfs",
"-hide-hfs-list",
"-hfs-volid",
661 "-root-info",
"-prep-boot",
"-input-hfs-charset",
"-output-hfs-charset",
662 "-hfs-bless",
"-hfs-parms",
663 "-eltorito-boot",
"-generic-boot",
"-eltorito-catalog",
"-cdrecord-params",
664 "-errctl",
"-exclude",
"-prev-session",
"-output",
"-use-fileversion",
665 "-volid",
"-old-exclude",
666 "-alpha-boot",
"-hppa-cmdline",
"-hppa-kernel-32",
"-hppa-kernel-64",
667 "-hppa-bootloader",
"-hppa-ramdisk",
"-mips-boot",
"-mipsel-boot",
668 "-jigdo-jigdo",
"-jigdo-template",
"-jigdo-min-file-size",
669 "-jigdo-force-md5",
"-jigdo-force-checksum",
670 "-md5-list",
"-checksum-list",
671 "-jigdo-exclude",
"-jigdo-map",
672 "-jigdo-template-compress",
"-jigdo-checksum-algorithm",
673 "-checksum_algorithm_iso",
"-checksum_algorithm_template",
674 "--stdio_sync",
"--quoted_path_list",
"--efi-boot",
"--embedded-boot",
675 "-isohybrid-mbr",
"-e",
"-partition_offset",
"-partition_hd_cyl",
676 "-partition_sec_hd",
"-partition_cyl_align",
"-untranslated_name_len",
677 "-rr_reloc_dir",
"-hfsplus-serial-no",
"-prep-boot-part",
"-efi-boot-part",
678 "-hfsplus-block-size",
"-apm-block-size",
"--grub2-mbr",
679 "--grub2-sparc-core",
"--sort-weight-list",
"--sort-weight-patterns",
680 "-hppa-hdrversion",
"-file_name_limit",
"--set_all_file_dates",
681 "--gpt_disk_guid",
"-iso_mbr_part_type",
"-eltorito-platform",
684 static char arg2_options[][41]= {
685 "-hfs-bless-by",
"--scdbackup_tag",
"--sort-weight",
688 static char arg3_options[][41]= {
689 "-append_partition",
"-hfsplus-file-creator-type",
692 static char final_options[][41]= {
699 for(i=0; partial_options[i][0]!=0; i++)
700 if(strncmp(partial_options[i], cmd, strlen(partial_options[i]))==0)
702 for(i=0; arg0_options[i][0]!=0; i++)
703 if(strcmp(arg0_options[i], cmd)==0)
706 for(i=0; arg1_options[i][0]!=0; i++)
707 if(strcmp(arg1_options[i], cmd)==0)
710 for(i=0; arg2_options[i][0]!=0; i++)
711 if(strcmp(arg2_options[i], cmd)==0)
714 for(i=0; arg3_options[i][0]!=0; i++)
715 if(strcmp(arg3_options[i], cmd)==0)
718 for(i=0; final_options[i][0]!=0; i++)
719 if(strcmp(final_options[i], cmd)==0)
729 char *argpt,
int *i,
int flag)
732 static char ignored_arg0_options[][41]= {
733 "-allow-leading-dots",
"-ldots",
"-allow-multidot",
734 "-cache-inodes",
"-check-oldnames",
735 "-L",
"-no-bak",
"-no-cache-inodes",
736 "-no-split-symlink-components",
"-no-split-symlink-fields",
"-nobak",
737 "-force-rr",
"-T",
"-translation-table",
741 static char ignored_arg1_options[][41]= {
742 "-check-session",
"-hide-hfs",
"-hide-hfs-list",
743 "-table-name",
"-volset-seqno",
"-volset-size",
"-sort",
748 for(k=0;ignored_arg0_options[k][0]!=0;k++)
749 if(strcmp(argpt,ignored_arg0_options[k])==0)
751 for(k=0;ignored_arg1_options[k][0]!=0;k++)
752 if(strcmp(argpt,ignored_arg1_options[k])==0) {
758 sprintf(xorriso->
info_text,
"-as %s: Ignored option ", whom);
781 static char helptext[][160]= {
782 "Usage: xorriso -as mkisofs [options] file...",
783 "Note: This is not mkisofs. See xorriso -help, xorriso -version, man xorrisofs",
785 " -f, -follow-links Follow symbolic links",
786 " -graft-points Allow to use graft points for filenames",
787 " -help Print option help",
788 " -hfsplus Generate HFS+ filesystem",
789 " -hfsplus-file-creator-type CREATOR TYPE iso_rr_path",
790 " Attach creator and type to a File",
791 " -hfs-bless FOLDER_NAME Name of Folder to be blessed",
792 " -hfs-bless-by BLESS_TYPE ISO_RR_PATH",
793 " Bless ISO_RR_PATH by BLESS_TYPE {p,i,s,9,x}",
794 " -hfsplus-serial-no HEXSTRING",
795 " HFS serial number: 16 characters [0-9a-fA-F]",
796 " -hfsplus-block-size NUMBER Set HFS+ block size",
797 " -apm-block-size NUMBER Set Apple Partition Map block size",
798 " -hide GLOBFILE Hide ISO9660/RR file",
799 " -hide-list FILE File with list of ISO9660/RR files to hide",
800 " -hide-joliet GLOBFILE Hide Joliet file",
801 " -hide-joliet-list FILE File with list of Joliet files to hide",
802 " -hide-hfsplus GLOBFILE Hide HFS+ file",
803 " -hide-hfsplus-list FILE File with list of HFS+ files to hide",
804 " -input-charset CHARSET Local input charset for file name conversion",
805 " -output-charset CHARSET Output charset for file name conversion",
806 " -iso-level LEVEL Set ISO9660 conformance level (1..3) or 4 for ISO9660 version 2",
807 " -disallow_dir_id_ext Do not allow dot in ISO directory names",
808 " -J, -joliet Generate Joliet directory information",
809 " -joliet-long Allow Joliet file names to be 103 Unicode characters",
810 " -joliet-utf16 Encode Joliet names in UTF-16BE rather than UCS-2",
811 " -U, -untranslated-filenames Allow Untranslated filenames (for HPUX & AIX - violates ISO9660).",
812 " -untranslated_name_len LEN Allow up to LEN (1..96) name characters (heavily violates ISO9660).",
813 " -allow-lowercase Allow lower case characters in addition to the current character set (violates ISO9660)",
814 " -relaxed-filenames Allow 7 bit ASCII except lower case characters (violates ISO9660)",
815 " -d, -omit-period Omit trailing periods from filenames (violates ISO9660)",
816 " -l, -full-iso9660-filenames Allow full 31 character filenames for ISO9660 names",
817 " -max-iso9660-filenames Allow 37 character filenames for ISO9660 names (violates ISO9660)",
818 " -N, -omit-version-number Omit version number from ISO9660 filename (violates ISO9660)",
819 " -D, -disable-deep-relocation",
820 " Disable deep directory relocation (violates ISO9660)",
821 " -hide-rr-moved Relocate deep directories to /.rr_moved",
822 " -rr_reloc_dir NAME Set deep directory relocation target in root",
823 " -uid uid Make the owner of all files this uid.",
824 " -gid gid Make the group owner of all files this gid.",
825 " -o FILE, -output FILE Set output file name",
826 " -m GLOBFILE, -exclude GLOBFILE",
827 " Exclude file name",
828 " -x FILE, -old-exclude FILE Exclude file name",
829 " -exclude-list FILE File with list of file names to exclude",
830 " -pad Pad output by 300k (default)",
831 " -no-pad Do not pad output",
832 " -M FILE, -prev-session FILE Set path to previous session to merge",
833 " -C PARAMS, -cdrecord-params PARAMS",
834 " Magic paramters from cdrecord",
835 " -dir-mode mode Make the mode of all directories this mode.",
836 " -file-mode mode Make the mode of all plain files this mode.",
837 " -path-list FILE File with list of pathnames to process",
838 " --quoted_path_list FILE File with list of quoted pathnames to process",
839 " -print-size Print estimated filesystem size and exit",
840 " -quiet Run quietly",
841 " -gui Switch behaviour for GUI",
842 " -R, -rock Generate Rock Ridge directory information",
843 " -r, -rational-rock Generate rationalized Rock Ridge directory information",
844 " --norock Disable Rock Ridge. (Strongly discouraged !)",
845 " -file_name_limit LEN Set truncation limit for Rock Ridge names",
846 " --hardlinks Record eventual hard link relations of files",
847 " --acl Record eventual ACLs of files",
848 " --xattr Record eventual user space xattr of files",
849 " --xattr-any Record xattr of any namespace, not only user.",
850 " --md5 Compute and record MD5 checksums of data files",
851 " --scdbackup_tag PATH NAME With --md5 record a scdbackup checksum tag",
852 " --for_backup Use all options which improve backup fidelity",
853 " -V ID, -volid ID Set Volume ID",
854 " -volset ID Set Volume set ID",
855 " -publisher PUB Set Volume publisher",
856 " -A ID, -appid ID Set Application ID",
857 " -sysid ID Set System ID",
858 " -p PREP, -preparer PREP Set Volume preparer",
859 " -abstract FILE Set Abstract filename",
860 " -biblio FILE Set Bibliographic filename",
861 " -copyright FILE Set Copyright filename",
862 " --application_use CHAR|PATH Set content of Application Use field",
863 " -jigdo-jigdo FILE Produce a jigdo .jigdo file as well as the .iso",
864 " -jigdo-template FILE Produce a jigdo .template file as well as the .iso",
865 " -jigdo-min-file-size SIZE Minimum size for a file to be listed in the jigdo file",
866 " -jigdo-force-checksum PTRN Pattern(s) where files MUST match an externally-supplied checksum",
867 " -jigdo-force-md5 PATTERN Outdated alias of -jigdo-force-checksum",
868 " -jigdo-exclude PATTERN Pattern(s) to exclude from the jigdo file",
869 " -jigdo-map PATTERN1=PATTERN2",
870 " Pattern(s) to map paths (e.g. Debian=/mirror/debian)",
871 " -checksum-list FILE File containing checksums of the files that should be checked",
872 " -md5-list FILE Outdated alias of -checksum-list",
873 " -jigdo-checksum-algorithm ALGORITHM",
874 " Choose algorithm for file matching checksums: md5, sha256",
875 " Expected in the -checksum-list FILE, written into .jigdo file.",
876 " -jigdo-template-compress ALGORITHM",
877 " Choose to use gzip or bzip2 compression for template data; default is gzip",
878 " -checksum_algorithm_iso alg1,alg2,...",
879 " Specify the checksum types desired for the output image (in .jigdo)",
880 " -checksum_algorithm_template alg1,alg2,...",
881 " Specify the checksum types desired for the output jigdo template",
882 " -eltorito-platform Set El Torito platform id for the next boot entry",
883 " -b FILE, -eltorito-boot FILE",
884 " Set El Torito boot image name",
885 " -eltorito-alt-boot Start specifying alternative El Torito boot parameters",
886 " --efi-boot FILE Set El Torito EFI boot image name and type",
887 " -e FILE Set EFI boot image name (more rawly)",
888 " -c FILE, -eltorito-catalog FILE",
889 " Set El Torito boot catalog name",
890 " --boot-catalog-hide Hide boot catalog from ISO9660/RR and Joliet",
891 " -boot-load-size # Set numbers of load sectors",
892 " -hard-disk-boot Boot image is a hard disk image",
893 " -no-emul-boot Boot image is 'no emulation' image",
894 " -boot-info-table Patch boot image with info table",
895 " --grub2-boot-info Patch boot image at byte 2548",
896 " -eltorito-id ID Set El Torito Id String",
897 " -eltorito-selcrit HEXBYTES Set El Torito Selection Criteria",
898 " -isohybrid-gpt-basdat Mark El Torito boot image as Basic Data in GPT",
899 " -isohybrid-gpt-hfsplus Mark El Torito boot image as HFS+ in GPT",
900 " -isohybrid-apm-hfsplus Mark El Torito boot image as HFS+ in APM",
901 " -part_like_isohybrid Mark in MBR, GPT, APM without -isohybrid-mbr",
902 " -iso_mbr_part_type Set type byte or GUID of ISO partition in MBR",
903 " or type GUID if a GPT ISO partition emerges.",
904 " --gpt_disk_guid GUID Set GPT disk GUID or choose automatic GUID",
905 " -G FILE, -generic-boot FILE Set generic boot image name",
906 " --embedded-boot FILE Alias of -G",
907 " --protective-msdos-label Patch System Area by partition table",
908 " --mbr-force-bootable Enforce existence of bootable flag in MBR",
909 " -partition_offset LBA Make image mountable by first partition, too",
910 " -partition_sec_hd NUMBER Define number of sectors per head",
911 " -partition_hd_cyl NUMBER Define number of heads per cylinder",
912 " -partition_cyl_align MODE Control cylinder alignment: off, on, auto, all",
913 " -mips-boot FILE Set mips boot image name (relative to image root)",
914 " -mipsel-boot FILE Set mipsel boot image name (relative to image root)",
915 " -B FILES, -sparc-boot FILES Set sparc boot image names",
916 " -sparc-label label text Set sparc boot disk label",
917 " -hppa-cmdline CMDLINE Set hppa boot command line",
918 " -hppa-kernel-32 FILE Set hppa 32-bit image name (relative to image root)",
919 " -hppa-kernel-64 FILE Set hppa 64-bit image name (relative to image root)",
920 " -hppa-bootloader FILE Set hppa boot loader file name (relative to image root)",
921 " -hppa-ramdisk FILE Set hppa ramdisk file name (relative to image root)",
922 " -hppa-hdrversion NUMBER Set hppa PALO header version to 4 or 5",
923 " -alpha-boot FILE Set alpha boot image name (relative to image root)",
924 " --grub2-sparc-core FILE Set path of core file for disk label patching",
925 " -efi-boot-part DISKFILE|--efi-boot-image",
926 " Set data source for EFI System Partition",
927 " -chrp-boot-part Mark ISO image size by MBR partition type 0x96",
928 " -chrp-boot Alias of -chrp-boot-part",
929 " -prep-boot-part DISKFILE Set data source for MBR partition type 0x41",
930 " -append_partition NUMBER TYPE FILE",
931 " Append FILE after image. TYPE is hex: 0x.. or",
932 " a GUID to be used if -appended_part_as_gpt.",
933 " -appended_part_as_gpt mark appended partitions in GPT instead of MBR.",
934 " -appended_part_as_apm mark appended partitions in APM.",
935 " --modification-date=YYYYMMDDhhmmsscc",
936 " Override date of creation and modification",
937 " --set_all_file_dates TIME Override mtime, atime, ctime in all files",
938 " -isohybrid-mbr FILE Set SYSLINUX mbr/isohdp[fp]x*.bin for isohybrid",
939 " --grub2-mbr FILE Set GRUB2 MBR for boot image address patching",
940 #ifdef Xorriso_with_isohybriD
941 " isolinux_mbr=on|auto|off Control eventual isohybrid MBR generation",
943 " --sort-weight NUMBER FILE Set LBA weight number to file or file tree",
944 " --sort-weight-list DISKFILE Read list of NUMBER FILE pairs for --sort-weight",
945 " --sort-weight-patterns DISKFILE --sort-weight-list with pattern expansion",
946 " --stdio_sync on|off|number Control forced output to disk files",
947 " --no-emul-toc Save 64 kB size on random access output files",
948 " --emul-toc Multi-session history on such output files",
949 " --old-empty Use old style block addresses for empty files",
950 " -z, -transparent-compression",
951 " Enable transparent compression of files",
952 " --zisofs-version-2 Enable processing of zisofs version 2 files",
953 " --zisofs2-susp-z2 Produce Z2 entries for zisofs version 2",
954 " --zisofs2-susp-zf Produce ZF entries for zisofs version 2",
955 " -root DIR Set root directory for all new files and directories",
956 " -old-root DIR Set root directory in previous session that is searched for files",
957 " --old-root-no-md5 Do not record and use MD5 with -old-root",
958 " --old-root-no-ino Do not use disk inode numbers with -old-root",
959 " --old-root-devno Use disk device numbers with -old-root",
960 " -log-file LOG_FILE Re-direct messages to LOG_FILE",
961 " --no_rc Do not execute startup files",
962 " -v, -verbose Verbose",
963 " -version Print the current version",
965 #ifdef Xorriso_GNU_xorrisO
966 "Report bugs to: bug-xorriso@gnu.org , or in private to: scdbackup@gmx.net .",
967 "xorriso home page: <https://www.gnu.org/software/xorriso/>",
968 "General help using GNU software: <https://www.gnu.org/gethelp/>",
970 "Report any bugs to bug-xorriso@gnu.org or in private to scdbackup@gmx.net .",
981 for(i= 0; strcmp(helptext[i],
"@End_of_helptexT@")!=0; i++) {
982 sprintf(xorriso->
info_text,
"%s\n", helptext[i]);
1003 char *pattern,
int hide_attrs,
int flag)
1008 if((hide_attrs & 63) == 0)
1011 if(strchr(pattern,
'/') != NULL) {
1014 4 | ((hide_attrs & 63) << 8));
1024 char *adr,
int hide_attrs,
int flag)
1026 int ret, linecount= 0, argc= 0, was_failure= 0, i, fret;
1027 char **argv= NULL, *
id=
"";
1033 else if (hide_attrs & 4)
1036 "Empty file name given with -as %s -hide-%slist", whom,
id);
1050 for(i= 0; i < argc; i++) {
1054 if(ret <= 0 || xorriso->request_to_abort) {
1068 if(fp != NULL && fp != stdin)
1072 return(!was_failure);
1078 char **arg_out,
int flag)
1084 if(strlen(arg_in) < 4)
1086 if(arg_in[0] !=
'-' || arg_in[1] !=
'-' || arg_in[2] ==
'-')
1089 argv[0]= arg_in + 1;
1092 *arg_out= arg_in + 1;
1105 int *option_d,
int *iso_level,
int *lower_r,
1106 char ra_text[80],
int flag)
1108 int ret, non_pass1= 0;
1110 static char pass1_covered[]= {
"fvz"};
1111 static char covered[]= {
"dDfJlNRrTUvz"};
1114 for(cpt= opts; *cpt != 0; cpt++) {
1115 if(strchr(covered, *cpt) == NULL)
1118 if(strchr(pass1_covered, *cpt) == NULL)
1121 ret= 1 + non_pass1;
goto ex;
1124 for(cpt= opts; *cpt != 0; cpt++) {
1129 }
else if(*cpt ==
'D') {
1133 }
else if(*cpt ==
'f') {
1139 }
else if(*cpt ==
'J') {
1143 }
else if(*cpt ==
'l') {
1150 }
else if(*cpt ==
'N') {
1154 }
else if(*cpt ==
'R') {
1158 }
else if(*cpt ==
'r') {
1163 }
else if(*cpt ==
'T') {
1165 }
else if(*cpt ==
'U') {
1169 "no_force_dots:long_paths:long_names:omit_version:full_ascii:lowercase",
1171 }
else if(*cpt ==
'v') {
1174 strcpy(ra_text,
"UPDATE");
1175 }
else if(*cpt ==
'z') {
1180 sprintf(xorriso->
info_text,
"-as %s: Unsupported option -%c", whom, *cpt);
1193 char *pathspec,
int flag)
1196 char *esc_wdx= NULL, *eff_path= NULL, *ept;
1204 strcpy(esc_wdx, xorriso->
wdx);
1209 "Escaped -cdx directory gets much too long", 0,
"FAILURE", 0);
1220 strcpy(pathspec,
"/=");
1230 "Escaped leaf name gets much too long", 0,
"FAILURE", 0);
1234 strcat(pathspec,
"=");
1238 l= strlen(pathspec);
1239 strcat(pathspec, eff_path);
1244 "Escaped path gets much too long", 0,
"FAILURE", 0);
1260 int with_emul_toc,
int *allow_dir_id_ext,
1261 int *iso_level,
int flag)
1276 *allow_dir_id_ext= 1;
1277 if(*allow_dir_id_ext == 1) {
1279 *allow_dir_id_ext= 2;
1283 if(*iso_level >= 1 && *iso_level <= 3) {
1284 sprintf(sfe,
"iso_9660_level=%d", *iso_level);
1290 if(with_emul_toc == 0)
1312 if(strcmp(
id,
"x86") == 0)
1314 else if(strcmp(
id,
"PPC") == 0)
1316 else if(strcmp(
id,
"Mac") == 0)
1318 else if(strcmp(
id,
"efi") == 0)
1322 if(strncmp(
id,
"0x", 2) == 0) {
1323 sscanf(
id + 2,
"%x", &u);
1325 sscanf(
id,
"%u", &u);
1326 sprintf(re_id,
"%u", u);
1327 if(strcmp(
id, re_id) != 0)
1335 "Unrecognized El Torito Platform Id : '%.16s%s'",
1336 id, strlen(
id) > 16 ?
"..." :
"");
1339 "Recognizable are: x86, PPC, Mac, efi, [0...255], [0x00...0xff]");
1347 int argc,
char **argv,
int flag)
1349 int ret, i, j, was_path= 0, was_other_option= 0, mem_graft_points, mem;
1350 int do_print_size= 0, fd, idx, iso_level= -1, palohdrversion;
1351 int was_failure= 0, fret, lower_r= 0, zero= 0;
1352 int dir_mode= -1, file_mode= -1, count, partition_number;
1353 int allow_dir_id_ext= -1;
1354 int root_seen= 0, do_md5_mem, option_d= 0, arg_count;
1355 mode_t mode_and, mode_or;
1356 int with_boot_image= 0, with_cat_path= 0, with_emul_toc= 0;
1357 int old_root_md5= 1, old_root_dev= 0, old_root_ino= 1, sort_file_pattern= 0;
1358 int *weight_list= NULL, weight_count= 0;
1359 int *delay_opt_list= NULL, delay_opt_count= 0;
1360 int mkisofs_b_platform_id= 0x00;
1361 char *sfe= NULL, *adr= NULL, ra_text[80], *pathspec= NULL, *sort_file= NULL;
1362 char *ept, *add_pt, *eff_path= NULL, *indev= NULL, msc[80], *cpt;
1363 char *old_root= NULL, *argpt, *hargv[1];
1364 char *boot_path, partno_text[24], *iso_rr_pt, *disk_pt, *rpt, *wpt;
1365 char *rm_merge_args[3], *rr_reloc_dir_pt= NULL;
1366 char *sort_weight_args[4], *bless_args[6], *sa_path;
1378 for(i= 0; i<argc; i++) {
1379 if(strcmp(argv[i],
"-log-file") == 0 ||
1380 strcmp(argv[i],
"--log-file") == 0 ) {
1382 goto not_enough_args;
1385 sprintf(xorriso->
info_text,
"re-directing all messages to %s\n",
1390 8 | ((argv[i][0] == 0) << 15));
1392 sprintf(xorriso->
info_text,
"Cannot open logfile: %s", argv[i]);
1400 if(argv[i][0] == 0) {
1401 sprintf(xorriso->
info_text,
"Revoked stderr message redirection");
1409 weight_list=
TSOB_FELD(
int, (argc / 3) + 1);
1410 if(weight_list == NULL) {
1414 delay_opt_list=
TSOB_FELD(
int, argc + 1);
1415 if(delay_opt_list == NULL) {
1416 cpt= (
char *) weight_list;
1423 adr[0]= indev[0]= msc[0]= old_root[0]= sort_file[0]= 0;
1424 for(i= 0; i<argc; i++) {
1431 if(strcmp(argpt,
"-version")==0) {
1433 "mkisofs 2.01-Emulation Copyright (C) 2019 see libburnia-project.org xorriso\n"
1443 }
else if(strcmp(argpt,
"-o")==0 || strcmp(argpt,
"-output")==0) {
1445 goto not_enough_args;
1448 if(strcmp(argv[i],
"-")!=0 && strncmp(argv[i],
"stdio:", 6)!=0)
1449 strcpy(adr,
"stdio:");
1450 if(
Sfile_str(adr+strlen(adr), argv[i], 0)<=0)
1452 }
else if(strcmp(argpt,
"-M")==0 || strcmp(argpt,
"-dev")==0 ||
1453 strcmp(argpt,
"-prev-session")==0) {
1455 goto not_enough_args;
1457 if(strncmp(argv[i],
"stdio:", 6)!=0)
1458 strcpy(indev,
"stdio:");
1459 if(
Sfile_str(indev+strlen(indev), argv[i], 0)<=0)
1461 }
else if(strcmp(argpt,
"-C")==0 ||
1462 strcmp(argpt,
"-cdrecord-params")==0) {
1464 goto not_enough_args;
1466 strncpy(msc, argv[i],
sizeof(msc)-1);
1467 msc[
sizeof(msc)-1]= 0;
1468 }
else if(strcmp(argpt,
"-help")==0) {
1470 }
else if(strcmp(argpt,
"-v")==0 || strcmp(argpt,
"-verbose")==0) {
1472 &option_d, &iso_level, &lower_r, ra_text, 2);
1474 goto problem_handler_1;
1475 }
else if(strcmp(argpt,
"-quiet")==0) {
1476 strcpy(ra_text,
"SORRY");
1477 }
else if(strcmp(argpt,
"-f")==0 || strcmp(argpt,
"-follow-links")==0) {
1479 &option_d, &iso_level, &lower_r, ra_text, 2);
1481 goto problem_handler_1;
1482 }
else if(strcmp(argpt,
"-iso-level")==0) {
1484 goto not_enough_args;
1486 sscanf(argv[i],
"%d", &iso_level);
1487 if(iso_level < 1 || iso_level > 4) {
1489 "-as %s: unsupported -iso-level '%s' (use one of: 1,2,3,4)",
1492 ret= 0;
goto problem_handler_1;
1497 sprintf(sfe,
"iso_9660_level=%s", argv[i]);
1500 goto problem_handler_1;
1503 }
else if(strcmp(argpt,
"-input-charset")==0) {
1505 goto not_enough_args;
1508 if(strcmp(argv[i],
"default") == 0)
1513 goto problem_handler_1;
1514 }
else if(strcmp(argpt,
"-output-charset")==0) {
1516 goto not_enough_args;
1519 if(strcmp(argv[i],
"default") == 0)
1524 goto problem_handler_1;
1526 }
else if(strcmp(argpt,
"-hide") == 0 ||
1527 strcmp(argpt,
"-hide-list") == 0 ||
1528 strcmp(argpt,
"-hide-joliet") == 0 ||
1529 strcmp(argpt,
"-hide-joliet-list") == 0 ||
1530 strcmp(argpt,
"-hide-hfsplus") == 0 ||
1531 strcmp(argpt,
"-hide-hfsplus-list") == 0) {
1533 goto not_enough_args;
1535 if(strcmp(argpt,
"-hide") == 0)
1537 else if(strcmp(argpt,
"-hide-list") == 0)
1539 else if(strcmp(argpt,
"-hide-joliet") == 0)
1541 else if(strcmp(argpt,
"-hide-joliet-list") == 0)
1543 else if(strcmp(argpt,
"-hide-hfsplus") == 0)
1545 else if(strcmp(argpt,
"-hide-hfsplus-list") == 0)
1548 goto problem_handler_1;
1550 }
else if(strcmp(argpt,
"-root") == 0) {
1552 goto not_enough_args;
1555 strcpy(eff_path,
"/");
1556 if(
Sfile_str(eff_path, argv[i], argv[i][0] !=
'/') <= 0)
1558 strcpy(xorriso->
wdi, eff_path);
1561 }
else if(strcmp(argpt,
"-old-root") == 0) {
1563 goto not_enough_args;
1566 strcpy(old_root,
"/");
1567 if(
Sfile_str(old_root, argv[i], argv[i][0] !=
'/') <= 0)
1570 }
else if(strcmp(argpt,
"--old-root-no-md5")==0) {
1572 }
else if(strcmp(argpt,
"--old-root-devno")==0) {
1574 }
else if(strcmp(argpt,
"--old-root-no-ino")==0) {
1577 }
else if(strcmp(argpt,
"-fat") == 0) {
1579 }
else if(strcmp(argpt,
"-hfsplus") == 0) {
1583 }
else if(strcmp(argpt,
"--hardlinks")==0) {
1585 }
else if(strcmp(argpt,
"--acl")==0) {
1587 }
else if(strcmp(argpt,
"--xattr")==0) {
1589 }
else if(strcmp(argpt,
"--xattr-any")==0) {
1591 }
else if(strcmp(argpt,
"--md5")==0) {
1593 }
else if(strcmp(argpt,
"--scdbackup_tag")==0) {
1595 goto not_enough_args;
1599 goto problem_handler_1;
1600 }
else if(strcmp(argpt,
"--for_backup")==0) {
1605 }
else if(strcmp(argpt,
"-z")==0 ||
1606 strcmp(argpt,
"-transparent-compression")==0) {
1608 }
else if(strcmp(argpt,
"--zisofs-version-2") == 0) {
1610 }
else if(strcmp(argpt,
"--zisofs2-susp-z2") == 0) {
1612 }
else if(strcmp(argpt,
"--zisofs2-susp-zf") == 0) {
1614 }
else if(strcmp(argpt,
"--stdio_sync")==0) {
1616 goto not_enough_args;
1619 }
else if(strcmp(argpt,
"-disallow_dir_id_ext")==0) {
1620 allow_dir_id_ext= 0;
1621 }
else if(strcmp(argpt,
"--emul-toc")==0) {
1624 }
else if(strcmp(argpt,
"--no-emul-toc")==0) {
1627 }
else if(strcmp(argpt,
"-log-file") == 0) {
1630 }
else if(strcmp(argpt,
"-gui") == 0) {
1632 }
else if(strcmp(argpt,
"-file_name_limit") == 0) {
1634 goto not_enough_args;
1638 if(argv[i][0] ==
'-') {
1640 &option_d, &iso_level, &lower_r, ra_text, 1 | 2);
1642 was_other_option= 1;
1645 was_other_option= 1;
1649 &option_d, &iso_level, &lower_r, ra_text, 2);
1651 goto problem_handler_1;
1669 if(strncmp(adr,
"stdio:", 6)==0 && strncmp(adr,
"stdio:/dev/fd/", 14)!=0) {
1673 }
else if(ret==2 || ret==3) {
1675 "-as %s: Cannot accept %s as target: -o %s",
1676 whom, (ret==3 ?
"symbolic link" :
"directory"),
1695 cpt= strchr(msc,
',');
1699 "-as %s: unusable parameter with option -C: %s",
1703 }
else if(cpt==msc || msc[1]==0)
1705 strncpy(sfe, msc, cpt-msc);
1724 if(old_root[0] || root_seen) {
1727 old_root_dev && old_root_ino ?
"on" :
1728 old_root_ino ?
"ino_only" :
"off", 0);
1733 do_md5_mem= xorriso->
do_md5;
1738 xorriso->
do_md5= do_md5_mem;
1743 if(!was_other_option)
1752 {ret= -(ret != -1);
goto ex;}
1754 strcpy(xorriso->
wdi,
"/");
1756 if(strcmp(old_root, xorriso->
wdi) != 0) {
1766 for(i= 0; i<argc; i++) {
1767 sprintf(xorriso->
info_text,
"-as %s: %s",
1776 if(strcmp(argpt,
"-version")==0) {
1778 }
else if(strcmp(argpt,
"--norock")==0) {
1781 }
else if(strcmp(argpt,
"-R")==0 || strcmp(argpt,
"-rock")==0) {
1783 &option_d, &iso_level, &lower_r, ra_text, 0);
1785 goto problem_handler_2;
1786 }
else if(strcmp(argpt,
"-r")==0 || strcmp(argpt,
"-rational-rock")==0){
1788 &option_d, &iso_level, &lower_r, ra_text, 0);
1790 goto problem_handler_2;
1791 }
else if(strcmp(argpt,
"-J")==0 || strcmp(argpt,
"-joliet")==0) {
1793 &option_d, &iso_level, &lower_r, ra_text, 0);
1795 goto problem_handler_2;
1796 }
else if(strcmp(argpt,
"-joliet-long")==0) {
1798 "joliet_long_paths:joliet_long_names", 0);
1799 }
else if(strcmp(argpt,
"-joliet-utf16")==0) {
1801 }
else if(strcmp(argpt,
"-fat") == 0) {
1803 }
else if(strcmp(argpt,
"-hfs-bless") == 0 ||
1804 strcmp(argpt,
"-hfs-bless-by") == 0 ||
1805 strcmp(argpt,
"-hfsplus-file-creator-type") == 0) {
1807 if(strcmp(argpt,
"-hfs-bless-by") == 0)
1809 else if(strcmp(argpt,
"-hfsplus-file-creator-type") == 0)
1811 if(i + arg_count >= argc)
1812 goto not_enough_args;
1814 delay_opt_list[delay_opt_count++]= i;
1815 if(argv[i] != argpt)
1816 delay_opt_list[delay_opt_count - 1]|= 1u<<31;
1818 }
else if(strcmp(argpt,
"-hfsplus") == 0) {
1820 }
else if(strcmp(argpt,
"-hfsplus-serial-no") == 0) {
1822 goto not_enough_args;
1824 sprintf(pathspec,
"hfsplus_serial=%.80s", argv[i]);
1827 goto problem_handler_2;
1828 }
else if(strcmp(argpt,
"-hfsplus-block-size") == 0 ||
1829 strcmp(argpt,
"-apm-block-size") == 0) {
1831 goto not_enough_args;
1834 sscanf(argv[i],
"%d", &ret);
1836 sprintf(sfe,
"hfsplus_block_size=%d", ret);
1838 sprintf(sfe,
"apm_block_size=%d", ret);
1841 goto problem_handler_2;
1843 }
else if(strcmp(argpt,
"-graft-points")==0) {
1845 }
else if(strcmp(argpt,
"-path-list")==0 ||
1846 strcmp(argpt,
"--quoted_path_list")==0) {
1849 sprintf(xorriso->
info_text,
"-as %s: Not enough arguments to option %s",
1857 (strcmp(argpt,
"--quoted_path_list") == 0) | 2);
1859 goto problem_handler_2;
1861 &allow_dir_id_ext, &iso_level, 0);
1864 }
else if(strcmp(argpt,
"-f")==0 || strcmp(argpt,
"-follow-links")==0) {
1866 }
else if(strcmp(argpt,
"-pad")==0) {
1868 }
else if(strcmp(argpt,
"-no-pad")==0) {
1870 }
else if(strcmp(argpt,
"-print-size")==0) {
1872 }
else if(strcmp(argpt,
"-o")==0 || strcmp(argpt,
"-output") == 0) {
1875 }
else if(strcmp(argpt,
"-M")==0 || strcmp(argpt,
"-dev")==0 ||
1876 strcmp(argpt,
"-prev-session")==0) {
1879 }
else if(strcmp(argpt,
"-C")==0 ||
1880 strcmp(argpt,
"-cdrecord-params")==0) {
1883 }
else if(strcmp(argpt,
"-help")==0) {
1885 }
else if(strcmp(argpt,
"-V")==0 || strcmp(argpt,
"-volid")==0 ||
1886 strcmp(argpt,
"-volset")==0 ||
1887 strcmp(argpt,
"-p")==0 || strcmp(argpt,
"-preparer")==0 ||
1888 strcmp(argpt,
"-P")==0 || strcmp(argpt,
"-publisher")==0 ||
1889 strcmp(argpt,
"-A")==0 || strcmp(argpt,
"-appid")==0 ||
1890 strcmp(argpt,
"--application_use")==0 ||
1891 strcmp(argpt,
"-sysid")==0 ||
1892 strcmp(argpt,
"-biblio")==0 ||
1893 strcmp(argpt,
"-copyright")==0 ||
1894 strcmp(argpt,
"-abstract")==0 ) {
1896 goto not_enough_args;
1899 if(strcmp(argpt,
"-V")==0 || strcmp(argpt,
"-volid")==0)
1901 else if(strcmp(argpt,
"-volset")==0)
1903 else if(strcmp(argpt,
"-p")==0 ||
1904 strcmp(argpt,
"-preparer")==0)
1906 else if(strcmp(argpt,
"-P")==0 ||
1907 strcmp(argpt,
"-publisher")==0)
1909 else if(strcmp(argpt,
"-A")==0 || strcmp(argpt,
"-appid")==0)
1911 else if(strcmp(argpt,
"-sysid")==0)
1913 else if(strcmp(argpt,
"-biblio")==0)
1915 else if(strcmp(argpt,
"-copyright")==0)
1917 else if(strcmp(argpt,
"-abstract")==0)
1919 else if(strcmp(argpt,
"--application_use")==0)
1922 goto problem_handler_2;
1923 }
else if(strcmp(argpt,
"-m")==0 || strcmp(argpt,
"-exclude")==0 ||
1924 strcmp(argpt,
"-x")==0 || strcmp(argpt,
"-old-exclude")==0) {
1926 goto not_enough_args;
1930 if(strchr(argv[i],
'/')!=NULL) {
1937 goto problem_handler_2;
1938 }
else if(strcmp(argpt,
"-exclude-list")==0) {
1940 goto not_enough_args;
1947 goto problem_handler_2;
1948 }
else if(strcmp(argpt,
"-v")==0 || strcmp(argpt,
"-verbose")==0 ||
1949 strcmp(argpt,
"-quiet")==0) {
1952 }
else if(strcmp(argpt,
"-iso-level")==0) {
1955 }
else if(strcmp(argpt,
"-no-emul-boot")==0 ||
1956 strcmp(argpt,
"-hard-disk-boot")==0 ||
1957 strcmp(argpt,
"-boot-info-table")==0 ||
1958 strcmp(argpt,
"--grub2-boot-info") == 0 ||
1959 strncmp(argpt,
"isolinux_mbr=", 13)==0 ||
1960 strcmp(argpt,
"-eltorito-alt-boot")==0 ||
1961 strcmp(argpt,
"--protective-msdos-label")==0 ||
1962 strcmp(argpt,
"--mbr-force-bootable")==0 ||
1963 strcmp(argpt,
"--boot-catalog-hide")==0 ||
1964 strcmp(argpt,
"-isohybrid-gpt-basdat")==0 ||
1965 strcmp(argpt,
"-isohybrid-gpt-hfsplus")==0 ||
1966 strcmp(argpt,
"-isohybrid-apm-hfsplus")==0 ||
1967 strcmp(argpt,
"-part_like_isohybrid")==0) {
1968 delay_opt_list[delay_opt_count++]= i;
1969 if(argv[i] != argpt)
1970 delay_opt_list[delay_opt_count - 1]|= 1u<<31;
1971 }
else if(strcmp(argpt,
"-b") == 0 ||
1972 strcmp(argpt,
"-eltorito-boot") == 0 ||
1973 strcmp(argpt,
"-eltorito-platform") == 0 ||
1974 strcmp(argpt,
"--efi-boot") == 0 ||
1975 strcmp(argpt,
"-e") == 0 ||
1976 strcmp(argpt,
"-mips-boot") == 0 ||
1977 strcmp(argpt,
"-mipsel-boot") == 0 ||
1978 strcmp(argpt,
"-c") == 0 ||
1979 strcmp(argpt,
"-eltorito-catalog") == 0 ||
1980 strcmp(argpt,
"-boot-load-size") == 0 ||
1981 strcmp(argpt,
"-eltorito-id") == 0 ||
1982 strcmp(argpt,
"-eltorito-selcrit") == 0 ||
1983 strcmp(argpt,
"--embedded-boot")==0 ||
1984 strcmp(argpt,
"-generic-boot")==0 ||
1985 strcmp(argpt,
"-G") == 0 ||
1986 strcmp(argpt,
"-partition_offset") == 0 ||
1987 strcmp(argpt,
"-partition_hd_cyl") == 0 ||
1988 strcmp(argpt,
"-partition_sec_hd") == 0 ||
1989 strcmp(argpt,
"-partition_cyl_align") == 0 ||
1990 strcmp(argpt,
"-isohybrid-mbr") == 0 ||
1991 strcmp(argpt,
"--grub2-mbr") == 0 ||
1992 strncmp(argpt,
"-hppa-", 6) == 0 ||
1993 strcmp(argpt,
"-alpha-boot") == 0 ||
1994 strcmp(argpt,
"--gpt_disk_guid") == 0 ||
1995 strcmp(argpt,
"-iso_mbr_part_type") == 0) {
1997 goto not_enough_args;
1998 delay_opt_list[delay_opt_count++]= i;
1999 if(argv[i] != argpt)
2000 delay_opt_list[delay_opt_count - 1]|= 1u<<31;
2002 }
else if(strncmp(argpt,
"--modification-date=", 20)==0) {
2005 goto problem_handler_2;
2007 }
else if(strcmp(argpt,
"--set_all_file_dates") == 0) {
2009 goto not_enough_args;
2013 goto problem_handler_2;
2014 }
else if(strcmp(argpt,
"-input-charset")==0) {
2017 }
else if(strcmp(argpt,
"-output-charset")==0) {
2020 }
else if(strcmp(argpt,
"--hardlinks")==0 ||
2021 strcmp(argpt,
"--acl")==0 ||
2022 strcmp(argpt,
"--xattr")==0 ||
2023 strcmp(argpt,
"--xattr-any")==0 ||
2024 strcmp(argpt,
"--md5")==0 ||
2025 strcmp(argpt,
"--for_backup")==0) {
2027 }
else if(strcmp(argpt,
"--scdbackup_tag")==0) {
2030 }
else if(strcmp(argpt,
"--sort-weight")==0) {
2032 goto not_enough_args;
2035 weight_list[weight_count++]= i - 2;
2036 }
else if(strcmp(argpt,
"--sort-weight-list") == 0 ||
2037 strcmp(argpt,
"--sort-weight-patterns") == 0) {
2039 goto not_enough_args;
2041 if(
Sfile_str(sort_file, argv[i], 0) <= 0)
2043 sort_file_pattern= (strcmp(argpt,
"--sort-weight-patterns") == 0);
2045 }
else if(strcmp(argpt,
"-z")==0 ||
2046 strcmp(argpt,
"-transparent-compression")==0 ||
2047 strcmp(argpt,
"--zisofs-version-2") == 0 ||
2048 strcmp(argpt,
"--zisofs2-susp-z2") == 0 ||
2049 strcmp(argpt,
"--zisofs2-susp-zf") == 0) {
2051 }
else if(strcmp(argpt,
"-U") == 0 ||
2052 strcmp(argpt,
"-untranslated-filenames") == 0) {
2054 &option_d, &iso_level, &lower_r, ra_text, 0);
2056 goto problem_handler_2;
2057 }
else if(strcmp(argpt,
"-untranslated_name_len") == 0) {
2059 goto not_enough_args;
2061 sprintf(sfe,
"untranslated_name_len=%s", argv[i]);
2064 goto problem_handler_2;
2065 }
else if(strcmp(argpt,
"-N") == 0 ||
2066 strcmp(argpt,
"-omit-version-number") == 0) {
2068 &option_d, &iso_level, &lower_r, ra_text, 0);
2070 goto problem_handler_2;
2071 }
else if(strcmp(argpt,
"-l") == 0 ||
2072 strcmp(argpt,
"-full-iso9660-filenames") == 0) {
2074 &option_d, &iso_level, &lower_r, ra_text, 0);
2076 goto problem_handler_2;
2077 }
else if(strcmp(argpt,
"-max-iso9660-filenames") == 0) {
2079 }
else if(strcmp(argpt,
"-d") == 0 ||
2080 strcmp(argpt,
"-omit-period") == 0) {
2082 &option_d, &iso_level, &lower_r, ra_text, 0);
2084 goto problem_handler_2;
2085 }
else if(strcmp(argpt,
"-allow-lowercase") == 0) {
2087 }
else if(strcmp(argpt,
"-relaxed-filenames") == 0) {
2089 }
else if(strcmp(argpt,
"-hide") == 0 ||
2090 strcmp(argpt,
"-hide-list") == 0 ||
2091 strcmp(argpt,
"-hide-joliet") == 0 ||
2092 strcmp(argpt,
"-hide-joliet-list") == 0 ||
2093 strcmp(argpt,
"-hide-hfsplus") == 0 ||
2094 strcmp(argpt,
"-hide-hfsplus-list") == 0) {
2096 goto not_enough_args;
2099 }
else if(strcmp(argpt,
"-root") == 0 ||
2100 strcmp(argpt,
"-old-root") == 0) {
2102 goto not_enough_args;
2105 }
else if(strcmp(argpt,
"--old-root-no-md5")==0 ||
2106 strcmp(argpt,
"--old-root-devno")==0 ||
2107 strcmp(argpt,
"--old-root-no-ino")==0) {
2109 }
else if(strcmp(argpt,
"-dir-mode") == 0) {
2111 goto not_enough_args;
2114 argv[i], &mode_and, &mode_or, 0);
2116 goto problem_handler_2;
2118 }
else if(strcmp(argpt,
"-file-mode") == 0) {
2120 goto not_enough_args;
2123 argv[i], &mode_and, &mode_or, 0);
2125 goto problem_handler_2;
2127 }
else if(strcmp(argpt,
"-jigdo-jigdo") == 0 ||
2128 strcmp(argpt,
"-jigdo-template") == 0 ||
2129 strcmp(argpt,
"-jigdo-min-file-size") == 0 ||
2130 strcmp(argpt,
"-jigdo-exclude") == 0 ||
2131 strcmp(argpt,
"-jigdo-force-md5") == 0 ||
2132 strcmp(argpt,
"-jigdo-force-checksum") == 0 ||
2133 strcmp(argpt,
"-jigdo-map") == 0 ||
2134 strcmp(argpt,
"-jigdo-checksum-algorithm") == 0 ||
2135 strcmp(argpt,
"-jigdo-template-compress") == 0 ||
2136 strcmp(argpt,
"-checksum_algorithm_iso") == 0 ||
2137 strcmp(argpt,
"-checksum_algorithm_template") == 0 ||
2138 strcmp(argpt,
"-md5-list") == 0 ||
2139 strcmp(argpt,
"-checksum-list") == 0) {
2143 goto problem_handler_2;
2145 }
else if(strcmp(argpt,
"-chrp-boot-part") == 0 ||
2146 strcmp(argpt,
"-chrp-boot") == 0) {
2149 goto problem_handler_2;
2151 }
else if(strcmp(argpt,
"-prep-boot-part") == 0) {
2153 goto not_enough_args;
2159 }
else if(strcmp(argpt,
"-efi-boot-part") == 0) {
2161 goto not_enough_args;
2167 }
else if(strcmp(argpt,
"-append_partition") == 0) {
2169 goto not_enough_args;
2174 goto problem_handler_2;
2176 }
else if(strcmp(argpt,
"-appended_part_as_gpt") == 0) {
2179 }
else if(strcmp(argpt,
"-appended_part_as_apm") == 0) {
2182 }
else if(strcmp(argpt,
"-B") == 0 ||
2183 strcmp(argpt,
"-sparc-boot") == 0) {
2189 strcpy(pathspec,
"sparc_label=");
2193 goto problem_handler_2;
2197 partition_number= 2;
2198 while(ept != NULL) {
2199 ept= strchr(cpt,
',');
2201 strncpy(pathspec, cpt, ept - cpt);
2202 pathspec[ept - cpt]= 0;
2205 strcpy(pathspec, cpt);
2206 if(strcmp(pathspec,
"...") == 0) {
2207 for(; partition_number <= 8; partition_number++) {
2208 sprintf(partno_text,
"%d", partition_number);
2212 goto problem_handler_2;
2215 if(partition_number > 8) {
2217 "-as %s -sparc-boot %s : Too many boot images", whom, argv[i]);
2219 goto problem_handler_2;
2221 sprintf(partno_text,
"%d", partition_number);
2225 goto problem_handler_2;
2230 }
else if(strcmp(argpt,
"-sparc-label") == 0) {
2232 goto not_enough_args;
2234 sprintf(sfe,
"sparc_label=%s", argv[i]);
2237 goto problem_handler_2;
2239 }
else if(strcmp(argpt,
"--grub2-sparc-core") == 0) {
2241 goto not_enough_args;
2243 sprintf(sfe,
"grub2_sparc_core=%s", argv[i]);
2246 goto problem_handler_2;
2248 }
else if(strcmp(argpt,
"--stdio_sync")==0) {
2250 goto not_enough_args;
2254 }
else if(strcmp(argpt,
"--emul-toc")==0 ||
2255 strcmp(argpt,
"--no-emul-toc")==0) {
2258 }
else if(strcmp(argpt,
"--old-empty")==0) {
2261 }
else if(strcmp(argpt,
"-disallow_dir_id_ext")==0) {
2264 }
else if(strcmp(argpt,
"--no_rc")==0) {
2267 }
else if(strcmp(argpt,
"-D") == 0 ||
2268 strcmp(argpt,
"-disable-deep-relocation") == 0) {
2270 &option_d, &iso_level, &lower_r, ra_text, 0);
2272 goto problem_handler_2;
2274 }
else if(strcmp(argpt,
"-hide-rr-moved") == 0) {
2275 rr_reloc_dir_pt=
".rr_moved";
2278 }
else if(strcmp(argpt,
"-rr_reloc_dir") == 0) {
2280 rr_reloc_dir_pt= argv[i];
2282 if(rr_reloc_dir_pt[0] ==
'/')
2284 if(strchr(rr_reloc_dir_pt,
'/') != NULL) {
2286 "-as %s -rr_reloc_dir %s : May only use directories in root directory",
2292 goto problem_handler_2;
2295 }
else if(strcmp(argpt,
"-log-file") == 0 ||
2296 strcmp(argpt,
"-file_name_limit") == 0) {
2300 }
else if(strcmp(argpt,
"-gui") == 0) {
2303 }
else if(strcmp(argpt,
"-uid") == 0) {
2305 goto not_enough_args;
2309 goto problem_handler_2;
2311 }
else if(strcmp(argpt,
"-gid") == 0) {
2313 goto not_enough_args;
2317 goto problem_handler_2;
2319 }
else if(argpt[0]==
'-' && argpt[1]!=0) {
2321 &option_d, &iso_level, &lower_r, ra_text, 1);
2324 &option_d, &iso_level, &lower_r, ra_text, 0);
2326 goto problem_handler_2;
2331 sprintf(xorriso->
info_text,
"-as %s: Unsupported option %s",
2335 goto problem_handler_2;
2337 sprintf(xorriso->
info_text,
"-as %s: Unrecognized option %s",
2340 goto problem_handler_2;
2346 goto problem_handler_2;
2362 strcpy(eff_path, iso_rr_pt);
2363 iso_rr_pt= eff_path;
2364 for(wpt= rpt= iso_rr_pt; *rpt != 0; rpt++) {
2366 if(*(rpt + 1) ==
'\\')
2368 else if(*(rpt + 1) ==
'=')
2380 goto problem_handler_2;
2390 (was_path << 1) | (root_seen << 2));
2394 goto problem_handler_2;
2398 &allow_dir_id_ext, &iso_level, 0);
2414 rm_merge_args[0]= xorriso->
wdi;
2416 rm_merge_args[0]=
"/";
2417 rm_merge_args[1]=
"-exec";
2418 rm_merge_args[2]=
"rm_merge";
2426 static char *lower_r_args[3]= {
"/",
"-exec",
"mkisofs_r"};
2433 static char *dir_mode_args[6]= {
"/",
"-type",
"d",
"-exec",
"chmod",
""};
2435 sprintf(sfe,
"0%o", (
unsigned int) dir_mode);
2436 dir_mode_args[5]= sfe;
2441 if(file_mode >= 0) {
2442 static char *file_mode_args[6]= {
"/",
"-type",
"f",
"-exec",
"chmod",
""};
2444 sprintf(sfe,
"0%o", (
unsigned int) file_mode);
2445 file_mode_args[5]= sfe;
2457 for(j= 0; j < weight_count; j++) {
2461 sort_weight_args[0]= argv[i + 2];
2462 sort_weight_args[1]=
"-exec";
2463 sort_weight_args[2]=
"sort_weight";
2464 sort_weight_args[3]= argv[i + 1];
2481 for(j= 0; j < delay_opt_count; j++) {
2482 i= delay_opt_list[j] & ~(1u << 31);
2483 if(delay_opt_list[j] & (1u << 31))
2487 if(strcmp(argpt,
"-no-emul-boot")==0) {
2490 }
else if(strcmp(argpt,
"-hard-disk-boot")==0) {
2493 }
else if(strcmp(argpt,
"-boot-info-table")==0) {
2495 }
else if(strcmp(argpt,
"--grub2-boot-info") == 0) {
2498 }
else if(strcmp(argpt,
"-b") == 0 ||
2499 strcmp(argpt,
"-eltorito-boot") == 0 ||
2500 strcmp(argpt,
"--efi-boot") == 0 ||
2501 strcmp(argpt,
"-e") == 0) {
2503 if(strcmp(argpt,
"--efi-boot") == 0) {
2507 goto problem_handler_boot;
2516 if(strcmp(argpt,
"-e") == 0)
2525 if(argv[i][0] !=
'/' && strncmp(argv[i],
"--interval:", 11) != 0)
2526 strcat(boot_path,
"/");
2527 ret=
Sfile_str(boot_path + strlen(boot_path), argv[i], 0);
2533 goto problem_handler_boot;
2537 }
else if(strcmp(argpt,
"-eltorito-platform") == 0) {
2539 goto not_enough_args;
2541 mem= mkisofs_b_platform_id;
2543 if(mkisofs_b_platform_id < 0) {
2544 mkisofs_b_platform_id= 0;
2545 goto problem_handler_boot;
2547 if(mkisofs_b_platform_id != mem &&
2551 goto problem_handler_boot;
2554 }
else if(strcmp(argpt,
"-c") == 0 ||
2555 strcmp(argpt,
"-eltorito-catalog") == 0) {
2557 goto not_enough_args;
2560 if(argv[i][0] !=
'/')
2566 if(with_cat_path == 0)
2568 }
else if(strcmp(argpt,
"-boot-load-size") == 0) {
2570 goto not_enough_args;
2572 if(strcmp(argv[i],
"full") == 0) {
2575 sscanf(argv[i],
"%d", &ret);
2579 }
else if(strcmp(argpt,
"-eltorito-id") == 0 ||
2580 strcmp(argpt,
"-eltorito-selcrit") == 0) {
2582 goto not_enough_args;
2584 if(strcmp(argpt,
"-eltorito-id") == 0)
2585 sprintf(sfe,
"id_string=%s", argv[i]);
2587 sprintf(sfe,
"sel_crit=%s", argv[i]);
2590 goto problem_handler_boot;
2591 }
else if(strncmp(argpt,
"isolinux_mbr=", 13)==0) {
2592 sprintf(sfe,
"isohybrid=%s", argpt + 13);
2595 goto problem_handler_boot;
2596 }
else if(strcmp(argpt,
"-isohybrid-gpt-basdat") == 0) {
2599 }
else if(strcmp(argpt,
"-isohybrid-gpt-hfsplus") == 0) {
2602 }
else if(strcmp(argpt,
"-isohybrid-apm-hfsplus") == 0) {
2605 }
else if(strcmp(argpt,
"-part_like_isohybrid") == 0) {
2608 }
else if(strcmp(argpt,
"-iso_mbr_part_type") == 0) {
2610 goto not_enough_args;
2612 sprintf(sfe,
"iso_mbr_part_type=%s", argv[i]);
2615 goto problem_handler_boot;
2617 }
else if(strcmp(argpt,
"--gpt_disk_guid") == 0) {
2619 goto not_enough_args;
2623 goto problem_handler_boot;
2625 }
else if(strcmp(argpt,
"-eltorito-alt-boot")==0) {
2628 goto problem_handler_boot;
2629 }
else if(strcmp(argpt,
"--embedded-boot")==0 ||
2630 strcmp(argpt,
"-generic-boot")==0 ||
2631 strcmp(argpt,
"-G") == 0 ||
2632 strcmp(argpt,
"-isohybrid-mbr") == 0 ||
2633 strcmp(argpt,
"--grub2-mbr") == 0) {
2635 goto not_enough_args;
2637 if(strcmp(argv[i],
".") == 0)
2643 goto problem_handler_boot;
2644 if(strcmp(argpt,
"-isohybrid-mbr")==0)
2647 else if(strcmp(argpt,
"--grub2-mbr") == 0)
2650 }
else if(strcmp(argpt,
"--protective-msdos-label")==0) {
2653 }
else if(strcmp(argpt,
"--mbr-force-bootable") == 0) {
2656 }
else if(strcmp(argpt,
"--boot-catalog-hide")==0) {
2658 }
else if(strcmp(argpt,
"-partition_offset") == 0 ||
2659 strcmp(argpt,
"-partition_sec_hd") == 0 ||
2660 strcmp(argpt,
"-partition_hd_cyl") == 0 ||
2661 strcmp(argpt,
"-partition_cyl_align") == 0) {
2663 goto not_enough_args;
2665 sprintf(sfe,
"%s=%.16s", argpt + 1, argv[i]);
2668 goto problem_handler_boot;
2670 }
else if(strcmp(argpt,
"-mips-boot") == 0 ||
2671 strcmp(argpt,
"-mipsel-boot") == 0) {
2673 goto not_enough_args;
2675 if(strcmp(argpt,
"-mipsel-boot") == 0)
2676 strcpy(sfe,
"mipsel_path=");
2678 strcpy(sfe,
"mips_path=");
2685 goto problem_handler_boot;
2687 }
else if(strncmp(argpt,
"-hppa-", 6) == 0) {
2689 goto not_enough_args;
2691 sprintf(sfe,
"-as mkisofs %s %s", argpt, argv[i]);
2693 if(palohdrversion != 4)
2700 goto problem_handler_boot;
2702 }
else if(strcmp(argpt,
"-alpha-boot") == 0) {
2704 goto not_enough_args;
2706 sprintf(sfe,
"-as mkisofs %s %s", argpt, argv[i]);
2712 }
else if(strcmp(argpt,
"-hfs-bless") == 0) {
2713 static char *bless_arg_data[6]= {
2714 "/",
"-disk_path",
"",
"-exec",
"set_hfs_bless",
"p"};
2716 for(j= 0; j < 6; j++)
2717 bless_args[j]= bless_arg_data[j];
2718 bless_args[2]= argv[i + 1];
2725 "-hfs-bless: Could not find a data file which stems from underneath disk directory ");
2729 "Consider to use: -hfs-bless-by p ISO_RR_PATH", 0,
"HINT", 0);
2730 goto problem_handler_boot;
2733 }
else if(strcmp(argpt,
"-hfs-bless-by") == 0) {
2736 goto problem_handler_boot;
2738 }
else if(strcmp(argpt,
"-hfsplus-file-creator-type") == 0) {
2740 argv[i + 1], argv[i + 2], 0);
2742 goto problem_handler_boot;
2746 problem_handler_boot:;
2754 if(with_boot_image && with_cat_path == 0)
2780 if(was_path && (!do_print_size) && !old_root[0])
2785 if(weight_list != NULL)
2787 if(delay_opt_list != NULL)
2788 free(delay_opt_list);
2803 int end_idx, ret, old_idx;
2808 if(end_idx<=0 || old_idx>=argc)
2810 ret=
Xorriso_genisofs(xorriso,
"genisofs", end_idx-old_idx, argv+old_idx, 0);
2818 int end_idx, ret, old_idx;
2823 if(end_idx<=0 || old_idx>=argc)
2825 ret=
Xorriso_cdrskin(xorriso,
"cdrskin", end_idx-old_idx, argv+old_idx, 0);
int Xorriso_afile_fopen(struct XorrisO *xorriso, char *filename, char *mode, FILE **ret_fp, int flag)
int Xorriso_convert_modstring(struct XorrisO *xorriso, char *cmd, char *mode, mode_t *mode_and, mode_t *mode_or, int flag)
int Xorriso_msinfo(struct XorrisO *xorriso, int *msc1, int *msc2, int flag)
int Xorriso_reaquire_outdev(struct XorrisO *xorriso, int flag)
int Xorriso_atip(struct XorrisO *xorriso, int flag)
int Xorriso_genisofs_add_boot(struct XorrisO *xorriso, int flag)
int Xorriso_genisofs_count_args(struct XorrisO *xorriso, int argc, char **argv, int *count, int flag)
int Xorriso_cdrskin(struct XorrisO *xorriso, char *whom, int argc, char **argv, int flag)
int Xorriso_genisofs_platform(struct XorrisO *xorriso, char *id, int flag)
int Xorriso_genisofs_fused_options(struct XorrisO *xorriso, char *whom, char *opts, int *option_d, int *iso_level, int *lower_r, char ra_text[80], int flag)
int Xorriso_genisofs_path_pecul(struct XorrisO *xorriso, int *was_path, int with_emul_toc, int *allow_dir_id_ext, int *iso_level, int flag)
int Xorriso_genisofs_hide_list(struct XorrisO *xorriso, char *whom, char *adr, int hide_attrs, int flag)
int Xorriso_genisofs_ignore(struct XorrisO *xorriso, char *whom, char *argpt, int *i, int flag)
int Xorriso_genisofs_hide(struct XorrisO *xorriso, char *whom, char *pattern, int hide_attrs, int flag)
int Xorriso_genisofs_strip_dash(struct XorrisO *xorriso, char *arg_in, char **arg_out, int flag)
int Xorriso_graftable_pathspec(struct XorrisO *xorriso, char *in_pathspec, char *pathspec, int flag)
int Xorriso_as_cdrskin(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag)
int Xorriso_as_genisofs(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag)
int Xorriso_genisofs_help(struct XorrisO *xorriso, int flag)
int Xorriso_genisofs(struct XorrisO *xorriso, char *whom, int argc, char **argv, int flag)
int Xorriso_cdrskin_uses_stdout(struct XorrisO *xorriso, int argc, char **argv, int flag)
int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag)
int Xorriso_set_hppa_boot_parm(struct XorrisO *xorriso, char *text, char *what, int flag)
int Xorriso_change_is_pending(struct XorrisO *xorriso, int flag)
int Xorriso_set_alpha_boot(struct XorrisO *xorriso, char *path, int flag)
int Xorriso_coordinate_system_area(struct XorrisO *xorriso, int sa_type, int options, char *cmd, int flag)
int Xorriso_apply_sort_file(struct XorrisO *xorriso, char *path, int flag)
int Xorriso_mkdir(struct XorrisO *xorriso, char *path, int flag)
int Xorriso_clone_under(struct XorrisO *xorriso, char *origin, char *dest, int flag)
int Xorriso_hfsplus_bless(struct XorrisO *xorriso, char *path, void *in_node, char *blessing, int flag)
int Xorriso_hfsplus_file_creator_type(struct XorrisO *xorriso, char *path, void *in_node, char *creator, char *hfs_type, int flag)
int Xorriso_iso_lstat(struct XorrisO *xorriso, char *path, struct stat *stbuf, int flag)
int Xorriso_normalize_img_path(struct XorrisO *xorriso, char *wd, char *img_path, char eff_path[], int flag)
int Fileliste__escape_source_path(char *line, int size, int flag)
int Fileliste__target_source_limit(char *line, char sep, char **limit_pt, int flag)
int Wait_for_input(int fd, int microsec, int flag)
double Scanf_io_size(char *text, int flag)
char * Text_shellsafe(char *in_text, char *out_text, int flag)
int Xorriso_option_abstract_file(struct XorrisO *xorriso, char *name, int flag)
int Xorriso_option_blank(struct XorrisO *xorriso, char *in_mode, int flag)
int Xorriso_option_append_partition(struct XorrisO *xorriso, char *partno_text, char *type_text, char *image_path, int flag)
int Xorriso_option_biblio_file(struct XorrisO *xorriso, char *name, int flag)
int Xorriso_option_copyright_file(struct XorrisO *xorriso, char *name, int flag)
int Xorriso_option_acl(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_boot_image(struct XorrisO *xorriso, char *form, char *treatment, int flag)
int Xorriso_option_add(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag)
int Xorriso_option_charset(struct XorrisO *xorriso, char *name, int flag)
int Xorriso_option_application_id(struct XorrisO *xorriso, char *name, int flag)
int Xorriso_option_application_use(struct XorrisO *xorriso, char *path, int flag)
int Xorriso_option_devices(struct XorrisO *xorriso, int flag)
int Xorriso_option_eject(struct XorrisO *xorriso, char *which, int flag)
int Xorriso_option_find(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag)
int Xorriso_option_hardlinks(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_grow_blindly(struct XorrisO *xorriso, char *msc2, int flag)
int Xorriso_option_fs(struct XorrisO *xorriso, char *size, int flag)
int Xorriso_option_follow(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_gid(struct XorrisO *xorriso, char *gid, int flag)
int Xorriso_option_drive_access(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_file_name_limit(struct XorrisO *xorriso, char *value, int flag)
int Xorriso_option_dev(struct XorrisO *xorriso, char *in_adr, int flag)
int Xorriso_option_disk_dev_ino(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_dvd_obs(struct XorrisO *xorriso, char *obs, int flag)
int Xorriso_option_modesty_on_drive(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_not_list(struct XorrisO *xorriso, char *adr, int flag)
int Xorriso_option_not_paths(struct XorrisO *xorriso, int argc, char **argv, int *idx, int flag)
int Xorriso_option_md5(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_load(struct XorrisO *xorriso, char *adr_mode, char *adr_value, int flag)
int Xorriso_option_jigdo(struct XorrisO *xorriso, char *aspect, char *arg, int flag)
int Xorriso_option_not_leaf(struct XorrisO *xorriso, char *pattern, int flag)
int Xorriso_option_volid(struct XorrisO *xorriso, char *volid, int flag)
int Xorriso_option_uid(struct XorrisO *xorriso, char *uid, int flag)
int Xorriso_option_volume_date(struct XorrisO *xorriso, char *time_type, char *timestring, int flag)
int Xorriso_option_print_size(struct XorrisO *xorriso, int flag)
int Xorriso_option_stdio_sync(struct XorrisO *xorriso, char *rhythm, int flag)
int Xorriso_option_scdbackup_tag(struct XorrisO *xorriso, char *listname, char *recname, int flag)
int Xorriso_option_zisofs(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_xattr(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_report_about(struct XorrisO *xorriso, char *in_severity, int flag)
int Xorriso_option_preparer_id(struct XorrisO *xorriso, char *name, int flag)
int Xorriso_option_scsi_dev_family(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_stream_recording(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_use_immed_bit(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_publisher(struct XorrisO *xorriso, char *name, int flag)
int Xorriso_option_padding(struct XorrisO *xorriso, char *size, int flag)
int Xorriso_option_rr_reloc_dir(struct XorrisO *xorriso, char *name, int flag)
int Xorriso_option_scsi_log(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_option_speed(struct XorrisO *xorriso, char *speed_in, int flag)
int Xorriso_option_version(struct XorrisO *xorriso, int flag)
int Xorriso_option_toc(struct XorrisO *xorriso, int flag)
int Xorriso_option_path_list(struct XorrisO *xorriso, char *adr, int flag)
int Xorriso_option_system_id(struct XorrisO *xorriso, char *name, int flag)
int Xorriso_option_volset_id(struct XorrisO *xorriso, char *name, int flag)
int Xorriso_option_update(struct XorrisO *xorriso, char *disk_path, char *iso_path, int flag)
int Xorriso_eval_problem_status(struct XorrisO *xorriso, int ret, int flag)
int Xorriso_end_idx(struct XorrisO *xorriso, int argc, char **argv, int idx, int flag)
int Xorriso_path_is_hidden(struct XorrisO *xorriso, char *path, int flag)
int Sfile_type(char *filename, int flag)
int Sfile_leafname(char *path, char leafname[4096], int flag)
int Sfile_str(char target[4096], char *source, int flag)
int Sfile_prepend_path(char *prefix, char path[4096], int flag)
#define TSOB_FELD(typ, count)
#define Xorriso_free_meM(pt)
#define Xorriso_alloc_meM(pt, typ, count)
int boot_image_cat_hidden
int do_padding_by_libisofs
char boot_image_cat_path[4096]
char efi_boot_partition[4096]
int stdio_sync_is_default
char result_line[10 *4096]
int volset_change_pending
char prep_partition[4096]
char ascii_disc_label[129]
int boot_img_size_default
char boot_image_bin_path[4096]
off_t boot_image_load_size
char report_about_text[20]
int allow_dir_id_ext_dflt
int Xorriso_msgs_submit(struct XorrisO *xorriso, int error_code, char msg_text[], int os_errno, char severity[], int flag)
int Xorriso_read_lines(struct XorrisO *xorriso, FILE *fp, int *linecount, int *argc, char ***argv, int flag)
int Xorriso_pacifier_callback(struct XorrisO *xorriso, char *what_done, off_t count, off_t todo, char *current_object, int flag)
int Xorriso_no_malloc_memory(struct XorrisO *xorriso, char **to_free, int flag)
int Xorriso_info(struct XorrisO *xorriso, int flag)
int Xorriso_write_to_channel(struct XorrisO *xorriso, char *in_text, int channel_no, int flag)
int Xorriso_result(struct XorrisO *xorriso, int flag)
int Xorriso_relax_compliance(struct XorrisO *xorriso, char *mode, int flag)
int Xorriso_set_system_area_path(struct XorrisO *xorriso, char *path, int flag)
int Xorriso_retry_burn_track(struct XorrisO *xorriso, off_t write_start_address, char *track_source, off_t tsize, int flag)
int Xorriso_parse_gpt_guid(struct XorrisO *xorriso, char *text, int flag)
int Xorriso_burn_track(struct XorrisO *xorriso, off_t write_start_address, char *track_source, off_t tsize, int flag)
int Xorriso_attach_boot_image(struct XorrisO *xorriso, int flag)