[PC-BSD Commits] r16253 - pcbsd/current/src-qt4/pc-installgui

svn at pcbsd.org svn at pcbsd.org
Thu Apr 5 09:41:25 PDT 2012


Author: kris
Date: 2012-04-05 16:41:24 +0000 (Thu, 05 Apr 2012)
New Revision: 16253

Modified:
   pcbsd/current/src-qt4/pc-installgui/installer.cpp
Log:

Make sure we kill hald before install, so that when installing from live
media using a WM such as GNOME, we don't fail due to hald trying to auto
mount our newly created partitions.

Also cleanup check disk function



Modified: pcbsd/current/src-qt4/pc-installgui/installer.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-installgui/installer.cpp	2012-04-05 16:32:48 UTC (rev 16252)
+++ pcbsd/current/src-qt4/pc-installgui/installer.cpp	2012-04-05 16:41:24 UTC (rev 16253)
@@ -1145,181 +1145,9 @@
 // Slot which checks any disk requirements before procceding to the next page
 bool Installer::checkDiskRequirements()
 {
-  int minsize, mysize;
-  bool ok, goodsize;
-  QString tmp, disk;
-
-  goodsize = true;
-
-  // KPM
-  //if ( radioInstallPCBSD->isChecked() )
-  //  minsize = PCBSD_MINSIZE;
-  //else
-  //  minsize = FBSD_MINSIZE;
-
-  /* KPM
-  // Do our checks if we are on a auto-partition config
-  if ( tabDisk->currentIndex() == 0 ) {
-    if ( checkUseEntireDisk->isChecked() ) {
-      // Check if we have enough space on the entire disk
-      QString disk = comboDiskList->currentText();
-      disk.truncate(disk.indexOf(" -"));
-      for (int i=0; i < sysDisks.count(); ++i) {
-        // Make sure to only add the drives to the comboDiskList
-        if ( sysDisks.at(i).at(0) == "DRIVE" && sysDisks.at(i).at(1) == disk ) {
-          qDebug() << "Selected Disk Size: " +  sysDisks.at(i).at(2);
-          mysize = sysDisks.at(i).at(2).toInt(&ok); 
-          if( !ok || mysize < minsize)
-            goodsize=false;
-        }
-      }
-    } else if ( listDiskSlices->currentItem() ){
-
-      // Using a specific partition, check that size
-      QString slice = listDiskSlices->currentItem()->text();
-      slice.truncate(slice.indexOf(":"));
-
-
-      // Make sure this isn't Unused Space we are trying to install to
-      for (int i=0; i < sysDisks.count(); ++i) {
-        if ( sysDisks.at(i).at(0) == "SLICE" && slice == sysDisks.at(i).at(2) \
-  	  && sysDisks.at(i).at(4) == "Unused Space") {
-          QMessageBox::critical(this, tr("PC-BSD Installer Error"),
-          tr("Please create a partition using the 'Add Partition' button below, to install using free space."),
-          QMessageBox::Ok);
-          return false;
-	}
-      }
-
-      // Get the Disk
-      for (int i=0; i < sysDisks.count(); ++i)
-        if ( sysDisks.at(i).at(0) == "SLICE" && slice == sysDisks.at(i).at(2))
-          disk = sysDisks.at(i).at(1);
-
-      for (int i=0; i < sysDisks.count(); ++i) {
-        // Make sure to only add the slices to the listDiskSlices
-        if ( sysDisks.at(i).at(0) == "SLICE" && slice == sysDisks.at(i).at(2)) {
-          qDebug() << "Selected Slice Size: " +  sysDisks.at(i).at(3);
-          mysize = sysDisks.at(i).at(3).toInt(&ok);
-          if( !ok || mysize < minsize)
-            goodsize=false;
-        }
-      }
-    } else {
-      goodsize = false;
-    }
-
-    if (!goodsize)
-    {
-       QMessageBox::critical(this, tr("PC-BSD Installer Error"),
-           tr("This install requires a disk/slice with at least") \
-           + " " + tmp.setNum(minsize) + "MB " + tr("of disk space."),
-           QMessageBox::Ok);
-       return goodsize;
-    }
-
-  // End of auto-partition checks
-  }  else {
-  // Check if if the disk layout is good when using custom partitioning
-    bool haveRoot, haveUsr, haveVar, haveSwap, haveEncryption;
-    int minRoot, minUsr, minVar;
-    haveRoot = false;
-    haveUsr = false;
-    haveVar = false;
-    haveSwap = false;
-    haveEncryption = false;
-
-    if ( radioInstallPCBSD->isChecked() ) {
-      minRoot = PCBSD_MINROOT;
-      minUsr = PCBSD_MINUSR;
-      minVar = PCBSD_MINVAR;
-    } else {
-      minRoot = FBSD_MINROOT;
-      minUsr = FBSD_MINUSR;
-      minVar = FBSD_MINVAR;
-    }
-
-    // Start by checking for some important mounts
-    for (int i=0; i < sysFinalDiskLayout.count(); ++i) {
-      QStringList mounts = sysFinalDiskLayout.at(i).at(2).split(",");
-      for (int z = 0; z < mounts.size(); ++z) {
-         if ( mounts.at(z) == "/" )
-           haveRoot = true;
-         if ( mounts.at(z) == "/usr" )
-           haveUsr = true;
-         if ( mounts.at(z) == "/var" )
-           haveVar = true;
-       }
-       if ( sysFinalDiskLayout.at(i).at(3) == "SWAP" \
-            || sysFinalDiskLayout.at(i).at(3) == "SWAP.eli" )
-         haveSwap = true;
-       if ( sysFinalDiskLayout.at(i).at(3).indexOf(".eli") != -1 
-            && sysFinalDiskLayout.at(i).at(3).indexOf("SWAP") == -1 )
-         haveEncryption = true;
-    }
-
-    if (!haveRoot) {
-      QMessageBox::critical(this, tr("PC-BSD Installer Error"),
-         tr("Missing '/' filesystem, please add a filesystem for mount-point '/' to continue."),
-         QMessageBox::Ok);
-      return false;
-    }
-    if (!haveSwap) {
-      int ret = QMessageBox::warning(this, tr("PC-BSD Install"),
-                                tr("No SWAP space has been setup, are you sure you want to continue?"),
-                                QMessageBox::Yes | QMessageBox::No,
-                                QMessageBox::No);
-      switch (ret) {
-       case QMessageBox::Yes:
-         break;
-       case QMessageBox::No:
-                return false;
-         break;
-       default:
-                return false;
-         break;
-      }
-
-    }
-
-    if (haveEncryption)
-      warnEncryption();
-
-    // Check if we have mounts for usr / var, and if not, add their requirements to /
-    if (!haveVar)
-      minRoot = minRoot + minVar;
-    if (!haveUsr)
-      minRoot = minRoot + minUsr;
-
-    // If we get this far, now check if we have any filesystems that are below the minimum size
-    for (int i=0; i < sysFinalDiskLayout.count(); ++i) {
-       mysize = sysFinalDiskLayout.at(i).at(4).toInt(&ok);
-       if(ok) {
-         if ( sysFinalDiskLayout.at(i).at(2) == "/" && mysize < minRoot ) {
-           QMessageBox::critical(this, tr("PC-BSD Installer Error"),
-             "'/' " + tr("filesystem is below the required minimum:") + " " + tmp.setNum(minRoot),
-             QMessageBox::Ok);
-           return false;
-         }
-         if ( sysFinalDiskLayout.at(i).at(2) == "/usr" && mysize < minUsr ) {
-           QMessageBox::critical(this, tr("PC-BSD Installer Error"),
-             "'/usr' " + tr("filesystem is below the required minimum:") + " " + tmp.setNum(minUsr),
-             QMessageBox::Ok);
-           return false;
-         }
-         if ( sysFinalDiskLayout.at(i).at(2) == "/var" && mysize < minVar ) {
-           QMessageBox::critical(this, tr("PC-BSD Installer Error"),
-             "'/var' " + tr("filesystem is below the required minimum:") + " " + tmp.setNum(minVar),
-             QMessageBox::Ok);
-           return false;
-         }
-       }
-    }
-
-  } // End of check for custom filesystem validity
-  */
-
-  return goodsize;
+  // For now just return true, the wizard should handle making sure
+  // the user doesn't shoot themselves in the foot during disk setup
+  return true;
 }
 
 // Function which begins the backend install, and connects slots to monitor it
@@ -1339,6 +1167,10 @@
   labelInstallStatus2->setText("");
   labelInstallStatus2->setHidden(true);
 
+  // Kill any hald instances, which causes failures to install when it
+  // tries to mount our new partitions
+  QProcess::execute("killall", QStringList() << "hald");
+
   // Start our process to begin the install
   QString program = PCSYSINSTALL;
   QStringList arguments;



More information about the Commits mailing list