[PC-BSD Commits] r8099 - pcbsd/stable/SysInstaller

svn at pcbsd.org svn at pcbsd.org
Tue Nov 30 12:02:49 PST 2010


Author: kris
Date: 2010-11-30 12:02:48 -0800 (Tue, 30 Nov 2010)
New Revision: 8099

Modified:
   pcbsd/stable/SysInstaller/sys-diskwidget.cpp
   pcbsd/stable/SysInstaller/sysinstaller.ui
Log:

MFC the disk options to toggle between ZFS / UFS with a single click



Modified: pcbsd/stable/SysInstaller/sys-diskwidget.cpp
===================================================================
--- pcbsd/stable/SysInstaller/sys-diskwidget.cpp	2010-11-30 19:09:15 UTC (rev 8098)
+++ pcbsd/stable/SysInstaller/sys-diskwidget.cpp	2010-11-30 20:02:48 UTC (rev 8099)
@@ -380,39 +380,68 @@
         mntsize = 2048;
      else
         mntsize = 512;
-     fileSystem << targetDisk << targetSlice << "/" << "UFS+S" << tmp.setNum(mntsize) << "" << "";
-     totalSize = totalSize - mntsize;
-     qDebug() << "Auto-Gen FS:" <<  fileSystem;
-     sysFinalDiskLayout << fileSystem;
-     fileSystem.clear();
+
+     if ( radioFileSysSU->isChecked() )
+     {
+       QString fsType;
+
+       fsType="UFS+S";
+
+       fileSystem << targetDisk << targetSlice << "/" << fsType << tmp.setNum(mntsize) << "" << "";
+       totalSize = totalSize - mntsize;
+       qDebug() << "Auto-Gen FS:" <<  fileSystem;
+       sysFinalDiskLayout << fileSystem;
+       fileSystem.clear();
       
 
-     // 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 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();
+       // Figure out the default size for /var if we are on FreeBSD / PC-BSD
+       mntsize = 1024;
+       fileSystem << targetDisk << targetSlice << "/var" << fsType << 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();
+       // Now use the rest of the disk / slice for /usr
+       fileSystem << targetDisk << targetSlice << "/usr" << fsType << tmp.setNum(totalSize) << "" << "";
+       qDebug() << "Auto-Gen FS:" <<  fileSystem;
+       sysFinalDiskLayout << fileSystem;
+       fileSystem.clear();
 
+     } else {
+	// Using ZFS
+
+       // Figure out the swap size, try for 2xPhysMem first, fallback to 512 if not enough space
+       int swapsize = systemMemory * 2;
+       if ( totalSize - swapsize < 3000 )
+          swapsize = 512;
+       totalSize = totalSize - swapsize;
+
+       // Add the main zfs pool with standard partitions
+       fileSystem << targetDisk << targetSlice << "/,/var,/usr" << "ZFS" << tmp.setNum(totalSize) << "" << "";
+       qDebug() << "Auto-Gen FS:" <<  fileSystem;
+       sysFinalDiskLayout << fileSystem;
+       fileSystem.clear();
+
+       // Add the previously calculated swap size
+       fileSystem << targetDisk << targetSlice << "SWAP" << "SWAP" << tmp.setNum(swapsize) << "" << "";
+       qDebug() << "Auto-Gen FS:" <<  fileSystem;
+       sysFinalDiskLayout << fileSystem;
+       fileSystem.clear();
+     }
+
      // Update the custom widget with this partition information
      slotRefreshCustomPartitionWidget();
 
@@ -422,7 +451,6 @@
   return false;
 }
 
-
 // Function which will start the generation of auto-fs layout based upon selected disk up top
 void SysInstaller::slotPushAutoMountClicked()
 {

Modified: pcbsd/stable/SysInstaller/sysinstaller.ui
===================================================================
--- pcbsd/stable/SysInstaller/sysinstaller.ui	2010-11-30 19:09:15 UTC (rev 8098)
+++ pcbsd/stable/SysInstaller/sysinstaller.ui	2010-11-30 20:02:48 UTC (rev 8099)
@@ -4072,7 +4072,7 @@
                        </font>
                       </property>
                       <property name="styleSheet">
-		       <string notr="true">background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255));
+                       <string notr="true">background-color: qlineargradient(spread:pad, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 rgba(217, 230, 235, 230), stop:1 rgba(255, 255, 255, 255));
 color: rgb(116, 160, 180);</string>
                       </property>
                       <property name="text">
