VirtualBox

Changeset 67454 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 16, 2017 6:03:37 PM (8 years ago)
Author:
vboxsync
Message:

IPRT: More ISO maker code (booting related).

Location:
trunk/src/VBox/Runtime/common/fs
Files:
2 edited

Legend:

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

    r67453 r67454  
    14471447        char ch;
    14481448        size_t cchComponent = 0;
    1449         while ((ch = pszPath[cchComponent]) != '\0' && RTPATH_IS_SLASH(ch))
     1449        while ((ch = pszPath[cchComponent]) != '\0' && !RTPATH_IS_SLASH(ch))
    14501450            cchComponent++;
    14511451        if (!cchComponent)
     
    33003300    }
    33013301
     3302    /* Save for size setting. */
     3303    uint32_t const cEntriesInFile = cEntries + 1;
     3304
    33023305    /* Check that the remaining entries are empty. */
    3303     while (cEntries < RT_ELEMENTS(pThis->aBootCatEntries) - 1U)
     3306    while (cEntries < RT_ELEMENTS(pThis->aBootCatEntries))
    33043307    {
    33053308        AssertReturn(pThis->aBootCatEntries[cEntries].cEntries == 0, VERR_ISOMK_BOOT_CAT_ERRATIC_ENTRY);
    33063309        cEntries++;
    33073310    }
     3311
     3312    /*
     3313     * Fixate the size of the boot catalog file.
     3314     */
     3315    pThis->pBootCatFile->cbData = cEntriesInFile * 32;
     3316    pThis->cbData  += RT_ALIGN_32(cEntriesInFile * 32, RTFSISOMAKER_SECTOR_SIZE);
    33083317
    33093318    /*
     
    43344343    if ((offInFile = offUnsigned - pFile->offData) < RT_ALIGN_64(pFile->cbData, RTFSISOMAKER_SECTOR_SIZE))
    43354344    { /* hit */ }
    4336     else if (offUnsigned > pFile->offData)
     4345    else if (offUnsigned >= pFile->offData)
    43374346    {
    43384347        /* Seek forwards. */
  • trunk/src/VBox/Runtime/common/fs/isomakercmd.cpp

    r67445 r67454  
    11081108        pParsed->cNamesWithSrc++;
    11091109
    1110         if (!pszEqual && fWithSrc)
     1110        if (!pszEqual)
    11111111        {
    1112             if (!cchName)
    1113                 return rtFsIsoMakerCmdSyntaxError(pOpts, "empty source file name: %s", pszSpecIn);
    1114             if (cchName == 8 && strcmp(pszSpec, ":remove:") == 0)
    1115                 pParsed->enmSrcType = RTFSISOMKCMDPARSEDNAMES::kSrcType_Remove;
    1116             else if (cchName == 13 && strcmp(pszSpec, ":must-remove:") == 0)
    1117                 pParsed->enmSrcType = RTFSISOMKCMDPARSEDNAMES::kSrcType_MustRemove;
     1112            if (fWithSrc)
     1113            {
     1114                if (!cchName)
     1115                    return rtFsIsoMakerCmdSyntaxError(pOpts, "empty source file name: %s", pszSpecIn);
     1116                if (cchName == 8 && strcmp(pszSpec, ":remove:") == 0)
     1117                    pParsed->enmSrcType = RTFSISOMKCMDPARSEDNAMES::kSrcType_Remove;
     1118                else if (cchName == 13 && strcmp(pszSpec, ":must-remove:") == 0)
     1119                    pParsed->enmSrcType = RTFSISOMKCMDPARSEDNAMES::kSrcType_MustRemove;
     1120            }
    11181121            break;
    11191122        }
     
    19011904    if (phVfsFile)
    19021905        *phVfsFile = NIL_RTVFSFILE;
     1906    for (uint32_t i = 0; i < RT_ELEMENTS(Opts.aBootCatEntries); i++)
     1907        Opts.aBootCatEntries[i].u.Section.idxImageObj = UINT32_MAX;
    19031908
    19041909    /* Setup option parsing. */
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