[PC-BSD Commits] r5107 - pcbsd/trunk/SysInstaller

svn at pcbsd.org svn at pcbsd.org
Fri Nov 20 07:04:41 PST 2009


Author: kris
Date: 2009-11-20 07:04:41 -0800 (Fri, 20 Nov 2009)
New Revision: 5107

Modified:
   pcbsd/trunk/SysInstaller/backend.h
   pcbsd/trunk/SysInstaller/sys-diskwidget.cpp
   pcbsd/trunk/SysInstaller/sysinstaller.cpp
   pcbsd/trunk/SysInstaller/sysinstaller.h
Log:

Updated installer, now using the auto-partition choices are finished, generates recommended file-system layout
automatically



Modified: pcbsd/trunk/SysInstaller/backend.h
===================================================================
--- pcbsd/trunk/SysInstaller/backend.h	2009-11-20 10:02:57 UTC (rev 5106)
+++ pcbsd/trunk/SysInstaller/backend.h	2009-11-20 15:04:41 UTC (rev 5107)
@@ -11,7 +11,7 @@
 
 #define PCSYSINSTALL    QString("/pc-sysinstall/pc-sysinstall")
 #define PCSYSINSTALLDIR QString("/pc-sysinstall")
-#define FBSD_MINSIZE 3000
+#define FBSD_MINSIZE 4000
 #define PCBSD_MINSIZE 10000
 
 

Modified: pcbsd/trunk/SysInstaller/sys-diskwidget.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/sys-diskwidget.cpp	2009-11-20 10:02:57 UTC (rev 5106)
+++ pcbsd/trunk/SysInstaller/sys-diskwidget.cpp	2009-11-20 15:04:41 UTC (rev 5107)
@@ -105,18 +105,13 @@
 // Slot which is called when the user clicks on a slice to select in basic view
 void SysInstaller::slotSliceListClicked()
 {
-  if( checkDiskRequirements() ) {
-    QString slice = listDiskSlices->currentItem()->text();
-    slice.truncate(slice.indexOf(":"));
-    autoGenPartitionLayout(slice, false);
-  }
 }
 
 // Function which will auto-generate a partition layout based upon the target disk / slice
-void SysInstaller::autoGenPartitionLayout(QString target, bool isDisk)
+bool SysInstaller::autoGenPartitionLayout(QString target, bool isDisk)
 {
-  QString targetType;
-  int targetLoc, totalSize = 0;
+  QString targetType, tmp;
+  int targetLoc, totalSize = 0, mntsize;
   QString targetDisk, targetSlice;
   bool ok;
   ok = false;
@@ -129,7 +124,7 @@
 
   if ( isDisk ) {
     targetType = "DRIVE";
-    targetSlice = "s1";
+    targetSlice = "all";
     targetDisk = target;
     targetLoc = 1;
   } else {
@@ -151,14 +146,46 @@
   // We got a valid size for this disk / slice, lets generate the layout now
   if(ok)
   {
-     // Start by making our 
+     // Figure out the default size for / if we are on FreeBSD / PC-BSD
      if ( radioInstallPCBSD->isChecked() )
-        fileSystem << targetDisk << targetSlice << "/" << "UFS+S" << "2048";
+        mntsize = 2048;
      else
-        fileSystem << targetDisk << targetSlice << "/" << "UFS+S" << "512";
+        mntsize = 512;
+     fileSystem << targetDisk << targetSlice << "/" << "UFS+S" << tmp.setNum(mntsize);
+     totalSize = totalSize - mntsize;
+     qDebug() << "Auto-Gen FS:" <<  fileSystem;
+     sysFinalDiskLayout << fileSystem;
+     fileSystem.clear();
+      
 
-     qDebug() << fileSystem;
+     // Figure out the swap size, try for 2xPhysMem first, fallback to 512 if not enough space
+     mntsize = systemMemory * 2;
+     if ( totalSize - mntsize < 3000 )
+        mntsize = 512;
+     fileSystem << targetDisk << targetSlice << "SWAP" << "SWAP" << tmp.setNum(mntsize);
+     totalSize = totalSize - mntsize;
+     qDebug() << "Auto-Gen FS:" <<  fileSystem;
+     sysFinalDiskLayout << fileSystem;
+     fileSystem.clear();
+
+
+     // Figure out the default size for /var if we are on FreeBSD / PC-BSD
+     mntsize = 1024;
+     fileSystem << targetDisk << targetSlice << "/var" << "UFS+S" << tmp.setNum(mntsize);
+     totalSize = totalSize - mntsize;
+     qDebug() << "Auto-Gen FS:" <<  fileSystem;
+     sysFinalDiskLayout << fileSystem;
+     fileSystem.clear();
+
+
+     // Now use the rest of the disk / slice for /usr
+     fileSystem << targetDisk << targetSlice << "/usr" << "UFS+S" << tmp.setNum(totalSize);
+     qDebug() << "Auto-Gen FS:" <<  fileSystem;
+     sysFinalDiskLayout << fileSystem;
+     fileSystem.clear();
+
+     return true; 
   }
   
-
+  return false;
 }

Modified: pcbsd/trunk/SysInstaller/sysinstaller.cpp
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.cpp	2009-11-20 10:02:57 UTC (rev 5106)
+++ pcbsd/trunk/SysInstaller/sysinstaller.cpp	2009-11-20 15:04:41 UTC (rev 5107)
@@ -197,7 +197,21 @@
            QMessageBox::Ok);
    }
 
+   // Check if we are on the disk page, and using auto-partitioning, and set it up if so
+   if ( stackWidget->currentIndex() == 3 && radioAutoPartition->isChecked() )
+   {
+      if ( checkUseEntireDisk->isChecked() ) {
+        QString disk = comboDiskList->currentText();
+        disk.truncate(disk.indexOf(" -"));
+        if ( ! autoGenPartitionLayout(disk, true) ) goforward = false;
+      } else {
+        QString slice = listDiskSlices->currentItem()->text();
+        slice.truncate(slice.indexOf(":"));
+        if ( ! autoGenPartitionLayout(slice, false) ) goforward = false;
+      }
+   }
 
+
    if (goforward)
       proceed(true);
 }

Modified: pcbsd/trunk/SysInstaller/sysinstaller.h
===================================================================
--- pcbsd/trunk/SysInstaller/sysinstaller.h	2009-11-20 10:02:57 UTC (rev 5106)
+++ pcbsd/trunk/SysInstaller/sysinstaller.h	2009-11-20 15:04:41 UTC (rev 5107)
@@ -86,7 +86,7 @@
     void setCurrentIndex(int);
     void setKbVariants(const QString &);
     void setKbDefaults();
-    void autoGenPartitionLayout(QString target, bool isDisk);
+    bool autoGenPartitionLayout(QString target, bool isDisk);
 
     void proceed(bool);
     bool isInstalled();



More information about the Commits mailing list