@@ -7796,7 +7796,7 @@
                         </font>
                        </property>
                        <property name="styleSheet">
-			<string notr="true">background-color: rgb(250, 250, 250);</string>
+                        <string notr="true">background-color: rgb(250, 250, 250);</string>
                        </property>
                        <item>
                         <property name="text">
@@ -7967,14 +7967,7 @@
                         </property>
                         <widget class="QWidget" name="page">
                          <layout class="QGridLayout" name="gridLayout_2">
-                          <item row="0" column="0">
-                           <widget class="QLabel" name="label_23">
-                            <property name="text">
-                             <string>Select the slice you wish to install to, or check &quot;Use Entire Disk&quot;</string>
-                            </property>
-                           </widget>
-                          </item>
-                          <item row="1" column="0">
+                          <item row="2" column="0" rowspan="2" colspan="3">
                            <widget class="QCheckBox" name="checkUseEntireDisk">
                             <property name="styleSheet">
                              <string notr="true"/>
@@ -7984,7 +7977,7 @@
                             </property>
                            </widget>
                           </item>
-                          <item row="2" column="0">
+                          <item row="4" column="0" rowspan="2" colspan="3">
                            <widget class="QListWidget" name="listDiskSlices">
                             <property name="styleSheet">
                              <string notr="true">selection-background-color: qlineargradient(spread:pad, x1:0.5, y1:1, x2:0.5, y2:0, stop:0 rgba(86, 130, 150, 255), stop:1 rgba(199, 199, 199, 255));
@@ -7992,7 +7985,7 @@
                             </property>
                            </widget>
                           </item>
-                          <item row="3" column="0">
+                          <item row="8" column="0" colspan="3">
                            <layout class="QHBoxLayout" name="horizontalLayout_10">
                             <item>
                              <spacer name="horizontalSpacer_40">
@@ -8031,7 +8024,7 @@
                             </item>
                            </layout>
                           </item>
-                          <item row="4" column="0">
+                          <item row="9" column="0" colspan="3">
                            <spacer name="verticalSpacer_2">
                             <property name="orientation">
                              <enum>Qt::Vertical</enum>
@@ -8044,6 +8037,54 @@
                             </property>
                            </spacer>
                           </item>
+                          <item row="7" column="0">
+                           <layout class="QHBoxLayout" name="horizontalLayout_13">
+                            <item>
+                             <widget class="QRadioButton" name="radioFileSysSU">
+                              <property name="text">
+                               <string>UFS + SoftUpdates</string>
+                              </property>
+                              <property name="checked">
+                               <bool>true</bool>
+                              </property>
+                             </widget>
+                            </item>
+                            <item>
+                             <widget class="QRadioButton" name="radioFileSysZFS">
+                              <property name="text">
+                               <string>ZFS</string>
+                              </property>
+                             </widget>
+                            </item>
+                            <item>
+                             <spacer name="horizontalSpacer_44">
+                              <property name="orientation">
+                               <enum>Qt::Horizontal</enum>
+                              </property>
+                              <property name="sizeHint" stdset="0">
+                               <size>
+                                <width>40</width>
+                                <height>20</height>
+                               </size>
+                              </property>
+                             </spacer>
+                            </item>
+                           </layout>
+                          </item>
+                          <item row="1" column="0" colspan="2">
+                           <widget class="QLabel" name="label_23">
+                            <property name="text">
+                             <string>Select the slice you wish to install to, or check &quot;Use Entire Disk&quot;</string>
+                            </property>
+                           </widget>
+                          </item>
+                          <item row="6" column="0">
+                           <widget class="QLabel" name="label_33">
+                            <property name="text">
+                             <string>File-system for auto-partitioning. If unsure, please leave at the default.</string>
+                            </property>
+                           </widget>
+                          </item>
                          </layout>
                         </widget>
                         <widget class="QWidget" name="page_2">



More information about the Commits mailing list