Skip to content
This repository
Browse code

When user is installing to a MBR slice, and declines to install GRUB …

…on MBR, we

will instead stamp it on the particular slice being used. Then the user
can manage their own MBR boot-loader to chain-load GRUB from the slice
  • Loading branch information...
commit 1bfa1e03e745ff2437205cc63bd3a249d2f3d3e2 1 parent dfee0c1
Kris Moore authored September 02, 2013
10  src-qt4/pc-installgui/installer.cpp
@@ -1081,8 +1081,14 @@ QStringList Installer::getDiskCfgSettings()
1081 1081
     // Are we loading a boot-loader?
1082 1082
     if ( loadMBR )
1083 1083
       tmpList << "bootManager=GRUB";
1084  
-    else
1085  
-      tmpList << "bootManager=none";
  1084
+    else {
  1085
+      // If the user declined the GRUB MBR, but we are still using a slice, install it to the slice
  1086
+      // for chain-loading later
  1087
+      if ( tmpSlice != "ALL" && ! loadGPT )
  1088
+        tmpList << "bootManager=GRUB-slice";
  1089
+      else
  1090
+        tmpList << "bootManager=none";
  1091
+    }
1086 1092
 
1087 1093
     // Set the GPT/MBR options
1088 1094
     if ( loadGPT ) 
23  src-qt4/pc-installgui/wizardDisk.cpp
@@ -105,6 +105,13 @@ void wizardDisk::accept()
105 105
 
106 106
   // Are we installing GRUB?
107 107
   useGRUB = checkGRUB->isChecked();
  108
+
  109
+  if ( comboPartition->currentIndex() != 0 && ! useGRUB  ) {
  110
+     QMessageBox::warning(this, tr("No boot-loader!"),
  111
+     tr("You have chosen not to install GRUB on your MBR. You will need to manually setup your own MBR loader."),
  112
+     QMessageBox::Ok,
  113
+     QMessageBox::Ok);
  114
+  }
108 115
      
109 116
   // When doing advanced ZFS setups, make sure to use GPT
110 117
   if ( radioAdvanced->isChecked() && groupZFSOpts->isChecked() )
@@ -172,6 +179,7 @@ int wizardDisk::nextId() const
172 179
 // Logic checks to see if we are ready to move onto next page
173 180
 bool wizardDisk::validatePage()
174 181
 {
  182
+
175 183
   // Generate suggested disk layout and show disk tree
176 184
   if ( prevID == Page_BasicDisk && currentId() == Page_Mounts) {
177 185
     generateDiskLayout();
@@ -214,15 +222,20 @@ bool wizardDisk::validatePage()
214 222
          button(QWizard::NextButton)->setEnabled(true);
215 223
          return true;
216 224
      case Page_BasicDisk:
217  
-	 if ( comboPartition->currentIndex() == 0  && radioAdvanced->isChecked()) {
218  
-	   checkGPT->setVisible(true);
219  
-	   checkForce4K->setVisible(true);
220  
-	 } else {
  225
+	
  226
+	 if ( ! radioAdvanced->isChecked() ) {
221 227
 	   checkGPT->setChecked(false);
222 228
 	   checkGPT->setVisible(false);
223 229
 	   checkForce4K->setVisible(false);
224 230
 	   checkForce4K->setChecked(false);
225  
- 	 }
  231
+	 } else {
  232
+	   checkGPT->setVisible(true);
  233
+	   checkForce4K->setVisible(true);
  234
+           if ( comboPartition->currentIndex() == 0)
  235
+	     checkGRUB->setText(tr("Install GRUB (Required for Boot-Environment support)"));
  236
+	   else
  237
+	     checkGRUB->setText(tr("Stamp GRUB on MBR"));
  238
+	 } 
226 239
 
227 240
 	 // Doing a Advanced install
228 241
 	 if ( radioAdvanced->isChecked() && groupZFSPool->isChecked() )
6  src-qt4/pc-installgui/wizardDisk.ui
@@ -6,8 +6,8 @@
6 6
    <rect>
7 7
     <x>0</x>
8 8
     <y>0</y>
9  
-    <width>628</width>
10  
-    <height>385</height>
  9
+    <width>641</width>
  10
+    <height>386</height>
11 11
    </rect>
12 12
   </property>
13 13
   <property name="windowTitle">
@@ -426,7 +426,7 @@
426 426
     <item row="7" column="1">
427 427
      <widget class="QCheckBox" name="checkGRUB">
428 428
       <property name="text">
429  
-       <string>Install GRUB boot-loader (Required for Boot-Environment support)</string>
  429
+       <string>Install GRUB (Required for Boot-Environment support)</string>
430 430
       </property>
431 431
       <property name="checked">
432 432
        <bool>true</bool>

0 notes on commit 1bfa1e0

Please sign in to comment.
Something went wrong with that request. Please try again.