VirtualBox

Changeset 68817 in vbox


Ignore:
Timestamp:
Sep 22, 2017 12:34:16 PM (7 years ago)
Author:
vboxsync
Message:

IPRT/isomaker: Added default 16 sector image padding (allegedly a workaround for various read ahead bugs) and a bunch of other things.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/fsisomaker.h

    r68813 r68817  
    126126 */
    127127RTDECL(int) RTFsIsoMakerSetJolietRockRidgeLevel(RTFSISOMAKER hIsoMaker, uint8_t uLevel);
     128
     129/**
     130 * Changes the file attribute (mode, owner, group) inherit style (from source).
     131 *
     132 * The strict style will use the exact attributes from the source, where as the
     133 * non-strict (aka rational and default) style will use 0 for the owner and
     134 * group IDs and normalize the mode bits along the lines of 'chmod a=rX',
     135 * stripping set-uid/gid bitson files but preserving sticky ones on directories.
     136 *
     137 * When disabling strict style, the default dir and file modes will be restored
     138 * to default values.
     139 *
     140 * @returns IRPT status code.
     141 * @param   hIsoMaker           The ISO maker handle.
     142 * @param   fStrict             Indicates strict (true) or non-strict (false)
     143 *                              style.
     144 */
     145RTDECL(int) RTFsIsoMakerSetAttribInheritStyle(RTFSISOMAKER hIsoMaker, bool fStrict);
    128146
    129147/**
     
    227245
    228246/**
     247 * Specifies image padding.
     248 *
     249 * @returns IPRT status code.
     250 * @param   hIsoMaker           The ISO maker handle.
     251 * @param   cSectors            Number of sectors to pad the image with.
     252 */
     253RTDECL(int) RTFsIsoMakerSetImagePadding(RTFSISOMAKER hIsoMaker, uint32_t cSectors);
     254
     255/**
    229256 * Resolves a path into a object ID.
    230257 *
     
    495522 */
    496523RTDECL(int) RTFsIsoMakerAddSymlink(RTFSISOMAKER hIsoMaker, const char *pszSymlink, const char *pszTarget, uint32_t *pidxObj);
     524
     525/**
     526 * Modifies the mode mask for a given path in one or more namespaces.
     527 *
     528 * The mode mask is used by rock ridge, UDF and HFS.
     529 *
     530 * @returns IPRT status code.
     531 * @retval  VWRN_NOT_FOUND if the path wasn't found in any of the specified
     532 *          namespaces.
     533 *
     534 * @param   hIsoMaker           The ISO maker handler.
     535 * @param   pszPath             The path which mode mask should be modified.
     536 * @param   fNamespaces         The namespaces to set it in.
     537 * @param   fSet                The mode bits to set.
     538 * @param   fUnset              The mode bits to clear (applied first).
     539 * @param   fFlags              Reserved, MBZ.
     540 * @param   pcHits              Where to return number of paths found. Optional.
     541 */
     542RTDECL(int) RTFsIsoMakerSetPathMode(RTFSISOMAKER hIsoMaker, const char *pszPath, uint32_t fNamespaces,
     543                                    RTFMODE fSet, RTFMODE fUnset, uint32_t fFlags, uint32_t *pcHits);
     544
     545/**
     546 * Modifies the owner ID for a given path in one or more namespaces.
     547 *
     548 * The owner ID is used by rock ridge, UDF and HFS.
     549 *
     550 * @returns IPRT status code.
     551 * @retval  VWRN_NOT_FOUND if the path wasn't found in any of the specified
     552 *          namespaces.
     553 *
     554 * @param   hIsoMaker           The ISO maker handler.
     555 * @param   pszPath             The path which mode mask should be modified.
     556 * @param   fNamespaces         The namespaces to set it in.
     557 * @param   idOwner             The new owner ID to set.
     558 * @param   pcHits              Where to return number of paths found. Optional.
     559 */
     560RTDECL(int) RTFsIsoMakerSetPathOwnerId(RTFSISOMAKER hIsoMaker, const char *pszPath, uint32_t fNamespaces,
     561                                       RTUID idOwner, uint32_t *pcHits);
     562
     563/**
     564 * Modifies the group ID for a given path in one or more namespaces.
     565 *
     566 * The group ID is used by rock ridge, UDF and HFS.
     567 *
     568 * @returns IPRT status code.
     569 * @retval  VWRN_NOT_FOUND if the path wasn't found in any of the specified
     570 *          namespaces.
     571 *
     572 * @param   hIsoMaker           The ISO maker handler.
     573 * @param   pszPath             The path which mode mask should be modified.
     574 * @param   fNamespaces         The namespaces to set it in.
     575 * @param   idGroup             The new group ID to set.
     576 * @param   pcHits              Where to return number of paths found. Optional.
     577 */
     578RTDECL(int) RTFsIsoMakerSetPathGroupId(RTFSISOMAKER hIsoMaker, const char *pszPath, uint32_t fNamespaces,
     579                                       RTGID idGroup, uint32_t *pcHits);
    497580
    498581/**
  • trunk/include/iprt/mangling.h

    r68813 r68817  
    930930# define RTFsIsoMakerQueryObjIdxForBootCatalog          RT_MANGLER(RTFsIsoMakerQueryObjIdxForBootCatalog)
    931931# define RTFsIsoMakerGetIso9660Level                    RT_MANGLER(RTFsIsoMakerGetIso9660Level)
     932# define RTFsIsoMakerSetImagePadding                    RT_MANGLER(RTFsIsoMakerSetImagePadding)
    932933# define RTFsIsoMakerSetIso9660Level                    RT_MANGLER(RTFsIsoMakerSetIso9660Level)
    933934# define RTFsIsoMakerSetJolietUcs2Level                 RT_MANGLER(RTFsIsoMakerSetJolietUcs2Level)
    934935# define RTFsIsoMakerSetRockRidgeLevel                  RT_MANGLER(RTFsIsoMakerSetRockRidgeLevel)
    935936# define RTFsIsoMakerSetJolietRockRidgeLevel            RT_MANGLER(RTFsIsoMakerSetJolietRockRidgeLevel)
     937# define RTFsIsoMakerSetAttribInheritStyle              RT_MANGLER(RTFsIsoMakerSetAttribInheritStyle)
    936938# define RTFsIsoMakerSetDefaultDirMode                  RT_MANGLER(RTFsIsoMakerSetDefaultDirMode)
    937939# define RTFsIsoMakerSetDefaultFileMode                 RT_MANGLER(RTFsIsoMakerSetDefaultFileMode)
    938940# define RTFsIsoMakerSetForcedDirMode                   RT_MANGLER(RTFsIsoMakerSetForcedDirMode)
    939941# define RTFsIsoMakerSetForcedFileMode                  RT_MANGLER(RTFsIsoMakerSetForcedFileMode)
     942# define RTFsIosMakerSetPathGroupId                     RT_MANGLER(RTFsIosMakerSetPathGroupId)
     943# define RTFsIosMakerSetPathMode                        RT_MANGLER(RTFsIosMakerSetPathMode)
     944# define RTFsIosMakerSetPathOwnerId                     RT_MANGLER(RTFsIosMakerSetPathOwnerId)
    940945# define RTFsIsoMakerSetSysAreaContent                  RT_MANGLER(RTFsIsoMakerSetSysAreaContent)
    941946# define RTFsIsoMakerSetStringProp                      RT_MANGLER(RTFsIsoMakerSetStringProp)
  • trunk/src/VBox/Runtime/common/fs/isomaker.cpp

    r68813 r68817  
    495495    /** Number of volume descriptors. */
    496496    uint32_t                cVolumeDescriptors;
     497    /** The image (trail) padding in bytes. */
     498    uint32_t                cbImagePadding;
    497499
    498500    /** The 'now' timestamp we use for the whole image.
     
    500502     * over the whole image. */
    501503    RTTIMESPEC              ImageCreationTime;
     504    /** Indicates strict or non-strict attribute handling style.
     505     * See RTFsIsoMakerSetAttributeStyle() for details.  */
     506    bool                    fStrictAttributeStyle;
    502507    /** The default owner ID. */
    503508    RTUID                   uidDefault;
     
    823828
    824829        pThis->cVolumeDescriptors           = 3; /* primary, secondary joliet, terminator. */
    825 
     830        pThis->cbImagePadding               = 150 * RTFSISOMAKER_SECTOR_SIZE;
     831
     832        //pThis->fStrictAttributeStyle      = false;
    826833        //pThis->uidDefault                 = 0;
    827834        //pThis->gidDefault                 = 0;
     
    12651272
    12661273    pThis->Joliet.uRockRidgeLevel = uLevel;
     1274    return VINF_SUCCESS;
     1275}
     1276
     1277
     1278/**
     1279 * Changes the file attribute (mode, owner, group) inherit style (from source).
     1280 *
     1281 * The strict style will use the exact attributes from the source, where as the
     1282 * non-strict (aka rational and default) style will use 0 for the owner and
     1283 * group IDs and normalize the mode bits along the lines of 'chmod a=rX',
     1284 * stripping set-uid/gid bitson files but preserving sticky ones on directories.
     1285 *
     1286 * When disabling strict style, the default dir and file modes will be restored
     1287 * to default values.
     1288 *
     1289 * @returns IRPT status code.
     1290 * @param   hIsoMaker           The ISO maker handle.
     1291 * @param   fStrict             Indicates strict (true) or non-strict (false)
     1292 *                              style.
     1293 */
     1294RTDECL(int) RTFsIsoMakerSetAttribInheritStyle(RTFSISOMAKER hIsoMaker, bool fStrict)
     1295{
     1296    PRTFSISOMAKERINT pThis = hIsoMaker;
     1297    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET(pThis);
     1298
     1299    pThis->fStrictAttributeStyle = fStrict;
     1300    if (!fStrict)
     1301    {
     1302        pThis->fDefaultFileMode = 0444 | RTFS_TYPE_FILE      | RTFS_DOS_ARCHIVED  | RTFS_DOS_READONLY;
     1303        pThis->fDefaultDirMode  = 0555 | RTFS_TYPE_DIRECTORY | RTFS_DOS_DIRECTORY | RTFS_DOS_READONLY;
     1304    }
     1305
    12671306    return VINF_SUCCESS;
    12681307}
     
    14771516    return VINF_SUCCESS;
    14781517}
     1518
     1519
     1520/**
     1521 * Specifies image padding.
     1522 *
     1523 * @returns IPRT status code.
     1524 * @param   hIsoMaker           The ISO maker handle.
     1525 * @param   cSectors            Number of sectors to pad the image with.
     1526 */
     1527RTDECL(int) RTFsIsoMakerSetImagePadding(RTFSISOMAKER hIsoMaker, uint32_t cSectors)
     1528{
     1529    PRTFSISOMAKERINT pThis = hIsoMaker;
     1530    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET(pThis);
     1531    AssertReturn(cSectors <= _64K, VERR_OUT_OF_RANGE);
     1532    AssertReturn(!pThis->fFinalized, VERR_WRONG_ORDER);
     1533
     1534    pThis->cbImagePadding = cSectors * RTFSISOMAKER_SECTOR_SIZE;
     1535    return VINF_SUCCESS;
     1536}
     1537
     1538
    14791539
    14801540
     
    29062966        }
    29072967    return VINF_SUCCESS;
    2908 
    29092968}
    29102969
     
    30253084        pObj->AccessedTime      = pObjInfo->AccessTime;
    30263085        pObj->fMode             = pObjInfo->Attr.fMode;
     3086        if (!pThis->fStrictAttributeStyle)
     3087        {
     3088            if (enmType == RTFSISOMAKEROBJTYPE_DIR)
     3089                pObj->fMode     = (pObjInfo->Attr.fMode & ~07222) | 0555;
     3090            else
     3091            {
     3092                pObj->fMode     = (pObjInfo->Attr.fMode & ~00222) | 0444;
     3093                if (pObj->fMode & 0111)
     3094                    pObj->fMode |= 0111;
     3095            }
     3096            pObj->uid           = pThis->uidDefault;
     3097            pObj->gid           = pThis->gidDefault;
     3098        }
     3099        else
     3100        {
     3101            pObj->fMode         = pObjInfo->Attr.fMode;
     3102            pObj->uid           = pObjInfo->Attr.u.Unix.uid != NIL_RTUID ? pObjInfo->Attr.u.Unix.uid : pThis->uidDefault;
     3103            pObj->gid           = pObjInfo->Attr.u.Unix.gid != NIL_RTGID ? pObjInfo->Attr.u.Unix.gid : pThis->gidDefault;
     3104        }
    30273105        if (enmType == RTFSISOMAKEROBJTYPE_DIR ? pThis->fForcedDirModeActive : pThis->fForcedFileModeActive)
    30283106            pObj->fMode = (pObj->fMode & ~RTFS_UNIX_ALL_PERMS)
    30293107                        | (enmType == RTFSISOMAKEROBJTYPE_DIR ? pThis->fForcedDirMode : pThis->fForcedFileMode);
    3030         pObj->uid               = pObjInfo->Attr.u.Unix.uid != NIL_RTUID ? pObjInfo->Attr.u.Unix.uid : pThis->uidDefault;
    3031         pObj->gid               = pObjInfo->Attr.u.Unix.gid != NIL_RTGID ? pObjInfo->Attr.u.Unix.gid : pThis->gidDefault;
    30323108    }
    30333109    else
     
    35893665
    35903666}
     3667
     3668
     3669
     3670/*
     3671 *
     3672 * Name space level object config.
     3673 * Name space level object config.
     3674 * Name space level object config.
     3675 *
     3676 */
     3677
     3678
     3679/**
     3680 * Modifies the mode mask for a given path in one or more namespaces.
     3681 *
     3682 * The mode mask is used by rock ridge, UDF and HFS.
     3683 *
     3684 * @returns IPRT status code.
     3685 * @retval  VWRN_NOT_FOUND if the path wasn't found in any of the specified
     3686 *          namespaces.
     3687 *
     3688 * @param   hIsoMaker           The ISO maker handler.
     3689 * @param   pszPath             The path which mode mask should be modified.
     3690 * @param   fNamespaces         The namespaces to set it in.
     3691 * @param   fSet                The mode bits to set.
     3692 * @param   fUnset              The mode bits to clear (applied first).
     3693 * @param   fFlags              Reserved, MBZ.
     3694 * @param   pcHits              Where to return number of paths found. Optional.
     3695 */
     3696RTDECL(int) RTFsIsoMakerSetPathMode(RTFSISOMAKER hIsoMaker, const char *pszPath, uint32_t fNamespaces,
     3697                                    RTFMODE fSet, RTFMODE fUnset, uint32_t fFlags, uint32_t *pcHits)
     3698{
     3699    /*
     3700     * Validate input.
     3701     */
     3702    PRTFSISOMAKERINT pThis = hIsoMaker;
     3703    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET(pThis);
     3704    AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
     3705    AssertReturn(RTPATH_IS_SLASH(*pszPath), VERR_INVALID_NAME);
     3706    AssertReturn(!(fNamespaces & ~RTFSISOMAKER_NAMESPACE_VALID_MASK), VERR_INVALID_FLAGS);
     3707    AssertReturn(!(fSet   & ~07777), VERR_INVALID_PARAMETER);
     3708    AssertReturn(!(fUnset & ~07777), VERR_INVALID_PARAMETER);
     3709    AssertReturn(!fFlags, VERR_INVALID_FLAGS);
     3710    AssertPtrNullReturn(pcHits, VERR_INVALID_POINTER);
     3711
     3712    /*
     3713     * Make the changes namespace by namespace.
     3714     */
     3715    uint32_t cHits = 0;
     3716    for (uint32_t i = 0; i < RT_ELEMENTS(g_aRTFsIsoNamespaces); i++)
     3717        if (fNamespaces & g_aRTFsIsoNamespaces[i].fNamespace)
     3718        {
     3719            PRTFSISOMAKERNAMESPACE pNamespace = (PRTFSISOMAKERNAMESPACE)((uintptr_t)pThis + g_aRTFsIsoNamespaces[i].offNamespace);
     3720            if (pNamespace->uLevel > 0)
     3721            {
     3722                PRTFSISOMAKERNAME pName;
     3723                int rc = rtFsIsoMakerWalkPathBySpec(pNamespace, pszPath, &pName);
     3724                if (RT_SUCCESS(rc))
     3725                {
     3726                    pName->fMode = (pName->fMode & ~fUnset) | fSet;
     3727                    cHits++;
     3728                }
     3729            }
     3730        }
     3731
     3732   if (pcHits)
     3733       *pcHits = cHits;
     3734   if (cHits > 0)
     3735       return VINF_SUCCESS;
     3736   return VWRN_NOT_FOUND;
     3737}
     3738
     3739
     3740/**
     3741 * Modifies the owner ID for a given path in one or more namespaces.
     3742 *
     3743 * The owner ID is used by rock ridge, UDF and HFS.
     3744 *
     3745 * @returns IPRT status code.
     3746 * @retval  VWRN_NOT_FOUND if the path wasn't found in any of the specified
     3747 *          namespaces.
     3748 *
     3749 * @param   hIsoMaker           The ISO maker handler.
     3750 * @param   pszPath             The path which mode mask should be modified.
     3751 * @param   fNamespaces         The namespaces to set it in.
     3752 * @param   idOwner             The new owner ID to set.
     3753 * @param   pcHits              Where to return number of paths found. Optional.
     3754 */
     3755RTDECL(int) RTFsIsoMakerSetPathOwnerId(RTFSISOMAKER hIsoMaker, const char *pszPath, uint32_t fNamespaces,
     3756                                       RTUID idOwner, uint32_t *pcHits)
     3757{
     3758    /*
     3759     * Validate input.
     3760     */
     3761    PRTFSISOMAKERINT pThis = hIsoMaker;
     3762    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET(pThis);
     3763    AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
     3764    AssertReturn(RTPATH_IS_SLASH(*pszPath), VERR_INVALID_NAME);
     3765    AssertReturn(!(fNamespaces & ~RTFSISOMAKER_NAMESPACE_VALID_MASK), VERR_INVALID_FLAGS);
     3766    AssertPtrNullReturn(pcHits, VERR_INVALID_POINTER);
     3767
     3768    /*
     3769     * Make the changes namespace by namespace.
     3770     */
     3771    uint32_t cHits = 0;
     3772    for (uint32_t i = 0; i < RT_ELEMENTS(g_aRTFsIsoNamespaces); i++)
     3773        if (fNamespaces & g_aRTFsIsoNamespaces[i].fNamespace)
     3774        {
     3775            PRTFSISOMAKERNAMESPACE pNamespace = (PRTFSISOMAKERNAMESPACE)((uintptr_t)pThis + g_aRTFsIsoNamespaces[i].offNamespace);
     3776            if (pNamespace->uLevel > 0)
     3777            {
     3778                PRTFSISOMAKERNAME pName;
     3779                int rc = rtFsIsoMakerWalkPathBySpec(pNamespace, pszPath, &pName);
     3780                if (RT_SUCCESS(rc))
     3781                {
     3782                    pName->uid = idOwner;
     3783                    cHits++;
     3784                }
     3785            }
     3786        }
     3787
     3788   if (pcHits)
     3789       *pcHits = cHits;
     3790   if (cHits > 0)
     3791       return VINF_SUCCESS;
     3792   return VWRN_NOT_FOUND;
     3793}
     3794
     3795
     3796/**
     3797 * Modifies the group ID for a given path in one or more namespaces.
     3798 *
     3799 * The group ID is used by rock ridge, UDF and HFS.
     3800 *
     3801 * @returns IPRT status code.
     3802 * @retval  VWRN_NOT_FOUND if the path wasn't found in any of the specified
     3803 *          namespaces.
     3804 *
     3805 * @param   hIsoMaker           The ISO maker handler.
     3806 * @param   pszPath             The path which mode mask should be modified.
     3807 * @param   fNamespaces         The namespaces to set it in.
     3808 * @param   idGroup             The new group ID to set.
     3809 * @param   pcHits              Where to return number of paths found. Optional.
     3810 */
     3811RTDECL(int) RTFsIsoMakerSetPathGroupId(RTFSISOMAKER hIsoMaker, const char *pszPath, uint32_t fNamespaces,
     3812                                       RTGID idGroup, uint32_t *pcHits)
     3813{
     3814    /*
     3815     * Validate input.
     3816     */
     3817    PRTFSISOMAKERINT pThis = hIsoMaker;
     3818    RTFSISOMAKER_ASSERT_VALID_HANDLE_RET(pThis);
     3819    AssertPtrReturn(pszPath, VERR_INVALID_POINTER);
     3820    AssertReturn(RTPATH_IS_SLASH(*pszPath), VERR_INVALID_NAME);
     3821    AssertReturn(!(fNamespaces & ~RTFSISOMAKER_NAMESPACE_VALID_MASK), VERR_INVALID_FLAGS);
     3822    AssertPtrNullReturn(pcHits, VERR_INVALID_POINTER);
     3823
     3824    /*
     3825     * Make the changes namespace by namespace.
     3826     */
     3827    uint32_t cHits = 0;
     3828    for (uint32_t i = 0; i < RT_ELEMENTS(g_aRTFsIsoNamespaces); i++)
     3829        if (fNamespaces & g_aRTFsIsoNamespaces[i].fNamespace)
     3830        {
     3831            PRTFSISOMAKERNAMESPACE pNamespace = (PRTFSISOMAKERNAMESPACE)((uintptr_t)pThis + g_aRTFsIsoNamespaces[i].offNamespace);
     3832            if (pNamespace->uLevel > 0)
     3833            {
     3834                PRTFSISOMAKERNAME pName;
     3835                int rc = rtFsIsoMakerWalkPathBySpec(pNamespace, pszPath, &pName);
     3836                if (RT_SUCCESS(rc))
     3837                {
     3838                    pName->gid = idGroup;
     3839                    cHits++;
     3840                }
     3841            }
     3842        }
     3843
     3844   if (pcHits)
     3845       *pcHits = cHits;
     3846   if (cHits > 0)
     3847       return VINF_SUCCESS;
     3848   return VWRN_NOT_FOUND;
     3849}
     3850
     3851
     3852
     3853
    35913854
    35923855
     
    52205483            if (RT_SUCCESS(rc))
    52215484            {
    5222                 pThis->cbFinalizedImage = offData;
     5485                pThis->cbFinalizedImage = offData + pThis->cbImagePadding;
    52235486
    52245487                /*
     
    69077170            if (offUnsigned < pIsoMaker->cbFinalizedImage)
    69087171            {
    6909                 rc = rtFsIsoMakerOutFile_ReadFileData(pThis, pIsoMaker, offUnsigned, pbBuf, cbBuf, &cbDone);
    6910                 if (RT_FAILURE(rc))
    6911                     break;
     7172                if (offUnsigned < pIsoMaker->cbFinalizedImage - pIsoMaker->cbImagePadding)
     7173                {
     7174                    rc = rtFsIsoMakerOutFile_ReadFileData(pThis, pIsoMaker, offUnsigned, pbBuf, cbBuf, &cbDone);
     7175                    if (RT_FAILURE(rc))
     7176                        break;
     7177                }
     7178                else
     7179                {
     7180                    cbDone = pIsoMaker->cbFinalizedImage - offUnsigned;
     7181                    if (cbDone > cbBuf)
     7182                        cbDone = cbBuf;
     7183                    memset(pbBuf, 0, cbDone);
     7184                }
    69127185            }
    69137186            else
  • trunk/src/VBox/Runtime/common/fs/isomakercmd.cpp

    r68814 r68817  
    100100    RTFSISOMAKERCMD_OPT_RANDOM_ORDER_VERIFICATION,
    101101    RTFSISOMAKERCMD_OPT_NAME_SETUP,
     102
     103    RTFSISOMAKERCMD_OPT_ROCK_RIDGE,
     104    RTFSISOMAKERCMD_OPT_LIMITED_ROCK_RIDGE,
     105    RTFSISOMAKERCMD_OPT_NO_ROCK_RIDGE,
    102106    RTFSISOMAKERCMD_OPT_NO_JOLIET,
     107
    103108    RTFSISOMAKERCMD_OPT_IMPORT_ISO,
    104109    RTFSISOMAKERCMD_OPT_PUSH_ISO,
     
    114119    RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_288,
    115120
     121    RTFSISOMAKERCMD_OPT_RATIONAL_ATTRIBS,
     122    RTFSISOMAKERCMD_OPT_STRICT_ATTRIBS,
    116123    RTFSISOMAKERCMD_OPT_NO_FILE_MODE,
    117124    RTFSISOMAKERCMD_OPT_NO_DIR_MODE,
     125    RTFSISOMAKERCMD_OPT_CHMOD,
     126    RTFSISOMAKERCMD_OPT_CHOWN,
     127    RTFSISOMAKERCMD_OPT_CHGRP,
    118128
    119129    /*
     
    441451{
    442452    /*
    443      * Unquie IPRT ISO maker options.
     453     * Unique IPRT ISO maker options.
    444454     */
    445     { "--iprt-iso-maker-file-marker",           RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER, RTGETOPT_REQ_STRING },
    446     { "--iprt-iso-maker-file-marker-ms",        RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER, RTGETOPT_REQ_STRING },
    447     { "--iprt-iso-maker-file-marker-ms-crt",    RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER, RTGETOPT_REQ_STRING },
    448     { "--iprt-iso-maker-file-marker-bourne",    RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER, RTGETOPT_REQ_STRING },
    449     { "--iprt-iso-maker-file-marker-bourne-sh", RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER, RTGETOPT_REQ_STRING },
    450 
    451     { "--output-buffer-size",           RTFSISOMAKERCMD_OPT_OUTPUT_BUFFER_SIZE,             RTGETOPT_REQ_UINT32  },
    452     { "--random-output-buffer-size",    RTFSISOMAKERCMD_OPT_RANDOM_OUTPUT_BUFFER_SIZE,      RTGETOPT_REQ_NOTHING },
    453     { "--random-order-verficiation",    RTFSISOMAKERCMD_OPT_RANDOM_ORDER_VERIFICATION,      RTGETOPT_REQ_UINT32 },
    454455    { "--name-setup",                   RTFSISOMAKERCMD_OPT_NAME_SETUP,                     RTGETOPT_REQ_STRING  },
    455     { "--no-joliet",                    RTFSISOMAKERCMD_OPT_NO_JOLIET,                      RTGETOPT_REQ_NOTHING },
    456456    { "--import-iso",                   RTFSISOMAKERCMD_OPT_IMPORT_ISO,                     RTGETOPT_REQ_STRING  },
    457457    { "--push-iso",                     RTFSISOMAKERCMD_OPT_PUSH_ISO,                       RTGETOPT_REQ_STRING  },
     
    461461    { "--pop",                          RTFSISOMAKERCMD_OPT_POP,                            RTGETOPT_REQ_NOTHING },
    462462
     463    { "--rock-ridge",                   RTFSISOMAKERCMD_OPT_ROCK_RIDGE,                     RTGETOPT_REQ_NOTHING },
     464    { "--limited-rock-ridge",           RTFSISOMAKERCMD_OPT_LIMITED_ROCK_RIDGE,             RTGETOPT_REQ_NOTHING },
     465    { "--no-rock-ridge",                RTFSISOMAKERCMD_OPT_NO_ROCK_RIDGE,                  RTGETOPT_REQ_NOTHING },
     466    { "--no-joliet",                    RTFSISOMAKERCMD_OPT_NO_JOLIET,                      RTGETOPT_REQ_NOTHING },
     467    { "--joliet-ucs-level",             RTFSISOMAKERCMD_OPT_JOLIET_LEVEL,                   RTGETOPT_REQ_UINT8   },
     468
     469    { "--rational-attribs",             RTFSISOMAKERCMD_OPT_RATIONAL_ATTRIBS,               RTGETOPT_REQ_NOTHING },
     470    { "--strict-attribs",               RTFSISOMAKERCMD_OPT_STRICT_ATTRIBS,                 RTGETOPT_REQ_NOTHING },
     471    { "--no-file-mode",                 RTFSISOMAKERCMD_OPT_NO_FILE_MODE,                   RTGETOPT_REQ_NOTHING },
     472    { "--no-dir-mode",                  RTFSISOMAKERCMD_OPT_NO_DIR_MODE,                    RTGETOPT_REQ_NOTHING },
     473    { "--chmod",                        RTFSISOMAKERCMD_OPT_CHMOD,                          RTGETOPT_REQ_STRING  },
     474    { "--chown",                        RTFSISOMAKERCMD_OPT_CHOWN,                          RTGETOPT_REQ_STRING  },
     475    { "--chgrp",                        RTFSISOMAKERCMD_OPT_CHGRP,                          RTGETOPT_REQ_STRING  },
    463476
    464477    { "--eltorito-new-entry",           RTFSISOMAKERCMD_OPT_ELTORITO_NEW_ENTRY,             RTGETOPT_REQ_NOTHING },
     
    468481    { "--eltorito-floppy-288",          RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_288,            RTGETOPT_REQ_NOTHING },
    469482
    470     { "--no-file-mode",                 RTFSISOMAKERCMD_OPT_NO_FILE_MODE,                   RTGETOPT_REQ_NOTHING },
    471     { "--no-dir-mode",                  RTFSISOMAKERCMD_OPT_NO_DIR_MODE,                    RTGETOPT_REQ_NOTHING },
     483    { "--iprt-iso-maker-file-marker",           RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER, RTGETOPT_REQ_STRING },
     484    { "--iprt-iso-maker-file-marker-ms",        RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER, RTGETOPT_REQ_STRING },
     485    { "--iprt-iso-maker-file-marker-ms-crt",    RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER, RTGETOPT_REQ_STRING },
     486    { "--iprt-iso-maker-file-marker-bourne",    RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER, RTGETOPT_REQ_STRING },
     487    { "--iprt-iso-maker-file-marker-bourne-sh", RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER, RTGETOPT_REQ_STRING },
     488
     489    { "--output-buffer-size",           RTFSISOMAKERCMD_OPT_OUTPUT_BUFFER_SIZE,             RTGETOPT_REQ_UINT32  },
     490    { "--random-output-buffer-size",    RTFSISOMAKERCMD_OPT_RANDOM_OUTPUT_BUFFER_SIZE,      RTGETOPT_REQ_NOTHING },
     491    { "--random-order-verficiation",    RTFSISOMAKERCMD_OPT_RANDOM_ORDER_VERIFICATION,      RTGETOPT_REQ_UINT32 },
    472492
    473493#define DD(a_szLong, a_chShort, a_fFlags) { a_szLong, a_chShort, a_fFlags  }, { "-" a_szLong, a_chShort, a_fFlags  }
     
    498518    DD("-sysid",                        RTFSISOMAKERCMD_OPT_SYSTEM_ID,                      RTGETOPT_REQ_STRING  ),
    499519    { "--volume-id",                    RTFSISOMAKERCMD_OPT_VOLUME_ID,                      RTGETOPT_REQ_STRING  }, /* should've been '-V' */
    500     DD("-volid-id",                     RTFSISOMAKERCMD_OPT_VOLUME_ID,                      RTGETOPT_REQ_STRING  ),
     520    DD("-volid",                        RTFSISOMAKERCMD_OPT_VOLUME_ID,                      RTGETOPT_REQ_STRING  ),
    501521    DD("-volset",                       RTFSISOMAKERCMD_OPT_VOLUME_SET_ID,                  RTGETOPT_REQ_STRING  ),
    502522
     
    508528    DD("--iso-level",                   RTFSISOMAKERCMD_OPT_ISO_LEVEL,                      RTGETOPT_REQ_UINT8   ),
    509529    { "--long-names",                   'l',                                                RTGETOPT_REQ_NOTHING },
     530    { "--output",                       'o',                                                RTGETOPT_REQ_STRING  },
     531    { "--joliet",                       'J',                                                RTGETOPT_REQ_NOTHING },
     532    DD("-ucs-level",                    RTFSISOMAKERCMD_OPT_JOLIET_LEVEL,                   RTGETOPT_REQ_UINT8   ),
     533    DD("-rock",                         'R',                                                RTGETOPT_REQ_NOTHING ),
     534    DD("-rational-rock",                'r',                                                RTGETOPT_REQ_NOTHING ),
     535    DD("-pad",                          RTFSISOMAKERCMD_OPT_PAD,                            RTGETOPT_REQ_NOTHING ),
     536    DD("-no-pad",                       RTFSISOMAKERCMD_OPT_NO_PAD,                         RTGETOPT_REQ_NOTHING ),
    510537
    511538    /*
     
    547574    DD("-input-charset",                RTFSISOMAKERCMD_OPT_INPUT_CHARSET,                  RTGETOPT_REQ_STRING  ),
    548575    DD("-output-charset",               RTFSISOMAKERCMD_OPT_OUTPUT_CHARSET,                 RTGETOPT_REQ_STRING  ),
    549     { "--joliet",                       'J',                                                RTGETOPT_REQ_NOTHING },
    550576    DD("-joliet-long",                  RTFSISOMAKERCMD_OPT_JOLIET_LONG,                    RTGETOPT_REQ_NOTHING ),
    551577    DD("-jcharset",                     RTFSISOMAKERCMD_OPT_JOLIET_CHARSET,                 RTGETOPT_REQ_STRING  ),
     
    573599    DD("-no-split-symlink-components",  RTFSISOMAKERCMD_OPT_NO_SPLIT_SYMLINK_COMPONENTS,    RTGETOPT_REQ_NOTHING ),
    574600    DD("-no-split-symlink-fields",      RTFSISOMAKERCMD_OPT_NO_SPLIT_SYMLINK_FIELDS,        RTGETOPT_REQ_NOTHING ),
    575     { "--output",                       'o',                                                RTGETOPT_REQ_STRING  },
    576     DD("-pad",                          RTFSISOMAKERCMD_OPT_PAD,                            RTGETOPT_REQ_NOTHING ),
    577     DD("-no-pad",                       RTFSISOMAKERCMD_OPT_NO_PAD,                         RTGETOPT_REQ_NOTHING ),
    578601    DD("-path-list",                    RTFSISOMAKERCMD_OPT_PATH_LIST,                      RTGETOPT_REQ_STRING  ),
    579602    DD("-print-size",                   RTFSISOMAKERCMD_OPT_PRINT_SIZE,                     RTGETOPT_REQ_NOTHING ),
    580603    DD("-quiet",                        RTFSISOMAKERCMD_OPT_QUIET,                          RTGETOPT_REQ_NOTHING ),
    581     { "--rock-ridge",                   'R',                                                RTGETOPT_REQ_NOTHING },
    582     { "--rock-ridge-relaxed",           'r',                                                RTGETOPT_REQ_NOTHING },
    583604    DD("-relaxed-filenames",            RTFSISOMAKERCMD_OPT_RELAXED_FILENAMES,              RTGETOPT_REQ_NOTHING ),
    584605    DD("-root",                         RTFSISOMAKERCMD_OPT_ROOT,                           RTGETOPT_REQ_STRING  ),
     
    594615    { "--trans-tbl",                    'T',                                                RTGETOPT_REQ_NOTHING },
    595616    DD("-table-name",                   RTFSISOMAKERCMD_OPT_TRANS_TBL_NAME,                 RTGETOPT_REQ_STRING  ),
    596     DD("-ucs-level",                    RTFSISOMAKERCMD_OPT_JOLIET_LEVEL,                   RTGETOPT_REQ_UINT8   ),
    597617    DD("-udf",                          RTFSISOMAKERCMD_OPT_UDF,                            RTGETOPT_REQ_NOTHING ),
    598618    DD("-uid",                          RTFSISOMAKERCMD_OPT_UID,                            RTGETOPT_REQ_UINT32  ),
     
    849869                       "\n"
    850870                       "\n"
    851                        "Options:\n"
     871                       "Options - General:\n"
     872                       "\n"
     873                       "    -o <output-file>\n"
     874                       "    --output <output-file>\n"
     875                       "        The output filename.  This option is not supported in VISO mode.\n"
    852876                       "\n"
    853877                       "    --name-setup <spec>\n"
     
    873897                       "            - hfs-trans-tbl\n"
    874898                       "\n"
    875                        "    --iso-level <0|1|2|3>\n"
    876                        "        Sets the ISO level:\n"
    877                        "            - 0: Disable primary ISO namespace.\n"
    878                        "            - 1: ISO level 1: Filenames 8.3 format and limited to 4GB - 1.\n"
    879                        "            - 2: ISO level 2: 31 char long names and limited to 4GB - 1.\n"
    880                        "            - 3: ISO level 3: 31 char long names and support for >=4GB files.\n"
    881                        "            - 4: Fictive level used by other tools. Not yet implemented.\n"
    882                        "        Default: 3\n"
    883                        "\n"
    884                        "    --no-joliet\n"
    885                        "        Disable the joliet namespace entirely.  This option must be specified\n"
    886                        "        before any file specifications\n"
    887                        "\n"
    888899                       "    --push-iso <iso-file>\n"
    889900                       "    --push-iso-no-joliet <iso-file>\n"
     
    903914                       "        omit namespaces.\n"
    904915                       "\n"
     916                       "\n"
     917                       "Options - Namespaces:\n"
     918                       "\n"
     919                       "    --iso-level <0|1|2|3>\n"
     920                       "        Sets the ISO level:\n"
     921                       "            - 0: Disable primary ISO namespace.\n"
     922                       "            - 1: ISO level 1: Filenames 8.3 format and limited to 4GB - 1.\n"
     923                       "            - 2: ISO level 2: 31 char long names and limited to 4GB - 1.\n"
     924                       "            - 3: ISO level 3: 31 char long names and support for >=4GB files.\n"
     925                       "            - 4: Fictive level used by other tools. Not yet implemented.\n"
     926                       "        Default: 3\n"
     927                       "\n"
     928                       "    --rock-ridge\n"
     929                       "    --limited-rock-ridge\n"
     930                       "    --no-rock-ridge\n"
     931                       "        Enables or disables rock ridge support for the primary ISO 9660\n"
     932                       "        namespace.  The --limited-rock-ridge option omits a couple of bits in\n"
     933                       "        the root directory that would make Linux pick rock ridge over joliet.\n"
     934                       "        Default: --limited-rock-ridge"
     935                       "\n"
     936                       "    -J\n"
     937                       "    --joliet\n"
     938                       "    --no-joliet\n"
     939                       "        Enables or disable the joliet namespace.  This option must precede any\n"
     940                       "        file specifications.  Default: --joliet\n"
     941                       "\n"
     942                       "    --joliet-ucs-level <1|2|3>\n"
     943                       "    --ucs-level <1|2|3>\n"
     944                       "        Set the Joliet UCS support level.  This is currently only flagged in the\n"
     945                       "        image but not enforced on the actual path names.  Default level: 3\n"
     946                       "\n"
     947                       "\n"
     948                       "Options - File attributes:\n"
     949                       "\n"
     950                       "    --rational-attribs\n"
     951                       "        Enables rational file attribute handling:\n"
     952                       "            * Owner ID is set to zero\n"
     953                       "            * Group ID is set to zero\n"
     954                       "            * Mode is set to 0444 for non-executable files.\n"
     955                       "            * Mode is set to 0555 for executable files.\n"
     956                       "            * Mode is set to 0555 for directories, preserving stick bits.\n"
     957                       "        This is default.\n"
     958                       "\n"
     959                       "    --strict-attribs\n"
     960                       "        Counters --rational-attribs and causes attributes to be recorded\n"
     961                       "        exactly as they appear in the source.\n"
     962                       "\n"
    905963                       "    --file-mode <mode>\n"
    906964                       "    --no-file-mode\n"
    907                        "        Controls the forced file mode mask.\n"
     965                       "        Controls the forced file mode mask for rock ridge, UDF and HFS.\n"
    908966                       "\n"
    909967                       "    --dir-mode <mode>\n"
    910968                       "    --no-dir-mode\n"
    911                        "        Controls the forced directory mode mask.\n"
     969                       "        Controls the forced directory mode mask for rock ridge, UDF and HFS.\n"
    912970                       "\n"
    913971                       "    --new-dir-mode <mode>\n"
    914                        "        Controls the default mode mask for directories that are created "
    915                        "        implicitly.  The --dir-mode option overrides this.\n"
     972                       "        Controls the default mode mask (rock ridge, UDF, HFS) for directories\n"
     973                       "        that are created implicitly.  The --dir-mode option overrides this.\n"
     974                       "\n"
     975                       "    --chmod <mode>:<on-iso-file>\n"
     976                       "       Explictily sets the rock ridge, UDF and HFS file mode for a\n"
     977                       "       file/dir/whatever that has already been added to the ISO.  The mode can\n"
     978                       "       be octal, a+x, a+r, or a+rx.  (Support for more complicated mode\n"
     979                       "       specifications may be implemented at a later point.)\n"
     980                       "       Note that only namespaces in the current --name-setup are affected.\n"
     981                       "\n"
     982                       "    --chown <owner-id>:<on-iso-file>\n"
     983                       "       Explictily sets the rock ridge, UDF and HFS file owner ID (numeric) for a\n"
     984                       "       file/dir/whatever that has already been added to the ISO.\n"
     985                       "       Note that only namespaces in the current --name-setup are affected.\n"
     986                       "\n"
     987                       "    --chgrp <group-id>:<on-iso-file>\n"
     988                       "       Explictily sets the rock ridge, UDF and HFS file group ID (numeric) for a\n"
     989                       "       file/dir/whatever that has already been added to the ISO.\n"
     990                       "       Note that only namespaces in the current --name-setup are affected.\n"
    916991                       "\n"
    917992                       "\n"
     
    9261001                       "        as the El Torito boot image of the current boot entry.\n"
    9271002                       "\n"
    928                        "    -b <on-ISO-file>\n"
    929                        "    --eltorito-boot <on-ISO-file>\n"
     1003                       "    -b <on-iso-file>\n"
     1004                       "    --eltorito-boot <on-iso-file>\n"
    9301005                       "        Specifies a file on the ISO as the El Torito boot image for the current\n"
    9311006                       "        boot entry.\n"
     
    9721047                       "\n"
    9731048                       "\n"
    974                        "Options - String properties:\n"
     1049                       "Options - String properties (applied to active namespaces only):\n"
    9751050                       "\n"
    9761051                       "    --abstract <file-id>\n"
     
    10031078                       "    --volid <text>\n"
    10041079                       "    --volume-id <text>\n"
    1005                        "        Volume ID string.\n"
     1080                       "        Volume ID string (label).  (It is possible to set different labels for\n"
     1081                       "        primary ISO 9660, joliet, UDF and HFS by changing the active namespaces\n"
     1082                       "        using the --name-setup option between --volume-id occurences.)\n"
    10061083                       "\n"
    10071084                       "    --volset <text>\n"
     
    10171094                       "    --long-names\n"
    10181095                       "        Allow 31 charater filenames.  Just ensure ISO level >= 2 here.\n"
     1096                       "\n"
     1097                       "    -R\n"
     1098                       "    --rock\n"
     1099                       "        Same as --rock-ridge and --strict-attribs.\n"
     1100                       "\n"
     1101                       "    -r\n"
     1102                       "    --rational-rock\n"
     1103                       "        Same as --rock-ridge and --rational-attribs.\n"
     1104                       "\n"
    10191105                       "\n"
    10201106                       "Options - VISO specific:\n"
     
    10921178         * Do the verification.
    10931179         */
    1094         rtFsIsoMakerPrintf(pOpts, "Verifying image in random order using %zu (%#zx) byte blocks: %#zx in blocks\n",
     1180        rtFsIsoMakerPrintf(pOpts, "Verifying image in random order using %zu (%#zx) byte blocks: %#RX32 in blocks\n",
    10951181                           cbBuf, cbBuf, cBlocks);
    10961182
     
    23562442
    23572443/**
     2444 * Deals with: --iso-level, -l
     2445 *
     2446 * @returns IPRT status code
     2447 * @param   pOpts           The ISO maker command instance.
     2448 * @param   uLevel          The new ISO level.
     2449 */
     2450static int rtFsIsoMakerCmdOptSetIsoLevel(PRTFSISOMAKERCMDOPTS pOpts, uint8_t uLevel)
     2451{
     2452    int rc = RTFsIsoMakerSetIso9660Level(pOpts->hIsoMaker, uLevel);
     2453    if (RT_SUCCESS(rc))
     2454        return rc;
     2455    if (rc == VERR_WRONG_ORDER)
     2456        return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Cannot change ISO level to %d after having added files!", uLevel);
     2457    return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to set ISO level to %d: %Rrc", uLevel, rc);
     2458}
     2459
     2460
     2461/**
     2462 * Deals with: --rock-ridge, --limited-rock-ridge, --no-rock-ridge
     2463 *
     2464 * @returns IPRT status code
     2465 * @param   pOpts           The ISO maker command instance.
     2466 * @param   uLevel          The new rock ridge level.
     2467 */
     2468static int rtFsIsoMakerCmdOptSetPrimaryRockLevel(PRTFSISOMAKERCMDOPTS pOpts, uint8_t uLevel)
     2469{
     2470    int rc = RTFsIsoMakerSetRockRidgeLevel(pOpts->hIsoMaker, uLevel);
     2471    if (RT_SUCCESS(rc))
     2472        return rc;
     2473    if (rc == VERR_WRONG_ORDER)
     2474        return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Cannot change rock ridge level to %d after having added files!", uLevel);
     2475    return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to set rock ridge level to %d: %Rrc", uLevel, rc);
     2476}
     2477
     2478
     2479/**
     2480 * Deals with: --joliet, --no-joliet, --joliet-ucs-level, --ucs-level
     2481 *
     2482 * @returns IPRT status code
     2483 * @param   pOpts           The ISO maker command instance.
     2484 * @param   uLevel          The new rock ridge level.
     2485 */
     2486static int rtFsIsoMakerCmdOptSetJolietUcs2Level(PRTFSISOMAKERCMDOPTS pOpts, uint8_t uLevel)
     2487{
     2488    int rc = RTFsIsoMakerSetJolietUcs2Level(pOpts->hIsoMaker, uLevel);
     2489    if (RT_SUCCESS(rc))
     2490        return rc;
     2491    if (rc == VERR_WRONG_ORDER)
     2492        return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Cannot change joliet UCS level to %d after having added files!", uLevel);
     2493    return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to set joliet UCS level to %d: %Rrc", uLevel, rc);
     2494}
     2495
     2496
     2497/**
     2498 * Deals with: --rational-attribs, --strict-attribs, -R, -r
     2499 *
     2500 * @returns IPRT status code
     2501 * @param   pOpts           The ISO maker command instance.
     2502 * @param   uLevel          The new rock ridge level.
     2503 */
     2504static int rtFsIsoMakerCmdOptSetAttribInheritStyle(PRTFSISOMAKERCMDOPTS pOpts, bool fStrict)
     2505{
     2506    int rc = RTFsIsoMakerSetAttribInheritStyle(pOpts->hIsoMaker, fStrict);
     2507    if (RT_SUCCESS(rc))
     2508        return rc;
     2509    return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to change attributes handling style to %s: %Rrc",
     2510                                  fStrict ? "strict" : "rational", rc);
     2511}
     2512
     2513
     2514/**
    23582515 * Deals with: -G|--generic-boot {file}
    23592516 *
     
    28603017static int rtFsIsoMakerCmdOptSetStringProp(PRTFSISOMAKERCMDOPTS pOpts, const char *pszValue, RTFSISOMAKERSTRINGPROP enmStringProp)
    28613018{
    2862     int rc = RTFsIsoMakerSetStringProp(pOpts->hIsoMaker, enmStringProp, RTFSISOMAKER_NAMESPACE_ALL, pszValue);
     3019    int rc = RTFsIsoMakerSetStringProp(pOpts->hIsoMaker, enmStringProp, pOpts->fDstNamespaces, pszValue);
    28633020    if (RT_FAILURE(rc))
    28643021        rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to set string property %d to '%s': %Rrc", enmStringProp, pszValue, rc);
     
    29333090        return VINF_SUCCESS;
    29343091    return rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to set default dir mode mask to %04o: %Rrc", fMode, rc);
     3092}
     3093
     3094
     3095/**
     3096 * Handles the --chmod option.
     3097 *
     3098 * @returns IPRT status code
     3099 * @param   pOpts               The ISO maker command instance.
     3100 * @param   pszSpec             The option value.
     3101 */
     3102static int rtFsIsoMakerCmdOptChmod(PRTFSISOMAKERCMDOPTS pOpts, const char *pszSpec)
     3103{
     3104    /*
     3105     * Parse the mode part.
     3106     */
     3107    int         rc;
     3108    uint32_t    fUnset  = 07777;
     3109    uint32_t    fSet    = 0;
     3110    const char *pszPath = pszSpec;
     3111    if (RT_C_IS_DIGIT(*pszPath))
     3112    {
     3113        rc = RTStrToUInt32Ex(pszSpec, (char **)&pszPath, 8, &fSet);
     3114        if (rc != VWRN_TRAILING_CHARS)
     3115            return rtFsIsoMakerCmdSyntaxError(pOpts, "Malformed --chmod, octal mode parse failed: %s (%Rrc)", pszSpec, rc);
     3116        if (fSet & ~07777)
     3117            return rtFsIsoMakerCmdSyntaxError(pOpts, "Malformed --chmod, invalid mode mask: 0%o, max 07777", fSet);
     3118        if (*pszPath != ':')
     3119            return rtFsIsoMakerCmdSyntaxError(pOpts, "Malformed --chmod, expected colon after mode: %s", pszSpec);
     3120    }
     3121    else
     3122    {
     3123        pszPath = strchr(pszPath, ':');
     3124        if (pszPath == NULL)
     3125            return rtFsIsoMakerCmdSyntaxError(pOpts, "Malformed --chmod, expected colon after mode: %s", pszSpec);
     3126        size_t const cchMode = pszPath - pszSpec;
     3127
     3128        /* We currently only matches certain patterns. Later this needs to be generalized into a RTFile or RTPath method. */
     3129        fUnset = 0;
     3130#define MATCH_MODE_STR(a_szMode)  (cchMode == sizeof(a_szMode) - 1U && memcmp(pszSpec, a_szMode, sizeof(a_szMode) - 1) == 0)
     3131        if (MATCH_MODE_STR("a+x"))
     3132            fSet = 0111;
     3133        else if (MATCH_MODE_STR("a+r"))
     3134            fSet = 0444;
     3135        else if (MATCH_MODE_STR("a+rx"))
     3136            fSet = 0555;
     3137        else
     3138            return rtFsIsoMakerCmdSyntaxError(pOpts, "Sorry, --chmod doesn't understand complicated mode expressions: %s", pszSpec);
     3139#undef MATCH_MODE_STR
     3140    }
     3141
     3142    /*
     3143     * Check that the file starts with a slash.
     3144     */
     3145    pszPath++;
     3146    if (!RTPATH_IS_SLASH(*pszPath))
     3147        return rtFsIsoMakerCmdSyntaxError(pOpts, "Malformed --chmod, path must start with a slash: %s", pszSpec);
     3148
     3149    /*
     3150     * Do the job.
     3151     */
     3152    rc = RTFsIsoMakerSetPathMode(pOpts->hIsoMaker, pszPath, pOpts->fDstNamespaces, fSet, fUnset, 0 /*fFlags*/, NULL /*pcHits*/);
     3153    if (rc == VWRN_NOT_FOUND)
     3154        return rtFsIsoMakerCmdSyntaxError(pOpts, "Could not find --chmod path: %s", pszPath);
     3155    if (RT_SUCCESS(rc))
     3156        return VINF_SUCCESS;
     3157    return rtFsIsoMakerCmdSyntaxError(pOpts, "RTFsIsoMakerSetPathMode(,%s,%#x,%o,%o,0,) failed: %Rrc",
     3158                                      pszPath, pOpts->fDstNamespaces, fSet, fUnset, rc);
     3159}
     3160
     3161
     3162/**
     3163 * Handles the --chown and --chgrp options.
     3164 *
     3165 * @returns IPRT status code
     3166 * @param   pOpts               The ISO maker command instance.
     3167 * @param   pszSpec             The option value.
     3168 * @param   fIsChOwn            Set if 'chown', clear if 'chgrp'.
     3169 */
     3170static int rtFsIsoMakerCmdOptChangeOwnerGroup(PRTFSISOMAKERCMDOPTS pOpts, const char *pszSpec, bool fIsChOwn)
     3171{
     3172    const char * const pszOpt = fIsChOwn ? "chown" : "chgrp";
     3173
     3174    /*
     3175     * Parse out the ID and path .
     3176     */
     3177    uint32_t    idValue;
     3178    const char *pszPath = pszSpec;
     3179    int rc = RTStrToUInt32Ex(pszSpec, (char **)&pszPath, 0, &idValue);
     3180    if (rc != VWRN_TRAILING_CHARS)
     3181        return rtFsIsoMakerCmdSyntaxError(pOpts, "Malformed --%s, numeric ID parse failed: %s (%Rrc)", pszOpt, pszSpec, rc);
     3182    if (*pszPath != ':')
     3183        return rtFsIsoMakerCmdSyntaxError(pOpts, "Malformed --%s, expected colon after ID: %s", pszOpt, pszSpec);
     3184    pszPath++;
     3185    if (!RTPATH_IS_SLASH(*pszPath))
     3186        return rtFsIsoMakerCmdSyntaxError(pOpts, "Malformed --%s, path must start with a slash: %s", pszOpt, pszSpec);
     3187
     3188    /*
     3189     * Do the job.
     3190     */
     3191    if (fIsChOwn)
     3192        rc = RTFsIsoMakerSetPathOwnerId(pOpts->hIsoMaker, pszPath, pOpts->fDstNamespaces, idValue, NULL /*pcHits*/);
     3193    else
     3194        rc = RTFsIsoMakerSetPathGroupId(pOpts->hIsoMaker, pszPath, pOpts->fDstNamespaces, idValue, NULL /*pcHits*/);
     3195    if (rc == VWRN_NOT_FOUND)
     3196        return rtFsIsoMakerCmdSyntaxError(pOpts, "Could not find --%s path: %s", pszOpt, pszPath);
     3197    if (RT_SUCCESS(rc))
     3198        return VINF_SUCCESS;
     3199    return rtFsIsoMakerCmdSyntaxError(pOpts, "RTFsIsoMakerSetPath%sId(,%s,%#x,%u,) failed: %Rrc",
     3200                                      fIsChOwn ? "Owner" : "Group", pszPath, pOpts->fDstNamespaces, idValue, rc);
    29353201}
    29363202
     
    30573323                break;
    30583324
     3325
    30593326            /*
    3060              * Options specific to our ISO maker.
    3061              */
    3062             case RTFSISOMAKERCMD_OPT_NAME_SETUP:
    3063                 rc = rtFsIsoMakerCmdOptNameSetup(pOpts, ValueUnion.psz);
    3064                 break;
    3065 
    3066             case RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER:
    3067                 /* ignored */
    3068                 break;
    3069 
    3070             case RTFSISOMAKERCMD_OPT_OUTPUT_BUFFER_SIZE:                /* --output-buffer-size {cb} */
    3071                 pOpts->cbOutputReadBuffer = ValueUnion.u32;
    3072                 break;
    3073 
    3074             case RTFSISOMAKERCMD_OPT_RANDOM_OUTPUT_BUFFER_SIZE:         /* --random-output-buffer-size */
    3075                 pOpts->fRandomOutputReadBufferSize = true;
    3076                 break;
    3077 
    3078             case RTFSISOMAKERCMD_OPT_RANDOM_ORDER_VERIFICATION:         /* --random-order-verficiation {cb} */
    3079                 pOpts->cbRandomOrderVerifciationBlock = ValueUnion.u32;
    3080                 break;
    3081 
    3082             case RTFSISOMAKERCMD_OPT_PUSH_ISO:
    3083                 rc = rtFsIsoMakerCmdOptPushIso(pOpts, ValueUnion.psz, "--push-iso", 0);
    3084                 break;
    3085 
    3086             case RTFSISOMAKERCMD_OPT_PUSH_ISO_NO_JOLIET:
    3087                 rc = rtFsIsoMakerCmdOptPushIso(pOpts, ValueUnion.psz, "--push-iso-no-joliet", RTFSISO9660_F_NO_JOLIET);
    3088                 break;
    3089 
    3090             case RTFSISOMAKERCMD_OPT_PUSH_ISO_NO_ROCK:
    3091                 rc = rtFsIsoMakerCmdOptPushIso(pOpts, ValueUnion.psz, "--push-iso-no-rock", RTFSISO9660_F_NO_ROCK);
    3092                 break;
    3093 
    3094             case RTFSISOMAKERCMD_OPT_PUSH_ISO_NO_ROCK_NO_JOLIET:
    3095                 rc = rtFsIsoMakerCmdOptPushIso(pOpts, ValueUnion.psz, "--push-iso-no-rock-no-joliet",
    3096                                                RTFSISO9660_F_NO_ROCK | RTFSISO9660_F_NO_JOLIET);
    3097                 break;
    3098 
    3099             case RTFSISOMAKERCMD_OPT_POP:
    3100                 rc = rtFsIsoMakerCmdOptPop(pOpts);
    3101                 break;
    3102 
    3103 
    3104             case RTFSISOMAKERCMD_OPT_IMPORT_ISO:
    3105                 rc = rtFsIsoMakerCmdOptImportIso(pOpts, ValueUnion.psz);
    3106                 break;
    3107 
    3108             case RTFSISOMAKERCMD_OPT_NO_FILE_MODE:
    3109                 rc = rtFsIsoMakerCmdOptDisableFileOrDirMode(pOpts, false /*fDir*/);
    3110                 break;
    3111             case RTFSISOMAKERCMD_OPT_NO_DIR_MODE:
    3112                 rc = rtFsIsoMakerCmdOptDisableFileOrDirMode(pOpts, true /*fDir*/);
    3113                 break;
    3114 
    3115 
    3116             /*
    3117              * Joliet related options.
    3118              */
    3119             case RTFSISOMAKERCMD_OPT_NO_JOLIET:
    3120                 rc = RTFsIsoMakerSetJolietUcs2Level(pOpts->hIsoMaker, 0);
    3121                 if (RT_FAILURE(rc))
    3122                     rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to disable joliet: %Rrc", rc);
    3123                 break;
    3124 
    3125 
    3126             /*
    3127              * Boot related options.
    3128              */
    3129             case 'G': /* --generic-boot <file> */
    3130                 rc = rtFsIsoMakerCmdOptGenericBoot(pOpts, ValueUnion.psz);
    3131                 break;
    3132 
    3133             case RTFSISOMAKERCMD_OPT_ELTORITO_ADD_IMAGE:
    3134                 rc = rtFsIsoMakerCmdOptEltoritoAddImage(pOpts, ValueUnion.psz);
    3135                 break;
    3136 
    3137             case 'b': /* --eltorito-boot <boot.img> */
    3138                 rc = rtFsIsoMakerCmdOptEltoritoBoot(pOpts, ValueUnion.psz);
    3139                 break;
    3140 
    3141             case RTFSISOMAKERCMD_OPT_ELTORITO_NEW_ENTRY:
    3142                 rc = rtFsIsoMakerCmdOptEltoritoNewEntry(pOpts);
    3143                 break;
    3144 
    3145             case RTFSISOMAKERCMD_OPT_ELTORITO_PLATFORM_ID:
    3146                 rc = rtFsIsoMakerCmdOptEltoritoPlatformId(pOpts, ValueUnion.psz);
    3147                 break;
    3148 
    3149             case RTFSISOMAKERCMD_OPT_ELTORITO_NO_BOOT:
    3150                 rc = rtFsIsoMakerCmdOptEltoritoSetNotBootable(pOpts);
    3151                 break;
    3152 
    3153             case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_12:
    3154                 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_1_2_MB);
    3155                 break;
    3156             case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_144:
    3157                 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_1_44_MB);
    3158                 break;
    3159             case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_288:
    3160                 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_2_88_MB);
    3161                 break;
    3162             case RTFSISOMAKERCMD_OPT_ELTORITO_HARD_DISK_BOOT:
    3163                 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_HARD_DISK);
    3164                 break;
    3165             case RTFSISOMAKERCMD_OPT_ELTORITO_NO_EMULATION_BOOT:
    3166                 rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_NO_EMULATION);
    3167                 break;
    3168 
    3169             case RTFSISOMAKERCMD_OPT_ELTORITO_LOAD_SEG:
    3170                 rc = rtFsIsoMakerCmdOptEltoritoSetLoadSegment(pOpts, ValueUnion.u16);
    3171                 break;
    3172 
    3173             case RTFSISOMAKERCMD_OPT_ELTORITO_LOAD_SIZE:
    3174                 rc = rtFsIsoMakerCmdOptEltoritoSetLoadSectorCount(pOpts, ValueUnion.u16);
    3175                 break;
    3176 
    3177             case RTFSISOMAKERCMD_OPT_ELTORITO_INFO_TABLE:
    3178                 rc = rtFsIsoMakerCmdOptEltoritoEnableBootInfoTablePatching(pOpts);
    3179                 break;
    3180 
    3181             case 'c': /* --boot-catalog <cd-path> */
    3182                 rc = rtFsIsoMakerCmdOptEltoritoSetBootCatalogPath(pOpts, ValueUnion.psz);
    3183                 break;
    3184 
    3185             /*
    3186              * Image/namespace property related options.
    3187              */
    3188             case RTFSISOMAKERCMD_OPT_ABSTRACT_FILE_ID:
    3189                 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_ABSTRACT_FILE_ID);
    3190                 break;
    3191 
    3192             case 'A': /* --application-id */
    3193                 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_APPLICATION_ID);
    3194                 break;
    3195 
    3196             case RTFSISOMAKERCMD_OPT_BIBLIOGRAPHIC_FILE_ID:
    3197                 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_BIBLIOGRAPHIC_FILE_ID);
    3198                 break;
    3199 
    3200             case RTFSISOMAKERCMD_OPT_COPYRIGHT_FILE_ID:
    3201                 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_COPYRIGHT_FILE_ID);
    3202                 break;
    3203 
    3204             case 'P': /* -publisher */
    3205                 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_PUBLISHER_ID);
    3206                 break;
    3207 
    3208             case 'p': /* --preparer*/
    3209                 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_DATA_PREPARER_ID);
    3210                 break;
    3211 
    3212             case RTFSISOMAKERCMD_OPT_SYSTEM_ID:
    3213                 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_SYSTEM_ID);
    3214                 break;
    3215 
    3216             case RTFSISOMAKERCMD_OPT_VOLUME_ID: /* (should've been '-V') */
    3217                 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_VOLUME_ID);
    3218                 break;
    3219 
    3220             case RTFSISOMAKERCMD_OPT_VOLUME_SET_ID:
    3221                 rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_VOLUME_SET_ID);
    3222                 break;
    3223 
    3224             /*
    3225              * Options compatible with other ISO makers.
     3327             * General options
    32263328             */
    32273329            case 'o':
     
    32333335                break;
    32343336
     3337            case RTFSISOMAKERCMD_OPT_NAME_SETUP:
     3338                rc = rtFsIsoMakerCmdOptNameSetup(pOpts, ValueUnion.psz);
     3339                break;
     3340
     3341            case RTFSISOMAKERCMD_OPT_PUSH_ISO:
     3342                rc = rtFsIsoMakerCmdOptPushIso(pOpts, ValueUnion.psz, "--push-iso", 0);
     3343                break;
     3344
     3345            case RTFSISOMAKERCMD_OPT_PUSH_ISO_NO_JOLIET:
     3346                rc = rtFsIsoMakerCmdOptPushIso(pOpts, ValueUnion.psz, "--push-iso-no-joliet", RTFSISO9660_F_NO_JOLIET);
     3347                break;
     3348
     3349            case RTFSISOMAKERCMD_OPT_PUSH_ISO_NO_ROCK:
     3350                rc = rtFsIsoMakerCmdOptPushIso(pOpts, ValueUnion.psz, "--push-iso-no-rock", RTFSISO9660_F_NO_ROCK);
     3351                break;
     3352
     3353            case RTFSISOMAKERCMD_OPT_PUSH_ISO_NO_ROCK_NO_JOLIET:
     3354                rc = rtFsIsoMakerCmdOptPushIso(pOpts, ValueUnion.psz, "--push-iso-no-rock-no-joliet",
     3355                                               RTFSISO9660_F_NO_ROCK | RTFSISO9660_F_NO_JOLIET);
     3356                break;
     3357
     3358            case RTFSISOMAKERCMD_OPT_POP:
     3359                rc = rtFsIsoMakerCmdOptPop(pOpts);
     3360                break;
     3361
     3362            case RTFSISOMAKERCMD_OPT_IMPORT_ISO:
     3363                rc = rtFsIsoMakerCmdOptImportIso(pOpts, ValueUnion.psz);
     3364                break;
     3365
     3366
     3367            /*
     3368             * Namespace configuration.
     3369             */
     3370            case RTFSISOMAKERCMD_OPT_ISO_LEVEL:
     3371                rc = rtFsIsoMakerCmdOptSetIsoLevel(pOpts, ValueUnion.u8);
     3372                break;
     3373
     3374            case RTFSISOMAKERCMD_OPT_ROCK_RIDGE:
     3375                rc = rtFsIsoMakerCmdOptSetPrimaryRockLevel(pOpts, 2);
     3376                break;
     3377
     3378            case RTFSISOMAKERCMD_OPT_LIMITED_ROCK_RIDGE:
     3379                rc = rtFsIsoMakerCmdOptSetPrimaryRockLevel(pOpts, 1);
     3380                break;
     3381
     3382            case RTFSISOMAKERCMD_OPT_NO_ROCK_RIDGE:
     3383                rc = rtFsIsoMakerCmdOptSetPrimaryRockLevel(pOpts, 0);
     3384                break;
     3385
     3386            case 'J':
     3387                rc = rtFsIsoMakerCmdOptSetJolietUcs2Level(pOpts, 3);
     3388                break;
     3389
     3390            case RTFSISOMAKERCMD_OPT_NO_JOLIET:
     3391                rc = rtFsIsoMakerCmdOptSetJolietUcs2Level(pOpts, 0);
     3392                break;
     3393
     3394            case RTFSISOMAKERCMD_OPT_JOLIET_LEVEL:
     3395                rc = rtFsIsoMakerCmdOptSetJolietUcs2Level(pOpts, ValueUnion.u8);
     3396                break;
     3397
     3398
     3399            /*
     3400             * File attributes.
     3401             */
     3402            case RTFSISOMAKERCMD_OPT_RATIONAL_ATTRIBS:
     3403                rc = rtFsIsoMakerCmdOptSetAttribInheritStyle(pOpts, false /*fStrict*/);
     3404                break;
     3405
     3406            case RTFSISOMAKERCMD_OPT_STRICT_ATTRIBS:
     3407                rc = rtFsIsoMakerCmdOptSetAttribInheritStyle(pOpts, true /*fStrict*/);
     3408                break;
     3409
     3410            case RTFSISOMAKERCMD_OPT_FILE_MODE:
     3411                rc = rtFsIsoMakerCmdOptSetFileOrDirMode(pOpts, false /*fDir*/, ValueUnion.u32);
     3412                break;
     3413
     3414            case RTFSISOMAKERCMD_OPT_NO_FILE_MODE:
     3415                rc = rtFsIsoMakerCmdOptDisableFileOrDirMode(pOpts, false /*fDir*/);
     3416                break;
     3417
    32353418            case RTFSISOMAKERCMD_OPT_DIR_MODE:
    32363419                rc = rtFsIsoMakerCmdOptSetFileOrDirMode(pOpts, true /*fDir*/, ValueUnion.u32);
    32373420                break;
    32383421
    3239             case RTFSISOMAKERCMD_OPT_FILE_MODE:
    3240                 rc = rtFsIsoMakerCmdOptSetFileOrDirMode(pOpts, false /*fDir*/, ValueUnion.u32);
     3422            case RTFSISOMAKERCMD_OPT_NO_DIR_MODE:
     3423                rc = rtFsIsoMakerCmdOptDisableFileOrDirMode(pOpts, true /*fDir*/);
    32413424                break;
    32423425
     
    32453428                break;
    32463429
     3430            case RTFSISOMAKERCMD_OPT_CHMOD:
     3431                rc = rtFsIsoMakerCmdOptChmod(pOpts, ValueUnion.psz);
     3432                break;
     3433
     3434            case RTFSISOMAKERCMD_OPT_CHOWN:
     3435                rc = rtFsIsoMakerCmdOptChangeOwnerGroup(pOpts, ValueUnion.psz, true  /*fIsChOwn*/);
     3436                break;
     3437
     3438            case RTFSISOMAKERCMD_OPT_CHGRP:
     3439                rc = rtFsIsoMakerCmdOptChangeOwnerGroup(pOpts, ValueUnion.psz, false /*fIsChOwn*/);
     3440                break;
     3441
     3442
     3443            /*
     3444             * Boot related options.
     3445             */
     3446            case 'G': /* --generic-boot <file> */
     3447                rc = rtFsIsoMakerCmdOptGenericBoot(pOpts, ValueUnion.psz);
     3448                break;
     3449
     3450            case RTFSISOMAKERCMD_OPT_ELTORITO_ADD_IMAGE:
     3451                rc = rtFsIsoMakerCmdOptEltoritoAddImage(pOpts, ValueUnion.psz);
     3452                break;
     3453
     3454            case 'b': /* --eltorito-boot <boot.img> */
     3455                rc = rtFsIsoMakerCmdOptEltoritoBoot(pOpts, ValueUnion.psz);
     3456                break;
     3457
     3458            case RTFSISOMAKERCMD_OPT_ELTORITO_NEW_ENTRY:
     3459                rc = rtFsIsoMakerCmdOptEltoritoNewEntry(pOpts);
     3460                break;
     3461
     3462            case RTFSISOMAKERCMD_OPT_ELTORITO_PLATFORM_ID:
     3463                rc = rtFsIsoMakerCmdOptEltoritoPlatformId(pOpts, ValueUnion.psz);
     3464                break;
     3465
     3466            case RTFSISOMAKERCMD_OPT_ELTORITO_NO_BOOT:
     3467                rc = rtFsIsoMakerCmdOptEltoritoSetNotBootable(pOpts);
     3468                break;
     3469
     3470            case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_12:
     3471                rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_1_2_MB);
     3472                break;
     3473            case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_144:
     3474                rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_1_44_MB);
     3475                break;
     3476            case RTFSISOMAKERCMD_OPT_ELTORITO_FLOPPY_288:
     3477                rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_FLOPPY_2_88_MB);
     3478                break;
     3479            case RTFSISOMAKERCMD_OPT_ELTORITO_HARD_DISK_BOOT:
     3480                rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_HARD_DISK);
     3481                break;
     3482            case RTFSISOMAKERCMD_OPT_ELTORITO_NO_EMULATION_BOOT:
     3483                rc = rtFsIsoMakerCmdOptEltoritoSetMediaType(pOpts, ISO9660_ELTORITO_BOOT_MEDIA_TYPE_NO_EMULATION);
     3484                break;
     3485
     3486            case RTFSISOMAKERCMD_OPT_ELTORITO_LOAD_SEG:
     3487                rc = rtFsIsoMakerCmdOptEltoritoSetLoadSegment(pOpts, ValueUnion.u16);
     3488                break;
     3489
     3490            case RTFSISOMAKERCMD_OPT_ELTORITO_LOAD_SIZE:
     3491                rc = rtFsIsoMakerCmdOptEltoritoSetLoadSectorCount(pOpts, ValueUnion.u16);
     3492                break;
     3493
     3494            case RTFSISOMAKERCMD_OPT_ELTORITO_INFO_TABLE:
     3495                rc = rtFsIsoMakerCmdOptEltoritoEnableBootInfoTablePatching(pOpts);
     3496                break;
     3497
     3498            case 'c': /* --boot-catalog <cd-path> */
     3499                rc = rtFsIsoMakerCmdOptEltoritoSetBootCatalogPath(pOpts, ValueUnion.psz);
     3500                break;
     3501
     3502
     3503            /*
     3504             * Image/namespace property related options.
     3505             */
     3506            case RTFSISOMAKERCMD_OPT_ABSTRACT_FILE_ID:
     3507                rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_ABSTRACT_FILE_ID);
     3508                break;
     3509
     3510            case 'A': /* --application-id */
     3511                rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_APPLICATION_ID);
     3512                break;
     3513
     3514            case RTFSISOMAKERCMD_OPT_BIBLIOGRAPHIC_FILE_ID:
     3515                rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_BIBLIOGRAPHIC_FILE_ID);
     3516                break;
     3517
     3518            case RTFSISOMAKERCMD_OPT_COPYRIGHT_FILE_ID:
     3519                rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_COPYRIGHT_FILE_ID);
     3520                break;
     3521
     3522            case 'P': /* -publisher */
     3523                rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_PUBLISHER_ID);
     3524                break;
     3525
     3526            case 'p': /* --preparer*/
     3527                rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_DATA_PREPARER_ID);
     3528                break;
     3529
     3530            case RTFSISOMAKERCMD_OPT_SYSTEM_ID:
     3531                rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_SYSTEM_ID);
     3532                break;
     3533
     3534            case RTFSISOMAKERCMD_OPT_VOLUME_ID: /* (should've been '-V') */
     3535                rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_VOLUME_ID);
     3536                break;
     3537
     3538            case RTFSISOMAKERCMD_OPT_VOLUME_SET_ID:
     3539                rc = rtFsIsoMakerCmdOptSetStringProp(pOpts, ValueUnion.psz, RTFSISOMAKERSTRINGPROP_VOLUME_SET_ID);
     3540                break;
     3541
     3542
     3543            /*
     3544             * Compatibility.
     3545             */
    32473546            case RTFSISOMAKERCMD_OPT_GRAFT_POINTS:
    32483547                rc = rtFsIsoMakerCmdOptNameSetup(pOpts, "iso+joliet+udf+hfs");
     
    32513550            case 'l':
    32523551                if (RTFsIsoMakerGetIso9660Level(pOpts->hIsoMaker) >= 2)
    3253                     break;
    3254                 ValueUnion.u8 = 2;
    3255                 /* fall thru */
    3256             case RTFSISOMAKERCMD_OPT_ISO_LEVEL:
    3257                 rc = RTFsIsoMakerSetIso9660Level(pOpts->hIsoMaker, ValueUnion.u8);
     3552                    rc = rtFsIsoMakerCmdOptSetIsoLevel(pOpts, 2);
     3553                break;
     3554
     3555            case 'R':
     3556                rc = rtFsIsoMakerCmdOptSetPrimaryRockLevel(pOpts, 2);
     3557                if (RT_SUCCESS(rc))
     3558                    rc = rtFsIsoMakerCmdOptSetAttribInheritStyle(pOpts, true /*fStrict*/);
     3559                break;
     3560
     3561            case 'r':
     3562                rc = rtFsIsoMakerCmdOptSetPrimaryRockLevel(pOpts, 2);
     3563                if (RT_SUCCESS(rc))
     3564                    rc = rtFsIsoMakerCmdOptSetAttribInheritStyle(pOpts, false /*fStrict*/);
     3565                break;
     3566
     3567            case RTFSISOMAKERCMD_OPT_PAD:
     3568                rc = RTFsIsoMakerSetImagePadding(pOpts->hIsoMaker, 150);
    32583569                if (RT_FAILURE(rc))
    3259                     rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "Failed to set ISO level to %d: %Rrc", ValueUnion.u8, rc);
     3570                    rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "RTFsIsoMakerSetImagePadding failed: %Rrc", rc);
     3571                break;
     3572
     3573            case RTFSISOMAKERCMD_OPT_NO_PAD:
     3574                rc = RTFsIsoMakerSetImagePadding(pOpts->hIsoMaker, 0);
     3575                if (RT_FAILURE(rc))
     3576                    rc = rtFsIsoMakerCmdErrorRc(pOpts, rc, "RTFsIsoMakerSetImagePadding failed: %Rrc", rc);
     3577                break;
     3578
     3579
     3580            /*
     3581             * VISO specific
     3582             */
     3583            case RTFSISOMAKERCMD_OPT_IPRT_ISO_MAKER_FILE_MARKER:
     3584                /* ignored */
     3585                break;
     3586
     3587
     3588            /*
     3589             * Testing.
     3590             */
     3591            case RTFSISOMAKERCMD_OPT_OUTPUT_BUFFER_SIZE:                /* --output-buffer-size {cb} */
     3592                pOpts->cbOutputReadBuffer = ValueUnion.u32;
     3593                break;
     3594
     3595            case RTFSISOMAKERCMD_OPT_RANDOM_OUTPUT_BUFFER_SIZE:         /* --random-output-buffer-size */
     3596                pOpts->fRandomOutputReadBufferSize = true;
     3597                break;
     3598
     3599            case RTFSISOMAKERCMD_OPT_RANDOM_ORDER_VERIFICATION:         /* --random-order-verficiation {cb} */
     3600                pOpts->cbRandomOrderVerifciationBlock = ValueUnion.u32;
    32603601                break;
    32613602
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