VirtualBox

Changeset 77774 in vbox


Ignore:
Timestamp:
Mar 19, 2019 12:59:41 AM (6 years ago)
Author:
vboxsync
Message:

Main: Some unattended ubuntu 4.10 installation hacking (unsuccessful).

File:
1 edited

Legend:

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

    r76553 r77774  
    913913//////////////////////////////////////////////////////////////////////////////////////////////////////
    914914
     915/**
     916 * Helper for checking if a file exists.
     917 * @todo promote to IPRT?
     918 */
     919static bool hlpVfsFileExists(RTVFS hVfs, const char *pszPath)
     920{
     921    RTFSOBJINFO ObjInfo;
     922    int vrc = RTVfsQueryPathInfo(hVfs, pszPath, &ObjInfo, RTFSOBJATTRADD_NOTHING, RTPATH_F_FOLLOW_LINK);
     923    return RT_SUCCESS(vrc) && RTFS_IS_FILE(ObjInfo.Attr.fMode);
     924}
     925
    915926HRESULT UnattendedDebianInstaller::addFilesToAuxVisoVectors(RTCList<RTCString> &rVecArgs, RTCList<RTCString> &rVecFiles,
    916927                                                            RTVFS hVfsOrgIso, bool fOverwrite)
    917928{
     929    /*
     930     * The txt.cfg file used to be called isolinux.txt (ubuntu 4.10
     931     * and possible others).
     932     */
     933    /** @todo Ubuntu 4.10 does not work, as we generate too long command lines
     934     *        and the kernel crashes immediately. */
     935    const char *pszIsoLinuxTxtCfg = "/isolinux/txt.cfg";
     936    if (   !hlpVfsFileExists(hVfsOrgIso, pszIsoLinuxTxtCfg)
     937        && hlpVfsFileExists(hVfsOrgIso, "/isolinux/isolinux.txt"))
     938        pszIsoLinuxTxtCfg             = "/isolinux/isolinux.txt";
     939
    918940    /*
    919941     * VISO bits and filenames.
     
    935957        /* Remove the two isolinux configure files we'll be replacing. */
    936958        rVecArgs.append() = "isolinux/isolinux.cfg=:must-remove:";
    937         rVecArgs.append() = "isolinux/txt.cfg=:must-remove:";
     959        rVecArgs.append().assign(&pszIsoLinuxTxtCfg[1]).append("=:must-remove:");
    938960
    939961        /* Add the replacement files. */
     
    944966        strTxtCfg = mpParent->i_getAuxiliaryBasePath();
    945967        strTxtCfg.append("isolinux-txt.cfg");
    946         rVecArgs.append().append("isolinux/txt.cfg=").append(strTxtCfg);
     968        rVecArgs.append().assign(&pszIsoLinuxTxtCfg[1]).append("=").append(strTxtCfg);
    947969    }
    948970    catch (std::bad_alloc &)
     
    9841006    {
    9851007        GeneralTextScript Editor(mpParent);
    986         HRESULT hrc = loadAndParseFileFromIso(hVfsOrgIso, "/isolinux/txt.cfg", &Editor);
     1008        HRESULT hrc = loadAndParseFileFromIso(hVfsOrgIso, pszIsoLinuxTxtCfg, &Editor);
    9871009        if (SUCCEEDED(hrc))
    9881010            hrc = editDebianTxtCfg(&Editor);
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