VirtualBox

Changeset 102116 in vbox


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
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/idl/VirtualBox.xidl

    r102113 r102116  
    49624962  <interface
    49634963    name="IUnattended" extends="$unknown"
    4964     uuid="6f89464f-7773-436a-a4df-592e4e537fa0"
     4964    uuid="d1833215-78c9-4b42-9c2a-f44ef7b2d01f"
    49654965    wsmap="managed"
    49664966    rest="managed"
     
    50695069        The TXS binary will be taken from the ISO indicated by
    50705070        <link to="IUnattended::validationKitIsoPath"/>.
     5071      </desc>
     5072    </attribute>
     5073
     5074    <attribute name="userPayloadIsoPath" type="wstring">
     5075      <desc>
     5076        User Payload ISO image path.  This is used when
     5077        <link to="IUnattended::installUserPayload"/> is set to true.
     5078      </desc>
     5079    </attribute>
     5080
     5081    <attribute name="installUserPayload" type="boolean">
     5082      <desc>
     5083        Indicates whether the User Payload should be installed or not.
     5084
     5085        The User Payload will be taken from the ISO indicated by
     5086        <link to="IUnattended::userPayloadIsoPath"/>.
    50715087      </desc>
    50725088    </attribute>
  • trunk/src/VBox/Main/include/UnattendedImpl.h

    r101683 r102116  
    8989    Utf8Str const &i_getValidationKitIsoPath() const;
    9090    bool           i_getInstallTestExecService() const;
     91    Utf8Str const &i_getUserPayloadIsoPath() const;
     92    bool           i_getInstallUserPayload() const;
    9193    Utf8Str const &i_getTimeZone() const;
    9294    PCRTTIMEZONEINFO i_getTimeZoneInfo() const;
     
    135137    bool            mfInstallTestExecService;
    136138    Utf8Str         mStrValidationKitIsoPath;
     139    Utf8Str         mStrUserPayloadIsoPath;
     140    bool            mfInstallUserPayload;
    137141    Utf8Str         mStrTimeZone;
    138142    PCRTTIMEZONEINFO mpTimeZoneInfo;
     
    209213    HRESULT getInstallTestExecService(BOOL *aInstallTestExecService);
    210214    HRESULT setInstallTestExecService(BOOL aInstallTestExecService);
     215    HRESULT getUserPayloadIsoPath(com::Utf8Str &aUserPayloadIsoPath);
     216    HRESULT setUserPayloadIsoPath(const com::Utf8Str &aUserPayloadIsoPath);
     217    HRESULT getInstallUserPayload(BOOL *aInstallUserPayload);
     218    HRESULT setInstallUserPayload(BOOL aInstallUserPayload);
    211219    HRESULT getTimeZone(com::Utf8Str &aTimezone);
    212220    HRESULT setTimeZone(const com::Utf8Str &aTimezone);
  • trunk/src/VBox/Main/include/UnattendedInstaller.h

    r101695 r102116  
    342342     *
    343343     * The base class implementation adds the script from mAlg, additions ISO
    344      * content to '/vboxadditions', and validation kit ISO to '/vboxvalidationkit'.
     344     * content to '/vboxadditions', validation kit ISO to '/vboxvalidationkit',
     345     * and user payload ISO to '/vboxuserpayload'.
    345346     *
    346347     * @returns COM status code.
  • 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            }
  • trunk/src/VBox/Main/testcase/tstUnattendedScript.cpp

    r101683 r102116  
    250250}
    251251
     252HRESULT Unattended::getUserPayloadIsoPath(com::Utf8Str &userPayloadIsoPath)
     253{
     254    RT_NOREF(userPayloadIsoPath);
     255    return E_NOTIMPL;
     256}
     257
     258HRESULT Unattended::setUserPayloadIsoPath(const com::Utf8Str &userPayloadIsoPath)
     259{
     260    RT_NOREF(userPayloadIsoPath);
     261    return E_NOTIMPL;
     262}
     263
     264HRESULT Unattended::getInstallUserPayload(BOOL *installUserPayload)
     265{
     266    RT_NOREF(installUserPayload);
     267    return E_NOTIMPL;
     268}
     269
     270HRESULT Unattended::setInstallUserPayload(BOOL installUserPayload)
     271{
     272    RT_NOREF(installUserPayload);
     273    return E_NOTIMPL;
     274}
     275
    252276HRESULT Unattended::getTimeZone(com::Utf8Str &aTimeZone)
    253277{
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