Changeset 93118 in vbox for trunk/src/VBox/Runtime/common/fs/isomakercmd.cpp
- Timestamp:
- Jan 4, 2022 1:41:47 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/fs/isomakercmd.cpp
r93115 r93118 100 100 RTFSISOMAKERCMD_OPT_RANDOM_ORDER_VERIFICATION, 101 101 RTFSISOMAKERCMD_OPT_NAME_SETUP, 102 RTFSISOMAKERCMD_OPT_NAME_SETUP_FROM_IMPORT, 102 103 103 104 RTFSISOMAKERCMD_OPT_ROCK_RIDGE, … … 463 464 */ 464 465 { "--name-setup", RTFSISOMAKERCMD_OPT_NAME_SETUP, RTGETOPT_REQ_STRING }, 466 { "--name-setup-from-import", RTFSISOMAKERCMD_OPT_NAME_SETUP_FROM_IMPORT, RTGETOPT_REQ_NOTHING }, 465 467 { "--import-iso", RTFSISOMAKERCMD_OPT_IMPORT_ISO, RTGETOPT_REQ_STRING }, 466 468 { "--push-iso", RTFSISOMAKERCMD_OPT_PUSH_ISO, RTGETOPT_REQ_STRING }, … … 1419 1421 1420 1422 /** 1423 * Handles the --name-setup-from-import option. 1424 * 1425 * @returns IPRT status code. 1426 * @param pOpts The ISO maker command instance. 1427 */ 1428 static int rtFsIsoMakerCmdOptNameSetupFromImport(PRTFSISOMAKERCMDOPTS pOpts) 1429 { 1430 /* 1431 * Figure out what's on the ISO. 1432 */ 1433 uint32_t fNamespaces = RTFsIsoMakerGetPopulatedNamespaces(pOpts->hIsoMaker); 1434 AssertReturn(fNamespaces != UINT32_MAX, VERR_INVALID_HANDLE); 1435 if (fNamespaces != 0) 1436 { 1437 if ( (fNamespaces & RTFSISOMAKER_NAMESPACE_ISO_9660) 1438 && RTFsIsoMakerGetRockRidgeLevel(pOpts->hIsoMaker) > 0) 1439 fNamespaces |= RTFSISOMAKERCMDNAME_PRIMARY_ISO_ROCK_RIDGE; 1440 1441 if ( (fNamespaces & RTFSISOMAKER_NAMESPACE_JOLIET) 1442 && RTFsIsoMakerGetJolietRockRidgeLevel(pOpts->hIsoMaker) > 0) 1443 fNamespaces |= RTFSISOMAKERCMDNAME_JOLIET_ROCK_RIDGE; 1444 1445 /* 1446 * The TRANS.TBL files cannot be disabled at present and the importer 1447 * doesn't check whether they are there or not, so carry them on from 1448 * the previous setup. 1449 */ 1450 uint32_t fOld = 0; 1451 uint32_t i = pOpts->cNameSpecifiers; 1452 while (i-- > 0) 1453 fOld |= pOpts->afNameSpecifiers[0]; 1454 if (fNamespaces & RTFSISOMAKER_NAMESPACE_ISO_9660) 1455 fNamespaces |= fOld & RTFSISOMAKERCMDNAME_PRIMARY_ISO_TRANS_TBL; 1456 if (fNamespaces & RTFSISOMAKER_NAMESPACE_JOLIET) 1457 fNamespaces |= fOld & RTFSISOMAKERCMDNAME_PRIMARY_ISO_TRANS_TBL; 1458 if (fNamespaces & RTFSISOMAKER_NAMESPACE_UDF) 1459 fNamespaces |= fOld & RTFSISOMAKERCMDNAME_UDF_TRANS_TBL; 1460 if (fNamespaces & RTFSISOMAKER_NAMESPACE_HFS) 1461 fNamespaces |= fOld & RTFSISOMAKERCMDNAME_HFS_TRANS_TBL; 1462 1463 /* 1464 * Apply the new configuration. 1465 */ 1466 pOpts->cNameSpecifiers = 1; 1467 pOpts->afNameSpecifiers[0] = fNamespaces; 1468 pOpts->fDstNamespaces = fNamespaces & RTFSISOMAKERCMDNAME_MAJOR_MASK; 1469 1470 char szTmp[128]; 1471 rtFsIsoMakerPrintf(pOpts, "info: --name-setup-from-import determined: --name-setup=%s\n", 1472 rtFsIsoMakerCmdNameSpecifiersToString(fNamespaces, szTmp, sizeof(szTmp))); 1473 return VINF_SUCCESS; 1474 } 1475 return rtFsIsoMakerCmdErrorRc(pOpts, VERR_DRIVE_IS_EMPTY, "--name-setup-from-import used on an empty ISO"); 1476 } 1477 1478 1479 /** 1421 1480 * Checks if we should use the source stack or the regular file system for 1422 1481 * opening a source. … … 3187 3246 break; 3188 3247 3248 case RTFSISOMAKERCMD_OPT_NAME_SETUP_FROM_IMPORT: 3249 rc = rtFsIsoMakerCmdOptNameSetupFromImport(pOpts); 3250 break; 3251 3189 3252 case RTFSISOMAKERCMD_OPT_PUSH_ISO: 3190 3253 rc = rtFsIsoMakerCmdOptPushIso(pOpts, ValueUnion.psz, "--push-iso", 0);
Note:
See TracChangeset
for help on using the changeset viewer.