VirtualBox

Changeset 102116 in vbox for trunk/src/VBox/Main/src-server


Ignore:
Timestamp:
Nov 15, 2023 7:41:58 PM (15 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
160237
Message:

Main/Unattended: added user payload to unattended. bugref:10446

Location:
trunk/src/VBox/Main/src-server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/UnattendedImpl.cpp

    r101683 r102116  
    318318        mfInstallGuestAdditions     = false;
    319319        mfInstallTestExecService    = false;
     320        mfInstallUserPayload        = false;
    320321        midxImage                   = 1;
    321322
     
    25702571        return setErrorBoth(E_FAIL, VERR_FILE_NOT_FOUND, tr("Could not locate the validation kit ISO file '%s'"),
    25712572                            mStrValidationKitIsoPath.c_str());
     2573    if (mfInstallUserPayload && !RTFileExists(mStrUserPayloadIsoPath.c_str()))
     2574        return setErrorBoth(E_FAIL, VERR_FILE_NOT_FOUND, tr("Could not locate the User Payload ISO file '%s'"),
     2575                            mStrUserPayloadIsoPath.c_str());
    25722576    if (mStrScriptTemplatePath.isNotEmpty() && !RTFileExists(mStrScriptTemplatePath.c_str()))
    25732577        return setErrorBoth(E_FAIL, VERR_FILE_NOT_FOUND, tr("Could not locate unattended installation script template '%s'"),
     
    35223526    AssertReturn(mpInstaller == NULL, setErrorBoth(E_FAIL, VERR_WRONG_ORDER, tr("Cannot change after prepare() has been called")));
    35233527    mfInstallTestExecService = aInstallTestExecService != FALSE;
     3528    return S_OK;
     3529}
     3530
     3531HRESULT Unattended::getUserPayloadIsoPath(com::Utf8Str &aUserPayloadIsoPath)
     3532{
     3533    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     3534    aUserPayloadIsoPath = mStrUserPayloadIsoPath;
     3535    return S_OK;
     3536}
     3537
     3538HRESULT Unattended::setUserPayloadIsoPath(const com::Utf8Str &aUserPayloadIsoPath)
     3539{
     3540    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     3541    AssertReturn(mpInstaller == NULL, setErrorBoth(E_FAIL, VERR_WRONG_ORDER, tr("Cannot change after prepare() has been called")));
     3542    mStrUserPayloadIsoPath = aUserPayloadIsoPath;
     3543    return S_OK;
     3544}
     3545
     3546HRESULT Unattended::getInstallUserPayload(BOOL *aInstallUserPayload)
     3547{
     3548    AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
     3549    *aInstallUserPayload = mfInstallUserPayload;
     3550    return S_OK;
     3551}
     3552
     3553HRESULT Unattended::setInstallUserPayload(BOOL aInstallUserPayload)
     3554{
     3555    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     3556    AssertReturn(mpInstaller == NULL, setErrorBoth(E_FAIL, VERR_WRONG_ORDER, tr("Cannot change after prepare() has been called")));
     3557    mfInstallUserPayload = aInstallUserPayload != FALSE;
    35243558    return S_OK;
    35253559}
     
    40984132}
    40994133
     4134Utf8Str const &Unattended::i_getUserPayloadIsoPath() const
     4135{
     4136    Assert(isReadLockedOnCurrentThread());
     4137    return mStrUserPayloadIsoPath;
     4138}
     4139
     4140bool           Unattended::i_getInstallUserPayload() const
     4141{
     4142    Assert(isReadLockedOnCurrentThread());
     4143    return mfInstallUserPayload;
     4144}
     4145
    41004146Utf8Str const &Unattended::i_getTimeZone() const
    41014147{
  • trunk/src/VBox/Main/src-server/UnattendedInstaller.cpp

    r101697 r102116  
    256256bool UnattendedInstaller::isAuxiliaryIsoNeeded() const
    257257{
    258     /* In the VISO case we use the AUX ISO for GAs and TXS. */
     258    /* In the VISO case we use the AUX ISO for GAs, TXS, and User Payloads. */
    259259    return isAuxiliaryIsoIsVISO()
    260260        && (   mpParent->i_getInstallGuestAdditions()
    261             || mpParent->i_getInstallTestExecService());
     261            || mpParent->i_getInstallTestExecService()
     262            || mpParent->i_getInstallUserPayload());
    262263}
    263264
     
    755756                rVecArgs.append().append("--push-iso=").append(mpParent->i_getValidationKitIsoPath());
    756757                rVecArgs.append() = "/vboxvalidationkit=/";
     758                rVecArgs.append() = "--pop";
     759            }
     760
     761            /*
     762             * If we've got a User Payload ISO, add its content to a /vboxuserpayload dir.
     763             */
     764            if (mpParent->i_getInstallUserPayload())
     765            {
     766                rVecArgs.append().append("--push-iso=").append(mpParent->i_getUserPayloadIsoPath());
     767                rVecArgs.append() = "/vboxuserpayload=/";
    757768                rVecArgs.append() = "--pop";
    758769            }
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