Exemplo n.º 1
0
 bool hasPreseed()
 {
     QFile preseedFile("/mnt/boot/preseed.cfg");
     if (preseedFile.exists())
     {
         utils::writeLog("Preseeding file was found");
         return 1;
     }
     else
     {
         utils::writeLog("No preseeding file was found, using platform defaults instead");
         return 0;
     }
 }
Exemplo n.º 2
0
PreseedParser::PreseedParser()
{
    /* Attempt to load preseeder */
    QFile preseedFile(PRESEED_FILE);
    if (preseedFile.exists())
    {
        if (preseedFile.open(QIODevice::ReadOnly | QIODevice::Text))
        {
            /* Load the preseeder contents */
            QTextStream preseedStream(&preseedFile);
            QString preseedString = preseedStream.readAll();
            preseedFile.close();
            this->preseedStringList = preseedString.split(QRegExp("[\r\n]"),QString::SkipEmptyParts);
            this->hasPreseed = true;
        }
        else
            this->hasPreseed = false;
    }
}