⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mkisofs.c

📁 创建一个符合iso-9660标准的iso文件系统
💻 C
📖 第 1 页 / 共 5 页
字号:
#else			transparent_compression++;#endif			break;		case 'x':		case 'm':			/*			 * Somehow two options to do basically the same thing			 * got added somewhere along the way.  The 'match'			 * code supports limited globbing, so this is the one			 * that got selected. Unfortunately the 'x' switch is			 * probably more intuitive.			 */			add_match(optarg);			break;		case OPTION_X_LIST:			add_list(optarg);			break;		case OPTION_I_HIDE:			i_add_match(optarg);			break;		case OPTION_I_LIST:			i_add_list(optarg);			break;		case OPTION_H_HIDE:			h_add_match(optarg);			break;		case OPTION_H_LIST:			h_add_list(optarg);			break;		case OPTION_J_HIDE:			j_add_match(optarg);			break;		case OPTION_J_LIST:			j_add_list(optarg);			break;		case OPTION_HIDE_TRANS_TBL:			jhide_trans_tbl++;			break;		case OPTION_HIDE_RR_MOVED:			hide_rr_moved++;			break;		case OPTION_HELP:			usage(0);			break;		case OPTION_PVERSION:			printf("%s (%s-%s-%s)\n",				version_string,				HOST_CPU, HOST_VENDOR, HOST_OS);			exit(0);			break;		case OPTION_NOSPLIT_SL_COMPONENT:			split_SL_component = 0;			break;		case OPTION_NOSPLIT_SL_FIELD:			split_SL_field = 0;			break;		case OPTION_HARD_DISK_BOOT:			use_eltorito++;			hard_disk_boot++;			get_boot_entry();			current_boot_entry->hard_disk_boot = 1;			break;		case OPTION_NO_EMUL_BOOT:			use_eltorito++;			no_emul_boot++;			get_boot_entry();			current_boot_entry->no_emul_boot = 1;			break;		case OPTION_NO_BOOT:			use_eltorito++;			not_bootable++;			get_boot_entry();			current_boot_entry->not_bootable = 1;			break;		case OPTION_BOOT_LOAD_ADDR:			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':			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			comerrno(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_CREATE_DT:			create_dt = 0;			break;		case OPTION_HFS_HIDE:			hfs_add_match(optarg);			break;		case OPTION_HFS_LIST:			hfs_add_list(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:			usage(1);		}parse_input_files:	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);	init_nls();	/* Initialize UNICODE tables */	if (jcharset == NULL) {#if	defined(__CYGWIN32__) || defined(__CYGWIN__)		nls = load_nls("cp437");#else		nls = load_nls("iso8859-1");#endif	} else {		if (strcmp(jcharset, "default") == 0)			nls = load_nls_default();		else			nls = load_nls(jcharset);	}	if (nls == NULL) {	/* Unknown charset specified */		fprintf(stderr, "Unknown charset: %s\nKnown charsets are:\n",							jcharset);		list_nls();	/* List all known charset names */		exit(1);	}	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 efective uid.\n");#else	{		perror("Panic cannot set back efective 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) {			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		comerrno(EX_BAD, "Can't have -prep-boot with -apple\n");#else		fprintf(stderr, "Can't have -prep-boot with -apple\n");		exit(1);#endif	}#endif	/* PREP_BOOT */	if (apple_hyb || apple_ext)		apple_both = 1;	if (probe)		/* we need to search for all types of Apple/Unix files */		hfs_select = ~0;	if (apple_both && verbose && !(hfs_select || *afpfile || magic_file)) {#ifdef	USE_LIBSCHILY		errmsgno(EX_BAD, 		"Warning: no Apple/Unix files will be decoded/mapped\n");#else		fprintf(stderr,		"Warning: no Apple/Unix files will be decoded/mapped\n");#endif	}	if (apple_both && verbose && !afe_size &&					(hfs_select & (DO_FEU | DO_FEL))) {#ifdef	USE_LIBSCHILY		errmsgno(EX_BAD,		"Warning: assuming PC Exchange cluster size of 512 bytes\n");#else		fprintf(stderr,		"Warning: assuming PC Exchange cluster size of 512 bytes\n");#endif		afe_size = 512;	}	if (apple_both) {		/* set up the TYPE/CREATOR mappings */		hfs_init(afpfile, 0, hfs_select);	}	if (apple_ext && !use_RockRidge) {		/* use RockRidge to set the SystemUse field ... */		use_RockRidge++;		rationalize++;	}#endif	/* APPLE_HYB */	if (verbose > 1) {		fprintf(stderr, "%s (%s-%s-%s)\n",				version_string,				HOST_CPU, HOST_VENDOR, HOST_OS);	}	if (cdrecord_data == NULL && merge_image != NULL) {#ifdef	USE_LIBSCHILY		comerrno(EX_BAD,		"Multisession usage bug: Must specify -C if -M is used.\n");#else		fprintf(stderr,		"Multisession usage bug: Must specify -C if -M is used.\n");		exit(1);#endif	}	if (cdrecord_data != NULL && merge_image == NULL) {#ifdef	USE_LIBSCHILY		errmsgno(EX_BAD,		"Warning: -C specified without -M: old session data will not be merged.\n");#else		fprintf(stderr,		"Warning: -C specified without -M: old session data will not be merged.\n");#endif	}#ifdef APPLE_HYB

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -