Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update installer GUI to provide option to use old FreeBSD boot-loader

this will work for users who don't care about BE's or want to test
the FreeBSD loader when it begins to get these features.

Update pc-sysinstall backend to work with BSD/bsd GRUB/grub as the
bootManager= string
  • Loading branch information...
commit 07eb74c9b0f3ce66c29c9b4c2f7c3e55896b22c2 1 parent 73ddd0e
@kmoore134 kmoore134 authored
View
23 src-qt4/pc-installgui/installer.cpp
@@ -34,8 +34,8 @@ Installer::Installer(QWidget *parent) : QMainWindow(parent)
backButton->setText(tr("&Back"));
nextButton->setText(tr("&Next"));
- // Init the MBR to yes
- loadMBR = true;
+ // Init the boot-loader
+ bootLoader = QString("GRUB");
// Init the GPT to no
loadGPT = false;
@@ -505,7 +505,7 @@ void Installer::slotDiskCustomizeClicked()
wDisk->setWindowModality(Qt::ApplicationModal);
if ( radioRestore->isChecked() )
wDisk->setRestoreMode();
- connect(wDisk, SIGNAL(saved(QList<QStringList>, bool, bool, QString, bool)), this, SLOT(slotSaveDiskChanges(QList<QStringList>, bool, bool, QString, bool)));
+ connect(wDisk, SIGNAL(saved(QList<QStringList>, QString, bool, QString, bool)), this, SLOT(slotSaveDiskChanges(QList<QStringList>, QString, bool, QString, bool)));
wDisk->show();
wDisk->raise();
}
@@ -536,14 +536,14 @@ void Installer::slotSaveMetaChanges(QStringList sPkgs)
textDeskSummary->setText(tr("The following meta-pkgs will be installed:") + "<br>" + selectedPkgs.join("<br>"));
}
-void Installer::slotSaveDiskChanges(QList<QStringList> newSysDisks, bool MBR, bool GPT, QString zName, bool zForce )
+void Installer::slotSaveDiskChanges(QList<QStringList> newSysDisks, QString BL, bool GPT, QString zName, bool zForce )
{
+ bootLoader=BL;
zpoolName = zName;
force4K = zForce;
// Save the new disk layout
- loadMBR = MBR;
loadGPT = GPT;
sysFinalDiskLayout = newSysDisks;
textEditDiskSummary->clear();
@@ -1090,17 +1090,8 @@ QStringList Installer::getDiskCfgSettings()
tmpList << "disk" + tmp.setNum(disk) + "=" + workingDisk;
tmpList << "partition=" + tmpSlice;
- // Are we loading a boot-loader?
- if ( loadMBR )
- tmpList << "bootManager=GRUB";
- else {
- // If the user declined the GRUB MBR, but we are still using a slice, install it to the slice
- // for chain-loading later
- if ( tmpSlice != "ALL" && ! loadGPT )
- tmpList << "bootManager=GRUB-slice";
- else
- tmpList << "bootManager=none";
- }
+ // Which boot-loader are we stamping?
+ tmpList << "bootManager=" + bootLoader;
// Set the GPT/MBR options
if ( loadGPT )
View
4 src-qt4/pc-installgui/installer.h
@@ -47,7 +47,7 @@ private slots:
// Disk slots
void slotDiskCustomizeClicked();
- void slotSaveDiskChanges(QList<QStringList>, bool, bool, QString, bool);
+ void slotSaveDiskChanges(QList<QStringList>, QString, bool, QString, bool);
// Slots for the installation
void slotInstallProcFinished( int exitCode, QProcess::ExitStatus status);
@@ -125,7 +125,7 @@ private slots:
QList<QStringList> sysDisks; // Our lists which contains disk info
QList<QStringList> sysPartitions; // Our lists which contains partition info
QList<QStringList> sysFinalDiskLayout; // Our lists which contains the final disk layout
- bool loadMBR;
+ QString bootLoader;
bool loadGPT;
int systemMemory; // Ammount of system RAM we have in MB
QList<QStringList> listComponents; // QStringList for our available components
View
26 src-qt4/pc-installgui/wizardDisk.cpp
@@ -97,19 +97,21 @@ void wizardDisk::slotClose()
void wizardDisk::accept()
{
- bool useGRUB = true;
+ QString bootLoader;
bool useGPT = false;
bool force4K = false;
QString zpoolName;
if (comboPartition->currentIndex() == 0 )
useGPT = checkGPT->isChecked();
- // Are we installing GRUB?
- useGRUB = checkGRUB->isChecked();
+ // Get the boot-loader
+ bootLoader = comboBootLoader->currentText();
+ if ( radioBasic->isChecked() )
+ bootLoader="GRUB";
- if ( comboPartition->currentIndex() != 0 && ! useGRUB ) {
+ if ( comboPartition->currentIndex() != 0 && bootLoader == "NONE" ) {
QMessageBox::warning(this, tr("No boot-loader!"),
- tr("You have chosen not to install GRUB on your MBR. You will need to manually setup your own MBR loader."),
+ tr("You have chosen not to install a boot-loader. You will need to manually setup your own loader."),
QMessageBox::Ok,
QMessageBox::Ok);
}
@@ -126,9 +128,9 @@ void wizardDisk::accept()
zpoolName = lineZpoolName->text();
if ( radioExpert->isChecked() )
- emit saved(sysFinalDiskLayout, false, false, zpoolName, force4K);
+ emit saved(sysFinalDiskLayout, QString("NONE"), false, zpoolName, force4K);
else
- emit saved(sysFinalDiskLayout, useGRUB, useGPT, zpoolName, force4K);
+ emit saved(sysFinalDiskLayout, bootLoader, useGPT, zpoolName, force4K);
close();
}
@@ -140,13 +142,15 @@ int wizardDisk::nextId() const
return Page_Expert;
if (radioBasic->isChecked()) {
checkGPT->setVisible(false);
- checkGRUB->setVisible(false);
+ comboBootLoader->setVisible(false);
+ textBootLoader->setVisible(false);
checkForce4K->setVisible(false);
groupZFSPool->setVisible(false);
}
if (radioAdvanced->isChecked()) {
checkGPT->setVisible(true);
- checkGRUB->setVisible(true);
+ comboBootLoader->setVisible(true);
+ textBootLoader->setVisible(true);
checkForce4K->setVisible(true);
groupZFSPool->setVisible(true);
}
@@ -237,10 +241,6 @@ bool wizardDisk::validatePage()
} else {
checkGPT->setVisible(true);
checkForce4K->setVisible(true);
- if ( comboPartition->currentIndex() == 0)
- checkGRUB->setText(tr("Install GRUB (Required for Boot-Environment support)"));
- else
- checkGRUB->setText(tr("Stamp GRUB on MBR"));
}
// Doing a Advanced install
View
2  src-qt4/pc-installgui/wizardDisk.h
@@ -92,7 +92,7 @@ private slots:
enum { Page_Intro, Page_BasicDisk, Page_ZFS, Page_Mounts, Page_Expert, Page_Confirmation };
signals:
- void saved(QList<QStringList>, bool, bool, QString, bool);
+ void saved(QList<QStringList>, QString, bool, QString, bool);
} ;
#endif // WIZDISK_H
View
266 src-qt4/pc-installgui/wizardDisk.ui
@@ -189,113 +189,8 @@
</layout>
</widget>
<widget class="QWizardPage" name="Page_BasicDisk">
- <layout class="QGridLayout" name="gridLayout_11">
- <item row="9" column="1">
- <widget class="QGroupBox" name="groupZFSPool">
- <property name="font">
- <font>
- <weight>50</weight>
- <bold>false</bold>
- </font>
- </property>
- <property name="title">
- <string>ZFS pool name</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- <layout class="QGridLayout" name="gridLayout_4">
- <item row="0" column="0">
- <widget class="QLineEdit" name="lineZpoolName">
- <property name="inputMask">
- <string/>
- </property>
- <property name="maxLength">
- <number>32767</number>
- </property>
- <property name="placeholderText">
- <string notr="true">tank</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item row="2" column="1">
- <spacer name="verticalSpacer_4">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>387</width>
- <height>18</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="2" rowspan="11">
- <spacer name="horizontalSpacer_3">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>17</width>
- <height>256</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="7" column="1">
- <widget class="QCheckBox" name="checkGRUB">
- <property name="text">
- <string>Install GRUB (Required for Boot-Environment support)</string>
- </property>
- <property name="checked">
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <spacer name="verticalSpacer_5">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>387</width>
- <height>18</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="4" column="1">
- <spacer name="verticalSpacer_17">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="0" column="0" rowspan="12">
+ <layout class="QGridLayout" name="gridLayout_5">
+ <item row="0" column="0" rowspan="9">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QLabel" name="label_3">
@@ -340,12 +235,21 @@
</item>
</layout>
</item>
- <item row="5" column="1">
- <widget class="QCheckBox" name="checkGPT">
- <property name="text">
- <string>Partition disk with GPT</string>
+ <item row="0" column="1">
+ <spacer name="verticalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
</property>
- </widget>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>387</width>
+ <height>18</height>
+ </size>
+ </property>
+ </spacer>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_4">
@@ -363,25 +267,37 @@
</property>
</widget>
</item>
- <item row="11" column="1">
- <spacer name="verticalSpacer_6">
+ <item row="1" column="2" rowspan="8">
+ <spacer name="horizontalSpacer_3">
<property name="orientation">
- <enum>Qt::Vertical</enum>
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>387</width>
- <height>43</height>
+ <width>17</width>
+ <height>256</height>
</size>
</property>
</spacer>
</item>
- <item row="6" column="1">
- <widget class="QCheckBox" name="checkForce4K">
- <property name="text">
- <string>Force ZFS 4K block size</string>
+ <item row="2" column="1">
+ <spacer name="verticalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
</property>
- </widget>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>387</width>
+ <height>18</height>
+ </size>
+ </property>
+ </spacer>
</item>
<item row="3" column="1">
<layout class="QGridLayout" name="gridLayout_3">
@@ -433,13 +349,117 @@
</item>
</layout>
</item>
- <item row="8" column="1">
+ <item row="4" column="1">
+ <widget class="QCheckBox" name="checkGPT">
+ <property name="text">
+ <string>Partition disk with GPT</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QCheckBox" name="checkForce4K">
+ <property name="text">
+ <string>Force ZFS 4K block size</string>
+ </property>
+ </widget>
+ </item>
+ <item row="6" column="1">
<widget class="QCheckBox" name="checkSSD">
<property name="text">
<string>Installing to SSD (Disables SWAP / atime)</string>
</property>
</widget>
</item>
+ <item row="7" column="1">
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QComboBox" name="comboBootLoader">
+ <item>
+ <property name="text">
+ <string notr="true">GRUB</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string notr="true">BSD</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string notr="true">NONE</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="textBootLoader">
+ <property name="text">
+ <string>Boot-Loader (GRUB recommended)</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_4">
+ <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="8" column="1">
+ <widget class="QGroupBox" name="groupZFSPool">
+ <property name="font">
+ <font>
+ <weight>50</weight>
+ <bold>false</bold>
+ </font>
+ </property>
+ <property name="title">
+ <string>ZFS pool name</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0">
+ <widget class="QLineEdit" name="lineZpoolName">
+ <property name="inputMask">
+ <string/>
+ </property>
+ <property name="maxLength">
+ <number>32767</number>
+ </property>
+ <property name="placeholderText">
+ <string notr="true">tank</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="9" column="1">
+ <spacer name="verticalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>387</width>
+ <height>43</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
<widget class="QWizardPage" name="Page_ZFS">
View
10 src-sh/pc-sysinstall/backend/functions-disk.sh
@@ -470,6 +470,10 @@ setup_disk_slice()
get_value_from_string "${line}"
strip_white_space "$VAL"
BMANAGER="$VAL"
+ # Convert to upper
+ if [ "$BMANAGER" = "bsd" ] ; then BMANAGER="BSD" ; fi
+ if [ "$BMANAGER" = "grub" ] ; then BMANAGER="GRUB" ; fi
+ if [ "$BMANAGER" = "grub-slice" ] ; then BMANAGER="GRUB-slice" ; fi
fi
echo $line | grep -q "^commitDiskPart" 2>/dev/null
@@ -711,7 +715,7 @@ init_mbr_full_disk()
# Make the partition active
rc_halt "gpart set -a active -i 1 ${_intDISK}"
- if [ "$_intBOOT" = "bsd" ] ; then
+ if [ "$_intBOOT" = "BSD" ] ; then
echo_log "Stamping boot0 on ${_intDISK}"
rc_halt "gpart bootcode -b /boot/boot0 ${_intDISK}"
elif [ "$_intBOOT" = "GRUB" ] ; then
@@ -848,7 +852,7 @@ run_gpart_slice()
sleep 1
- if [ "${BMANAGER}" = "bsd" ]; then
+ if [ "${BMANAGER}" = "BSD" ]; then
echo_log "Stamping boot sector on ${DISK}"
rc_halt "gpart bootcode -b /boot/boot0 ${DISK}"
elif [ "${BMANAGER}" = "GRUB" ] ; then
@@ -906,7 +910,7 @@ run_gpart_free()
sleep 1
- if [ "${BMANAGER}" = "bsd" ]; then
+ if [ "${BMANAGER}" = "BSD" ]; then
echo_log "Stamping boot sector on ${DISK}"
rc_halt "gpart bootcode -b /boot/boot0 ${DISK}"
elif [ "${BMANAGER}" = "GRUB" ] ; then
Please sign in to comment.
Something went wrong with that request. Please try again.