Changeset 67605 in vbox
- Timestamp:
- Jun 26, 2017 12:00:45 PM (7 years ago)
- Location:
- trunk/src/VBox/Runtime/common/fs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/fs/isomaker.cpp
r67595 r67605 1559 1559 size_t offNext = cchComponent; 1560 1560 while (RTPATH_IS_SLASH(ch)) 1561 ch = pszPath[ offNext++];1561 ch = pszPath[++offNext]; 1562 1562 1563 1563 /* … … 4182 4182 * Populate the structure. 4183 4183 */ 4184 pCurFile->pBootInfoTable->offPrimaryVolDesc = RT_H2LE_U32(16 * RTFSISOMAKER_SECTOR_SIZE);4184 pCurFile->pBootInfoTable->offPrimaryVolDesc = RT_H2LE_U32(16); 4185 4185 pCurFile->pBootInfoTable->offBootFile = RT_H2LE_U32((uint32_t)(pCurFile->offData / RTFSISOMAKER_SECTOR_SIZE)); 4186 4186 pCurFile->pBootInfoTable->cbBootFile = RT_H2LE_U32((uint32_t)pCurFile->cbData); -
trunk/src/VBox/Runtime/common/fs/isomakercmd.cpp
r67595 r67605 419 419 420 420 { "--eltorito-new-entry", RTFSISOMAKERCMD_OPT_ELTORITO_NEW_ENTRY, RTGETOPT_REQ_NOTHING }, 421 { "--eltorito-add-image", RTFSISOMAKERCMD_OPT_ELTORITO_ADD_IMAGE, RTGETOPT_REQ_ NOTHING },421 { "--eltorito-add-image", RTFSISOMAKERCMD_OPT_ELTORITO_ADD_IMAGE, RTGETOPT_REQ_STRING }, 422 422 { "--eltorito-floppy-12", RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_12, RTGETOPT_REQ_NOTHING }, 423 423 { "--eltorito-floppy-144", RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_144, RTGETOPT_REQ_NOTHING }, … … 439 439 DD("-boot-load-seg", RTFSISOMAKERCMD_OPT_ELTORITO_LOAD_SEG, RTGETOPT_REQ_UINT16 ), 440 440 DD("-boot-load-size", RTFSISOMAKERCMD_OPT_ELTORITO_LOAD_SIZE, RTGETOPT_REQ_UINT16 ), 441 DD("-boot-info-table", RTFSISOMAKERCMD_OPT_ELTORITO_INFO_TABLE, RTGETOPT_REQ_ STRING),441 DD("-boot-info-table", RTFSISOMAKERCMD_OPT_ELTORITO_INFO_TABLE, RTGETOPT_REQ_NOTHING ), 442 442 { "--boot-catalog", 'c', RTGETOPT_REQ_STRING }, 443 443 … … 596 596 #undef DD 597 597 }; 598 599 600 /********************************************************************************************************************************* 601 * Internal Functions * 602 *********************************************************************************************************************************/ 603 static int rtFsIsoMakerCmdParse(PRTFSISOMAKERCMDOPTS pOpts, unsigned cArgs, char **papszArgs, unsigned cDepth); 598 604 599 605 … … 1942 1948 1943 1949 /** 1950 * Loads an argument file (e.g. a .iso-file) and parses it. 1951 * 1952 * @returns IPRT status code. 1953 * @param pOpts The ISO maker command instance. 1954 * @param pszFileSpec The file to parse. 1955 * @param cDepth The current nesting depth. 1956 */ 1957 static int rtFsIsoMakerCmdParseArgumentFile(PRTFSISOMAKERCMDOPTS pOpts, const char *pszFileSpec, unsigned cDepth) 1958 { 1959 if (cDepth > 2) 1960 return rtFsIsoMakerCmdErrorRc(pOpts, VERR_INVALID_PARAMETER, "Too many nested argument files!"); 1961 1962 /* 1963 * Read the file into memory. 1964 */ 1965 RTERRINFOSTATIC ErrInfo; 1966 uint32_t offError; 1967 RTVFSFILE hVfsFile; 1968 int rc = RTVfsChainOpenFile(pszFileSpec, RTFILE_O_READ | RTFILE_O_OPEN | RTFILE_O_DENY_WRITE, &hVfsFile, 1969 &offError, RTErrInfoInitStatic(&ErrInfo)); 1970 if (RT_FAILURE(rc)) 1971 return rtFsIsoMakerCmdChainError(pOpts, "RTVfsChainOpenFile", pszFileSpec, rc, offError, &ErrInfo.Core); 1972 1973 uint64_t cbFile = 0; 1974 rc = RTVfsFileGetSize(hVfsFile, &cbFile); 1975 if (RT_SUCCESS(rc)) 1976 { 1977 if (cbFile < _2M) 1978 { 1979 char *pszContent = (char *)RTMemTmpAllocZ((size_t)cbFile + 1); 1980 if (pszContent) 1981 { 1982 rc = RTVfsFileRead(hVfsFile, pszContent, (size_t)cbFile, NULL); 1983 if (RT_SUCCESS(rc)) 1984 { 1985 /* 1986 * Check that it's valid UTF-8 and turn it into an argument vector. 1987 */ 1988 rc = RTStrValidateEncodingEx(pszContent, (size_t)cbFile + 1, 1989 RTSTR_VALIDATE_ENCODING_EXACT_LENGTH | RTSTR_VALIDATE_ENCODING_ZERO_TERMINATED); 1990 if (RT_SUCCESS(rc)) 1991 { 1992 uint32_t fGetOpt = strstr(pszContent, "--iprt-iso-maker-file-marker-ms") == NULL 1993 ? RTGETOPTARGV_CNV_QUOTE_BOURNE_SH : RTGETOPTARGV_CNV_QUOTE_MS_CRT; 1994 fGetOpt |= RTGETOPTARGV_CNV_MODIFY_INPUT; 1995 char **papszArgs; 1996 int cArgs; 1997 rc = RTGetOptArgvFromString(&papszArgs, &cArgs, pszContent, fGetOpt, NULL); 1998 if (RT_SUCCESS(rc)) 1999 { 2000 /* 2001 * Parse them. 2002 */ 2003 rc = rtFsIsoMakerCmdParse(pOpts, cArgs, papszArgs, cDepth + 1); 2004 2005 RTGetOptArgvFreeEx(papszArgs, fGetOpt); 2006 } 2007 else 2008 rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "%s: RTGetOptArgvFromString failed: %Rrc", pszFileSpec, rc); 2009 2010 } 2011 else 2012 rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "%s: invalid encoding", pszFileSpec); 2013 } 2014 else 2015 rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "%s: error to read it into memory: %Rrc", pszFileSpec, rc); 2016 RTMemTmpFree(pszContent); 2017 } 2018 else 2019 rc = rtFsIsoMakerCmdErrorRc(pOpts, VERR_NO_TMP_MEMORY, "%s: failed to allocte %zu bytes for reading", 2020 pszFileSpec, (size_t)cbFile + 1); 2021 } 2022 else 2023 rc = rtFsIsoMakerCmdErrorRc(pOpts, VERR_FILE_TOO_BIG, "%s: file is too big: %'RU64 bytes, max 2MB", pszFileSpec, cbFile); 2024 } 2025 else 2026 rtFsIsoMakerCmdErrorRc(pOpts, rc, "%s: RTVfsFileGetSize failed: %Rrc", pszFileSpec, rc); 2027 RTVfsFileRelease(hVfsFile); 2028 return rc; 2029 } 2030 2031 2032 /** 2033 * Parses the given command line options. 2034 * 2035 * @returns IPRT status code. 2036 * @param pOpts The ISO maker command instance. 2037 * @param cArgs Number of arguments in papszArgs. 2038 * @param papszArgs The argument vector to parse. 2039 */ 2040 static int rtFsIsoMakerCmdParse(PRTFSISOMAKERCMDOPTS pOpts, unsigned cArgs, char **papszArgs, unsigned cDepth) 2041 { 2042 /* Setup option parsing. */ 2043 RTGETOPTSTATE GetState; 2044 int rc = RTGetOptInit(&GetState, cArgs, papszArgs, g_aRtFsIsoMakerOptions, RT_ELEMENTS(g_aRtFsIsoMakerOptions), 2045 cDepth == 0 ? 1 : 0 /*iFirst*/, 0 /*fFlags*/); 2046 if (RT_FAILURE(rc)) 2047 return rtFsIsoMakerCmdErrorRc(pOpts, rc, "RTGetOpt failed: %Rrc", rc); 2048 2049 /* 2050 * Parse parameters. Parameters are position dependent. 2051 */ 2052 RTGETOPTUNION ValueUnion; 2053 while ( RT_SUCCESS(rc) 2054 && (rc = RTGetOpt(&GetState, &ValueUnion)) != 0) 2055 { 2056 switch (rc) 2057 { 2058 /* 2059 * Files and directories. 2060 */ 2061 case VINF_GETOPT_NOT_OPTION: 2062 if ( *ValueUnion.psz != '@' 2063 || strchr(ValueUnion.psz, '=')) 2064 rc = rtFsIsoMakerCmdAddSomething(pOpts, ValueUnion.psz); 2065 else 2066 rc = rtFsIsoMakerCmdParseArgumentFile(pOpts, ValueUnion.psz + 1, cDepth); 2067 break; 2068 2069 /* 2070 * Options specific to our ISO maker. 2071 */ 2072 case RTFSISOMAKERCMD_OPT_NAME_SETUP: 2073 rc = rtFsIsoMakerCmdOptNameSetup(pOpts, ValueUnion.psz); 2074 break; 2075 2076 case RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER: 2077 /* ignored */ 2078 break; 2079 2080 case RTFSISOMAKERCMD_OPT_IMPORT_ISO: 2081 rc = rtFsIsoMakerCmdOptImportIso(pOpts, ValueUnion.psz); 2082 break; 2083 2084 /* 2085 * Joliet related options. 2086 */ 2087 case RTFSISOMAKERCMD_OPT_NO_JOLIET: 2088 rc = RTFsIsoMakerSetJolietUcs2Level(pOpts->hIsoMaker, 0); 2089 if (RT_FAILURE(rc)) 2090 rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to disable joliet: %Rrc", rc); 2091 break; 2092 2093 2094 /* 2095 * Boot related options. 2096 */ 2097 case 'G': /* --generic-boot <file> */ 2098 rc = rtFsIsoMakerCmdOptGenericBoot(pOpts, ValueUnion.psz); 2099 break; 2100 2101 case RTFSISOMAKERCMD_OPT_ELTORITO_ADD_IMAGE: 2102 rc = rtFsIsoMakerCmdOptEltoritoAddImage(pOpts, ValueUnion.psz); 2103 break; 2104 2105 case 'b': /* --eltorito-boot <boot.img> */ 2106 rc = rtFsIsoMakerCmdOptEltoritoBoot(pOpts, ValueUnion.psz); 2107 break; 2108 2109 case RTFSISOMAKERCMD_OPT_ELTORITO_NEW_ENTRY: 2110 rc = rtFsIsoMakerCmdOptEltoritoNewEntry(pOpts); 2111 break; 2112 2113 case RTFSISOMAKERCMD_OPT_ELTORITO_PLATFORM_ID: 2114 rc = rtFsIsoMakerCmdOptEltoritoPlatformId(pOpts, ValueUnion.psz); 2115 break; 2116 2117 case RTFSISOMAKERCMD_OPT_ELTORITO_NO_BOOT: 2118 rc = rtFsIsoMakerCmdOptEltoritoSetNotBootable(pOpts); 2119 break; 2120 2121 case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_12: 2122 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_1_2_MB); 2123 break; 2124 case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_144: 2125 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_1_44_MB); 2126 break; 2127 case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_288: 2128 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_2_88_MB); 2129 break; 2130 case RTFSISOMAKERCMD_OPT_ELTORITO_HARD_DISK_BOOT: 2131 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_HARD_DISK); 2132 break; 2133 case RTFSISOMAKERCMD_OPT_ELTORITO_NO_EMULATION_BOOT: 2134 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_NO_EMULATION); 2135 break; 2136 2137 case RTFSISOMAKERCMD_OPT_ELTORITO_LOAD_SEG: 2138 rc = rtFsIsoMakerCmdOptEltoritoSetLoadSegment(pOpts, ValueUnion.u16); 2139 break; 2140 2141 case RTFSISOMAKERCMD_OPT_ELTORITO_LOAD_SIZE: 2142 rc = rtFsIsoMakerCmdOptEltoritoSetLoadSectorCount(pOpts, ValueUnion.u16); 2143 break; 2144 2145 case RTFSISOMAKERCMD_OPT_ELTORITO_INFO_TABLE: 2146 rc = rtFsIsoMakerCmdOptEltoritoEnableBootInfoTablePatching(pOpts); 2147 break; 2148 2149 case 'c': /* --boot-catalog <cd-path> */ 2150 rc = rtFsIsoMakerCmdOptEltoritoSetBootCatalogPath(pOpts, ValueUnion.psz); 2151 break; 2152 2153 /* 2154 * Image/namespace property related options. 2155 */ 2156 case RTFSISOMAKERCMD_OPT_ABSTRACT_FILE_ID: 2157 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_ABSTRACT_FILE_ID); 2158 break; 2159 2160 case 'A': /* --application-id */ 2161 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_APPLICATION_ID); 2162 break; 2163 2164 case RTFSISOMAKERCMD_OPT_BIBLIOGRAPHIC_FILE_ID: 2165 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_BIBLIOGRAPHIC_FILE_ID); 2166 break; 2167 2168 case RTFSISOMAKERCMD_OPT_COPYRIGHT_FILE_ID: 2169 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_COPYRIGHT_FILE_ID); 2170 break; 2171 2172 case 'P': /* -publisher */ 2173 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_PUBLISHER_ID); 2174 break; 2175 2176 case 'p': /* --preparer*/ 2177 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_DATA_PREPARER_ID); 2178 break; 2179 2180 case RTFSISOMAKERCMD_OPT_SYSTEM_ID: 2181 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_SYSTEM_ID); 2182 break; 2183 2184 case RTFSISOMAKERCMD_OPT_VOLUME_ID: /* (should've been '-V') */ 2185 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_VOLUME_ID); 2186 break; 2187 2188 case RTFSISOMAKERCMD_OPT_VOLUME_SET_ID: 2189 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_VOLUME_SET_ID); 2190 break; 2191 2192 /* 2193 * Options compatible with other ISO makers. 2194 */ 2195 case 'o': 2196 if (pOpts->fVirtualImageMaker) 2197 return rtFsIsoMakerCmdSyntaxError(pOpts, "The --output option is not allowed"); 2198 if (pOpts->pszOutFile) 2199 return rtFsIsoMakerCmdSyntaxError(pOpts, "The --output option is specified more than once"); 2200 pOpts->pszOutFile = ValueUnion.psz; 2201 break; 2202 2203 /* 2204 * Standard bits. 2205 */ 2206 case 'h': 2207 rtFsIsoMakerCmdUsage(pOpts, papszArgs[0]); 2208 return pOpts->fVirtualImageMaker ? VERR_NOT_FOUND : VINF_SUCCESS; 2209 2210 case 'V': 2211 rtFsIsoMakerPrintf(pOpts, "%sr%d\n", RTBldCfgVersion(), RTBldCfgRevision()); 2212 return pOpts->fVirtualImageMaker ? VERR_NOT_FOUND : VINF_SUCCESS; 2213 2214 default: 2215 if (rc > 0 && RT_C_IS_GRAPH(rc)) 2216 rc = rtFsIsoMakerCmdErrorRc(pOpts, VERR_GETOPT_UNKNOWN_OPTION, "Unhandled option: -%c", rc); 2217 else if (rc > 0) 2218 rc = rtFsIsoMakerCmdErrorRc(pOpts, VERR_GETOPT_UNKNOWN_OPTION, "Unhandled option: %i (%#x)", rc, rc); 2219 else if (rc == VERR_GETOPT_UNKNOWN_OPTION) 2220 rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "Unknown option: '%s'", ValueUnion.psz); 2221 else if (ValueUnion.pDef) 2222 rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "%s: %Rrs", ValueUnion.pDef->pszLong, rc); 2223 else 2224 rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "%Rrs", rc); 2225 return rc; 2226 } 2227 if (RT_FAILURE(rc)) 2228 return rc; 2229 } 2230 return VINF_SUCCESS; 2231 } 2232 2233 2234 /** 1944 2235 * Extended ISO maker command. 1945 2236 * … … 1973 2264 Opts.aBootCatEntries[i].u.Section.idxImageObj = UINT32_MAX; 1974 2265 1975 /* Setup option parsing. */1976 RTGETOPTSTATE GetState;1977 int rc = RTGetOptInit(&GetState, cArgs, papszArgs, g_aRtFsIsoMakerOptions, RT_ELEMENTS(g_aRtFsIsoMakerOptions),1978 1 /*iFirst*/, 0 /*fFlags*/);1979 if (RT_FAILURE(rc))1980 return rtFsIsoMakerCmdErrorRc(&Opts, rc, "RTGetOpt failed: %Rrc", rc);1981 1982 2266 /* Create the ISO creator instance. */ 1983 rc = RTFsIsoMakerCreate(&Opts.hIsoMaker);2267 int rc = RTFsIsoMakerCreate(&Opts.hIsoMaker); 1984 2268 if (RT_FAILURE(rc)) 1985 2269 return rtFsIsoMakerCmdErrorRc(&Opts, rc, "RTFsIsoMakerCreate failed: %Rrc", rc); 1986 2270 1987 2271 /* 1988 * Parse parameters. Parameters are position dependent.2272 * Parse the command line and check for mandatory options. 1989 2273 */ 1990 RTGETOPTUNION ValueUnion; 1991 while ( RT_SUCCESS(rc) 1992 && (rc = RTGetOpt(&GetState, &ValueUnion)) != 0) 1993 { 1994 switch (rc) 1995 { 1996 /* 1997 * Files and directories. 1998 */ 1999 case VINF_GETOPT_NOT_OPTION: 2000 rc = rtFsIsoMakerCmdAddSomething(&Opts, ValueUnion.psz); 2001 break; 2002 2003 /* 2004 * Options specific to our ISO maker. 2005 */ 2006 case RTFSISOMAKERCMD_OPT_NAME_SETUP: 2007 rc = rtFsIsoMakerCmdOptNameSetup(&Opts, ValueUnion.psz); 2008 break; 2009 2010 case RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER: 2011 /* ignored */ 2012 break; 2013 2014 case RTFSISOMAKERCMD_OPT_IMPORT_ISO: 2015 rc = rtFsIsoMakerCmdOptImportIso(&Opts, ValueUnion.psz); 2016 break; 2017 2018 /* 2019 * Joliet related options. 2020 */ 2021 case RTFSISOMAKERCMD_OPT_NO_JOLIET: 2022 rc = RTFsIsoMakerSetJolietUcs2Level(Opts.hIsoMaker, 0); 2023 if (RT_FAILURE(rc)) 2024 rc = rtFsIsoMakerCmdErrorRc(&Opts, rc, "Failed to disable joliet: %Rrc", rc); 2025 break; 2026 2027 2028 /* 2029 * Boot related options. 2030 */ 2031 case 'G': /* --generic-boot <file> */ 2032 rc = rtFsIsoMakerCmdOptGenericBoot(&Opts, ValueUnion.psz); 2033 break; 2034 2035 case RTFSISOMAKERCMD_OPT_ELTORITO_ADD_IMAGE: 2036 rc = rtFsIsoMakerCmdOptEltoritoAddImage(&Opts, ValueUnion.psz); 2037 break; 2038 2039 case 'b': /* --eltorito-boot <boot.img> */ 2040 rc = rtFsIsoMakerCmdOptEltoritoBoot(&Opts, ValueUnion.psz); 2041 break; 2042 2043 case RTFSISOMAKERCMD_OPT_ELTORITO_NEW_ENTRY: 2044 rc = rtFsIsoMakerCmdOptEltoritoNewEntry(&Opts); 2045 break; 2046 2047 case RTFSISOMAKERCMD_OPT_ELTORITO_PLATFORM_ID: 2048 rc = rtFsIsoMakerCmdOptEltoritoPlatformId(&Opts, ValueUnion.psz); 2049 break; 2050 2051 case RTFSISOMAKERCMD_OPT_ELTORITO_NO_BOOT: 2052 rc = rtFsIsoMakerCmdOptEltoritoSetNotBootable(&Opts); 2053 break; 2054 2055 case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_12: 2056 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(&Opts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_1_2_MB); 2057 break; 2058 case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_144: 2059 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(&Opts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_1_44_MB); 2060 break; 2061 case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_288: 2062 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(&Opts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_2_88_MB); 2063 break; 2064 case RTFSISOMAKERCMD_OPT_ELTORITO_HARD_DISK_BOOT: 2065 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(&Opts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_HARD_DISK); 2066 break; 2067 case RTFSISOMAKERCMD_OPT_ELTORITO_NO_EMULATION_BOOT: 2068 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(&Opts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_NO_EMULATION); 2069 break; 2070 2071 case RTFSISOMAKERCMD_OPT_ELTORITO_LOAD_SEG: 2072 rc = rtFsIsoMakerCmdOptEltoritoSetLoadSegment(&Opts, ValueUnion.u16); 2073 break; 2074 2075 case RTFSISOMAKERCMD_OPT_ELTORITO_LOAD_SIZE: 2076 rc = rtFsIsoMakerCmdOptEltoritoSetLoadSectorCount(&Opts, ValueUnion.u16); 2077 break; 2078 2079 case RTFSISOMAKERCMD_OPT_ELTORITO_INFO_TABLE: 2080 rc = rtFsIsoMakerCmdOptEltoritoEnableBootInfoTablePatching(&Opts); 2081 break; 2082 2083 case 'c': /* --boot-catalog <cd-path> */ 2084 rc = rtFsIsoMakerCmdOptEltoritoSetBootCatalogPath(&Opts, ValueUnion.psz); 2085 break; 2086 2087 /* 2088 * Image/namespace property related options. 2089 */ 2090 case RTFSISOMAKERCMD_OPT_ABSTRACT_FILE_ID: 2091 rc = rtFsIsoMakerCmdOptSetStringProp(&Opts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_ABSTRACT_FILE_ID); 2092 break; 2093 2094 case 'A': /* --application-id */ 2095 rc = rtFsIsoMakerCmdOptSetStringProp(&Opts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_APPLICATION_ID); 2096 break; 2097 2098 case RTFSISOMAKERCMD_OPT_BIBLIOGRAPHIC_FILE_ID: 2099 rc = rtFsIsoMakerCmdOptSetStringProp(&Opts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_BIBLIOGRAPHIC_FILE_ID); 2100 break; 2101 2102 case RTFSISOMAKERCMD_OPT_COPYRIGHT_FILE_ID: 2103 rc = rtFsIsoMakerCmdOptSetStringProp(&Opts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_COPYRIGHT_FILE_ID); 2104 break; 2105 2106 case 'P': /* -publisher */ 2107 rc = rtFsIsoMakerCmdOptSetStringProp(&Opts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_PUBLISHER_ID); 2108 break; 2109 2110 case 'p': /* --preparer*/ 2111 rc = rtFsIsoMakerCmdOptSetStringProp(&Opts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_DATA_PREPARER_ID); 2112 break; 2113 2114 case RTFSISOMAKERCMD_OPT_SYSTEM_ID: 2115 rc = rtFsIsoMakerCmdOptSetStringProp(&Opts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_SYSTEM_ID); 2116 break; 2117 2118 case RTFSISOMAKERCMD_OPT_VOLUME_ID: /* (should've been '-V') */ 2119 rc = rtFsIsoMakerCmdOptSetStringProp(&Opts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_VOLUME_ID); 2120 break; 2121 2122 case RTFSISOMAKERCMD_OPT_VOLUME_SET_ID: 2123 rc = rtFsIsoMakerCmdOptSetStringProp(&Opts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_VOLUME_SET_ID); 2124 break; 2125 2126 /* 2127 * Options compatible with other ISO makers. 2128 */ 2129 case 'o': 2130 if (Opts.fVirtualImageMaker) 2131 return rtFsIsoMakerCmdSyntaxError(&Opts, "The --output option is not allowed"); 2132 if (Opts.pszOutFile) 2133 return rtFsIsoMakerCmdSyntaxError(&Opts, "The --output option is specified more than once"); 2134 Opts.pszOutFile = ValueUnion.psz; 2135 break; 2136 2137 /* 2138 * Standard bits. 2139 */ 2140 case 'h': 2141 rtFsIsoMakerCmdUsage(&Opts, papszArgs[0]); 2142 return rtFsIsoMakerCmdDeleteState(&Opts, Opts.fVirtualImageMaker ? VERR_NOT_FOUND : VINF_SUCCESS); 2143 2144 case 'V': 2145 rtFsIsoMakerPrintf(&Opts, "%sr%d\n", RTBldCfgVersion(), RTBldCfgRevision()); 2146 return rtFsIsoMakerCmdDeleteState(&Opts, Opts.fVirtualImageMaker ? VERR_NOT_FOUND : VINF_SUCCESS); 2147 2148 default: 2149 if (rc > 0 && RT_C_IS_GRAPH(rc)) 2150 rc = rtFsIsoMakerCmdErrorRc(&Opts, VERR_GETOPT_UNKNOWN_OPTION, "Unhandled option: -%c", rc); 2151 else if (rc > 0) 2152 rc = rtFsIsoMakerCmdErrorRc(&Opts, VERR_GETOPT_UNKNOWN_OPTION, "Unhandled option: %i (%#x)", rc, rc); 2153 else if (rc == VERR_GETOPT_UNKNOWN_OPTION) 2154 rc = rtFsIsoMakerCmdErrorRc(&Opts, rc, "Unknown option: '%s'", ValueUnion.psz); 2155 else if (ValueUnion.pDef) 2156 rc = rtFsIsoMakerCmdErrorRc(&Opts, rc, "%s: %Rrs", ValueUnion.pDef->pszLong, rc); 2157 else 2158 rc = rtFsIsoMakerCmdErrorRc(&Opts, rc, "%Rrs", rc); 2159 return rtFsIsoMakerCmdDeleteState(&Opts, rc); 2160 } 2161 } 2162 2163 /* 2164 * Check for mandatory options. 2165 */ 2274 rc = rtFsIsoMakerCmdParse(&Opts, cArgs, papszArgs, 0); 2166 2275 if (RT_SUCCESS(rc)) 2167 2276 { -
trunk/src/VBox/Runtime/common/fs/isomakerimport.cpp
r67600 r67605 1544 1544 if (RT_SUCCESS(rc)) 1545 1545 { 1546 uint64_t cbImage = 0; 1547 RTFsIsoMakerObjQueryDataSize(pThis->hIsoMaker, idxImageObj, &cbImage); 1548 LogRel(("ISO import: boot catalog #%#x: bMediaType=%#x (%#x) bSystemType=%#x idxImageObj=%#x size=%#RX64\n", 1549 iEntry, bMediaType, pEntry->bBootMediaType, pEntry->bSystemType, idxImageObj, cbImage)); 1550 1546 1551 pThis->pResults->cBootCatEntries += 1 + *pcSkip; 1547 1552 rc = rtFsIsoImportProcessElToritoImage(pThis, idxImageObj, offBootImage);
Note:
See TracChangeset
for help on using the changeset viewer.