VirtualBox

Ignore:
Timestamp:
Jan 4, 2022 1:41:47 AM (3 years ago)
Author:
vboxsync
Message:

IPRT/RTIsoMaker: Added an --name-setup-from-import option to better handle importing old ISOs without joliet present. We get into trouble when adding our files to the ISO in both primary iso and joliet space, since the guest might be inclined to show the joliet view (which is missing the files from the imported ISO).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/fs/isomaker.cpp

    r93115 r93118  
    271271    /** Total number of name nodes in the namespace. */
    272272    uint32_t                cNames;
    273     /** Total number of directories in the namespace. */
     273    /** Total number of directories in the namespace.
     274     * @note Appears to be unused.  */
    274275    uint32_t                cDirs;
    275276    /** The namespace selector (RTFSISOMAKER_NAMESPACE_XXX). */
     
    12801281
    12811282/**
     1283 * Gets the rock ridge support level (on the primary ISO-9660 namespace).
     1284 *
     1285 * @returns 0 if disabled, 1 just enabled, 2 if enabled with ER tag, and
     1286 *          UINT8_MAX if the handle is invalid.
     1287 * @param   hIsoMaker           The ISO maker handle.
     1288 */
     1289RTDECL(uint8_t) RTFsIsoMakerGetRockRidgeLevel(RTFSISOMAKER hIsoMaker)
     1290{
     1291    PRTFSISOMAKERINT pThis = hIsoMaker;
     1292    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET_EX(pThis, UINT8_MAX);
     1293    return pThis->PrimaryIso.uRockRidgeLevel;
     1294}
     1295
     1296
     1297/**
     1298 * Gets the rock ridge support level on the joliet namespace (experimental).
     1299 *
     1300 * @returns 0 if disabled, 1 just enabled, 2 if enabled with ER tag, and
     1301 *          UINT8_MAX if the handle is invalid.
     1302 * @param   hIsoMaker           The ISO maker handle.
     1303 */
     1304RTDECL(uint8_t) RTFsIsoMakerGetJolietRockRidgeLevel(RTFSISOMAKER hIsoMaker)
     1305{
     1306    PRTFSISOMAKERINT pThis = hIsoMaker;
     1307    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET_EX(pThis, UINT8_MAX);
     1308    return pThis->Joliet.uRockRidgeLevel;
     1309}
     1310
     1311
     1312/**
    12821313 * Changes the file attribute (mode, owner, group) inherit style (from source).
    12831314 *
     
    26262657
    26272658
     2659/**
     2660 * Gets currently populated namespaces.
     2661 *
     2662 * @returns Set of namespaces (RTFSISOMAKER_NAMESPACE_XXX), UINT32_MAX on error.
     2663 * @param   hIsoMaker           The ISO maker handle.
     2664 */
     2665RTDECL(uint32_t) RTFsIsoMakerGetPopulatedNamespaces(RTFSISOMAKER hIsoMaker)
     2666{
     2667    PRTFSISOMAKERINT pThis = hIsoMaker;
     2668    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET_EX(pThis, UINT32_MAX);
     2669
     2670    uint32_t fRet = 0;
     2671    if (pThis->PrimaryIso.cNames > 0)
     2672        fRet |= RTFSISOMAKER_NAMESPACE_ISO_9660;
     2673    if (pThis->Joliet.cNames     > 0)
     2674        fRet |= RTFSISOMAKER_NAMESPACE_JOLIET;
     2675    if (pThis->Udf.cNames        > 0)
     2676        fRet |= RTFSISOMAKER_NAMESPACE_UDF;
     2677    if (pThis->Hfs.cNames        > 0)
     2678        fRet |= RTFSISOMAKER_NAMESPACE_HFS;
     2679
     2680    return fRet;
     2681}
    26282682
    26292683
     
    54865540        return rc;
    54875541    AssertReturn(pThis->cObjects > 0, VERR_NO_DATA);
     5542
     5543    /* The primary ISO-9660 namespace must be explicitly disabled (for now),
     5544       so we return VERR_NO_DATA if no root dir. */
    54885545    AssertReturn(pThis->PrimaryIso.pRoot || pThis->PrimaryIso.uLevel == 0, VERR_NO_DATA);
    5489     AssertReturn(pThis->Joliet.pRoot     || pThis->Joliet.uLevel     == 0, VERR_NO_DATA);
     5546
     5547    /* Automatically disable the joliet namespace if it is empty (no root dir). */
     5548    if (!pThis->Joliet.pRoot && pThis->Joliet.uLevel > 0)
     5549    {
     5550        pThis->Joliet.uLevel = 0;
     5551        pThis->cVolumeDescriptors--;
     5552    }
    54905553
    54915554    rc = rtFsIsoMakerFinalizePrepVolumeDescriptors(pThis);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette