📄 mkisofs.c
字号:
use_eltorito++; { long val; char *ptr; val = strtol(optarg, &ptr, 0); if (*ptr || val < 0 || val >= 0x10000) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Boot image load address invalid.\n");#else fprintf(stderr, "Boot image load address invalid.\n"); exit(1);#endif } load_addr = val; } get_boot_entry(); current_boot_entry->load_addr = load_addr; break; case OPTION_BOOT_LOAD_SIZE: use_eltorito++; { long val; char *ptr; val = strtol(optarg, &ptr, 0); if (*ptr || val < 0 || val >= 0x10000) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Boot image load size invalid.\n");#else fprintf(stderr, "Boot image load size invalid.\n"); exit(1);#endif } load_size = val; } get_boot_entry(); current_boot_entry->load_size = load_size; break; case OPTION_BOOT_INFO_TABLE: use_eltorito++; boot_info_table++; get_boot_entry(); current_boot_entry->boot_info_table = 1; break;#ifdef APPLE_HYB case OPTION_HFS_TYPE: deftype = optarg; hfs_ct++; if (strlen(deftype) != 4) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "HFS default TYPE string has illegal length.\n");#else fprintf(stderr, "HFS default TYPE string has illegal length.\n"); exit(1);#endif }; break; case OPTION_HFS_CREATOR: defcreator = optarg; hfs_ct++; if (strlen(defcreator) != 4) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "HFS default CREATOR string has illegal length.\n");#else fprintf(stderr, "HFS default CREATOR string has illegal length.\n"); exit(1);#endif }; break; case 'H': /* * -H Reserved by POSIX.1-2001 * Meaning: Follow symbolic links on command line * Symbolic links found by tree traversal are not * followed. */ afpfile = optarg; hfs_last = MAP_LAST; break; case 'h': apple_hyb = 1; break; case 'g': apple_ext = 1; break; case OPTION_PROBE: probe = 1; break; case OPTION_MACNAME: use_mac_name = 1; break; case OPTION_NOMACFILES:#ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Warning: -no-mac-files no longer used ... ignoring\n");#else fprintf(stderr, "Warning: -no-mac-files no longer used ... ignoring\n");#endif break; case OPTION_BOOT_HFS_FILE: hfs_boot_file = optarg; /* fall through */ case OPTION_GEN_PT: gen_pt = 1; break; case OPTION_MAGIC_FILE: magic_file = optarg; hfs_last = MAG_LAST; break; case OPTION_AUTOSTART: autoname = optarg; /* gen_pt = 1; */ break; case OPTION_BSIZE: afe_size = atoi(optarg); hfs_select |= DO_FEU; hfs_select |= DO_FEL; break; case OPTION_HFS_VOLID: hfs_volume_id = optarg; break; case OPTION_ROOT_INFO: root_info = optarg; /* fall through */ case OPTION_ICON_POS: icon_pos = 1; break; /* Mac/Unix types to include */ case OPTION_CAP: hfs_select |= DO_CAP; break; case OPTION_NETA: hfs_select |= DO_NETA; break; case OPTION_DBL: hfs_select |= DO_DBL; break; case OPTION_ESH: case OPTION_USH: hfs_select |= DO_ESH; break; case OPTION_FE: hfs_select |= DO_FEU; hfs_select |= DO_FEL; break; case OPTION_SGI: case OPTION_XIN: hfs_select |= DO_SGI; break; case OPTION_MBIN: hfs_select |= DO_MBIN; break; case OPTION_SGL: hfs_select |= DO_SGL; break; case OPTION_DAVE: hfs_select |= DO_DAVE; break; case OPTION_SFM: hfs_select |= DO_SFM; break; case OPTION_XDBL: hfs_select |= DO_XDBL; break; case OPTION_XHFS:#ifdef IS_MACOS_X hfs_select |= DO_XHFS;#else /* IS_MACOS_X */#ifdef USE_LIBSCHILY errmsgno(EX_BAD, "Warning: --osx-hfs only works on MacOS X ... ignoring\n");#else /* USE_LIBSCHILY */ fprintf(stderr, "Warning: --osx-hfs only works on MacOS X ... ignoring\n");#endif /* USE_LIBSCHILY */#endif /* IS_MACOS_X */ break; case OPTION_CREATE_DT: create_dt = 0; break; case OPTION_HFS_HIDE: hfs_add_match(optarg); break; case OPTION_HFS_LIST: hfs_add_list(optarg); break; case OPTION_HFS_INPUT_CHARSET: use_mac_name = 1; hfs_icharset = optarg; break; case OPTION_HFS_OUTPUT_CHARSET: hfs_ocharset = optarg; break; case OPTION_HFS_UNLOCK: hfs_lock = 0; break; case OPTION_HFS_BLESS: hfs_bless = optarg; break; case OPTION_HFS_PARMS: hfs_parms = strdup(optarg); break;#ifdef PREP_BOOT case OPTION_PREP_BOOT: use_prep_boot++; if (use_prep_boot > 4) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Maximum of 4 PReP boot images are allowed\n");#else fprintf(stderr, "Maximum of 4 PReP boot images are allowed\n");#endif exit(1); } /* pathname of the boot image on cd */ prep_boot_image[use_prep_boot - 1] = optarg; if (prep_boot_image[use_prep_boot - 1] == NULL) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Required PReP boot image pathname missing\n");#else fprintf(stderr, "Required PReP boot image pathname missing\n");#endif exit(1); } break;#endif /* PREP_BOOT */#endif /* APPLE_HYB */ default: susage(1); } /* * "--" was found, the next argument is a pathspec */ if (argc != optind) have_cmd_line_pathspec = 1;parse_input_files: path_ind = optind; /* * XXX This is a hack until we have a decent separate name handling * XXX for UDF filenames. */ if (dvd_video && use_Joliet) { use_Joliet = 0; error("Warning: Disabling Joliet support for DVD-Video.\n"); } if (use_udf && !use_Joliet) jlen = 255; if (warn_violate) error("Warning: creating filesystem that does not conform to ISO-9660.\n"); if (iso9660_namelen > LEN_ISONAME) error("Warning: ISO-9660 filenames longer than %d may cause buffer overflows in the OS.\n", LEN_ISONAME); if (use_Joliet && !use_RockRidge) { error("Warning: creating filesystem with (nonstandard) Joliet extensions\n"); error(" but without (standard) Rock Ridge extensions.\n"); error(" It is highly recommended to add Rock Ridge\n"); } if (transparent_compression) { error("Warning: using transparent compression. This is a nonstandard Rock Ridge\n"); error(" extension. The resulting filesystem can only be transparently\n"); error(" read on Linux. On other operating systems you need to call\n"); error(" mkzftree by hand to decompress the files.\n"); } if (transparent_compression && !use_RockRidge) { error("Warning: transparent decompression is a Linux Rock Ridge extension, but\n"); error(" creating filesystem without Rock Ridge attributes; files\n"); error(" will not be transparently decompressed.\n"); } init_nls(); /* Initialize UNICODE tables */ /* initialize code tables from a file - if they exists */ init_nls_file(icharset); init_nls_file(ocharset);#ifdef APPLE_HYB init_nls_file(hfs_icharset); init_nls_file(hfs_ocharset);#endif /* APPLE_HYB */ if (icharset == NULL) {#if (defined(__CYGWIN32__) || defined(__CYGWIN__)) && !defined(IS_CYGWIN_1) in_nls = load_nls("cp437");#else in_nls = load_nls("iso8859-1");#endif } else { if (strcmp(icharset, "default") == 0) in_nls = load_nls_default(); else in_nls = load_nls(icharset); } /* * set the output charset to the same as the input or the given output * charset */ if (ocharset == NULL) { out_nls = in_nls; } else { if (strcmp(ocharset, "default") == 0) out_nls = load_nls_default(); else out_nls = load_nls(ocharset); } if (in_nls == NULL || out_nls == NULL) { /* Unknown charset specified */ fprintf(stderr, "Unknown charset\nKnown charsets are:\n"); list_nls(); /* List all known charset names */ exit(1); }#ifdef APPLE_HYB if (hfs_icharset == NULL || strcmp(hfs_icharset, "mac-roman")) { hfs_inls = load_nls("cp10000"); } else { if (strcmp(hfs_icharset, "default") == 0) hfs_inls = load_nls_default(); else hfs_inls = load_nls(hfs_icharset); } if (hfs_ocharset == NULL) { hfs_onls = hfs_inls; } else { if (strcmp(hfs_ocharset, "default") == 0) hfs_onls = load_nls_default(); else if (strcmp(hfs_ocharset, "mac-roman") == 0) hfs_onls = load_nls("cp10000"); else hfs_onls = load_nls(hfs_ocharset); } if (hfs_inls == NULL || hfs_onls == NULL) { fprintf(stderr, "Unknown HFS charset\nKnown charsets are:\n"); list_nls(); exit(1); }#endif /* APPLE_HYB */ if (merge_image != NULL) { if (open_merge_image(merge_image) < 0) { /* Complain and die. */#ifdef USE_LIBSCHILY comerr("Unable to open previous session image %s\n", merge_image);#else fprintf(stderr, "Unable to open previous session image %s\n", merge_image); exit(1);#endif } } /* We don't need root privilleges anymore. */#ifdef HAVE_SETREUID if (setreuid(-1, getuid()) < 0)#else#ifdef HAVE_SETEUID if (seteuid(getuid()) < 0)#else if (setuid(getuid()) < 0)#endif#endif#ifdef USE_LIBSCHILY comerr("Panic cannot set back effective uid.\n");#else { perror("Panic cannot set back effective uid."); exit(1); }#endif#ifdef no_more_needed#ifdef __NetBSD__ { int resource; struct rlimit rlp; if (getrlimit(RLIMIT_DATA, &rlp) == -1) perror("Warning: getrlimit"); else { rlp.rlim_cur = 33554432; if (setrlimit(RLIMIT_DATA, &rlp) == -1) perror("Warning: setrlimit"); } }#endif#endif /* no_more_needed */#ifdef HAVE_SBRK mem_start = (unsigned long) sbrk(0);#endif /* * if the -hide-joliet option has been given, set the Joliet option */ if (!use_Joliet && j_ishidden()) use_Joliet++;#ifdef APPLE_HYB if (apple_hyb && apple_ext) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Can't have both -apple and -hfs options");#else fprintf(stderr, "Can't have both -apple and -hfs options"); exit(1);#endif } /* * if -probe, -macname, any hfs selection and/or mapping file is given, * but no HFS option, then select apple_hyb */ if (!apple_hyb && !apple_ext) { if (*afpfile || probe || use_mac_name || hfs_select || hfs_boot_file || magic_file || hfs_ishidden() || gen_pt || autoname || afe_size || icon_pos || hfs_ct || hfs_icharset || hfs_ocharset) { apple_hyb = 1; } } if (apple_ext && hfs_boot_file) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Can't have -hfs-boot-file with -apple\n");#else fprintf(stderr, "Can't have -hfs-boot-file with -apple\n"); exit(1);#endif } if (apple_ext && autoname) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Can't have -auto with -apple\n");#else fprintf(stderr, "Can't have -auto with -apple\n"); exit(1);#endif } if (apple_hyb && use_sparcboot) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Can't have -hfs with -sparc-boot\n");#else fprintf(stderr, "Can't have -hfs with -sparc-boot\n"); exit(1);#endif } if (apple_hyb && use_genboot) {#ifdef USE_LIBSCHILY comerrno(EX_BAD, "Can't have -hfs with -generic-boot\n");#else fprintf(stderr, "Can't have -hfs with -generic-boot\n"); exit(1);#endif }#ifdef PREP_BOOT if (apple_ext && use_prep_boot) {#ifdef USE_LIBSCHILY com
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -