Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 2 commits
  • 17 files changed
  • 0 commit comments
  • 1 contributor
Commits on Aug 22, 2013
@kmoore134 kmoore134 Hide the zfs recv output, only need send data for UI elements bec1293
@kmoore134 kmoore134 Welcome the new Life-Preserver restore ability to the Installer GUI
Now you can restore your entire system from a replicated life-preserver backup on a
remote machine
93572be
View
68 .gitignore
@@ -684,6 +684,74 @@ src-qt4/warden-gui/i18n/Warden_zh_CN.qm
src-qt4/warden-gui/i18n/Warden_zh_HK.qm
src-qt4/warden-gui/i18n/Warden_zh_TW.qm
src-qt4/warden-gui/i18n/Warden_zu.qm
+src-qt4/pc-installgui/i18n/SysInstaller_af.qm
+src-qt4/pc-installgui/i18n/SysInstaller_ar.qm
+src-qt4/pc-installgui/i18n/SysInstaller_az.qm
+src-qt4/pc-installgui/i18n/SysInstaller_bg.qm
+src-qt4/pc-installgui/i18n/SysInstaller_bn.qm
+src-qt4/pc-installgui/i18n/SysInstaller_bs.qm
+src-qt4/pc-installgui/i18n/SysInstaller_ca.qm
+src-qt4/pc-installgui/i18n/SysInstaller_cs.qm
+src-qt4/pc-installgui/i18n/SysInstaller_cy.qm
+src-qt4/pc-installgui/i18n/SysInstaller_da.qm
+src-qt4/pc-installgui/i18n/SysInstaller_de.qm
+src-qt4/pc-installgui/i18n/SysInstaller_el.qm
+src-qt4/pc-installgui/i18n/SysInstaller_en.qm
+src-qt4/pc-installgui/i18n/SysInstaller_en_GB.qm
+src-qt4/pc-installgui/i18n/SysInstaller_en_US.qm
+src-qt4/pc-installgui/i18n/SysInstaller_en_ZA.qm
+src-qt4/pc-installgui/i18n/SysInstaller_es.qm
+src-qt4/pc-installgui/i18n/SysInstaller_et.qm
+src-qt4/pc-installgui/i18n/SysInstaller_eu.qm
+src-qt4/pc-installgui/i18n/SysInstaller_fa.qm
+src-qt4/pc-installgui/i18n/SysInstaller_fi.qm
+src-qt4/pc-installgui/i18n/SysInstaller_fr.qm
+src-qt4/pc-installgui/i18n/SysInstaller_fr_CA.qm
+src-qt4/pc-installgui/i18n/SysInstaller_fur.qm
+src-qt4/pc-installgui/i18n/SysInstaller_gl.qm
+src-qt4/pc-installgui/i18n/SysInstaller_he.qm
+src-qt4/pc-installgui/i18n/SysInstaller_hi.qm
+src-qt4/pc-installgui/i18n/SysInstaller_hr.qm
+src-qt4/pc-installgui/i18n/SysInstaller_hu.qm
+src-qt4/pc-installgui/i18n/SysInstaller_id.qm
+src-qt4/pc-installgui/i18n/SysInstaller_is.qm
+src-qt4/pc-installgui/i18n/SysInstaller_it.qm
+src-qt4/pc-installgui/i18n/SysInstaller_ja.qm
+src-qt4/pc-installgui/i18n/SysInstaller_ka.qm
+src-qt4/pc-installgui/i18n/SysInstaller_ko.qm
+src-qt4/pc-installgui/i18n/SysInstaller_lt.qm
+src-qt4/pc-installgui/i18n/SysInstaller_lv.qm
+src-qt4/pc-installgui/i18n/SysInstaller_mk.qm
+src-qt4/pc-installgui/i18n/SysInstaller_mn.qm
+src-qt4/pc-installgui/i18n/SysInstaller_ms.qm
+src-qt4/pc-installgui/i18n/SysInstaller_mt.qm
+src-qt4/pc-installgui/i18n/SysInstaller_nb.qm
+src-qt4/pc-installgui/i18n/SysInstaller_ne.qm
+src-qt4/pc-installgui/i18n/SysInstaller_nl.qm
+src-qt4/pc-installgui/i18n/SysInstaller_pa.qm
+src-qt4/pc-installgui/i18n/SysInstaller_pl.qm
+src-qt4/pc-installgui/i18n/SysInstaller_pt.qm
+src-qt4/pc-installgui/i18n/SysInstaller_pt_BR.qm
+src-qt4/pc-installgui/i18n/SysInstaller_ro.qm
+src-qt4/pc-installgui/i18n/SysInstaller_ru.qm
+src-qt4/pc-installgui/i18n/SysInstaller_sa.qm
+src-qt4/pc-installgui/i18n/SysInstaller_sk.qm
+src-qt4/pc-installgui/i18n/SysInstaller_sl.qm
+src-qt4/pc-installgui/i18n/SysInstaller_sr.qm
+src-qt4/pc-installgui/i18n/SysInstaller_sv.qm
+src-qt4/pc-installgui/i18n/SysInstaller_sw.qm
+src-qt4/pc-installgui/i18n/SysInstaller_ta.qm
+src-qt4/pc-installgui/i18n/SysInstaller_tg.qm
+src-qt4/pc-installgui/i18n/SysInstaller_th.qm
+src-qt4/pc-installgui/i18n/SysInstaller_tr.qm
+src-qt4/pc-installgui/i18n/SysInstaller_uk.qm
+src-qt4/pc-installgui/i18n/SysInstaller_uz.qm
+src-qt4/pc-installgui/i18n/SysInstaller_vi.qm
+src-qt4/pc-installgui/i18n/SysInstaller_zh_CN.qm
+src-qt4/pc-installgui/i18n/SysInstaller_zh_HK.qm
+src-qt4/pc-installgui/i18n/SysInstaller_zh_TW.qm
+src-qt4/pc-installgui/i18n/SysInstaller_zu.qm
+src-qt4/pc-installgui/ui_wizardRestore.h
# Compiled binaries
src-qt4/pc-usermanager/pc-usermanager
View
244 src-qt4/pc-installgui/installer.cpp
@@ -349,6 +349,8 @@ QStringList Installer::getDiskSummary()
}
}
+
+
// If after doing the mirror, our list is empty, break out
if ( copyList.empty() )
break;
@@ -398,7 +400,10 @@ QStringList Installer::getDiskSummary()
zDS.replace(ds, zTMP );
}
}
- summaryList << tr("ZFS Datasets:<br>") + " " + zDS.join("<br>");
+ if ( radioRestore->isChecked())
+ summaryList << tr("ZFS Datasets:") + " " + tr("The original ZFS layout will be restored");
+ else
+ summaryList << tr("ZFS Datasets:<br>") + " " + zDS.join("<br>");
} else {
summaryList << tr("Mount:") + " " + copyList.at(i).at(2);
}
@@ -453,7 +458,9 @@ QStringList Installer::getDiskSummary()
// Write the user summary
summaryList << "";
summaryList << tr("Partition:") + " " + workingDisk + "(" + workingSlice + "):";
+
summaryList << tr("FileSystem:") + " " + copyList.at(i).at(3);
+
summaryList << tr("Size:") + " " + copyList.at(i).at(4) + "MB ";
if ( copyList.at(i).at(3) != "ZFS" )
summaryList << tr("Mount:") + " " + copyList.at(i).at(2);
@@ -480,6 +487,8 @@ void Installer::slotDiskCustomizeClicked()
wDisk = new wizardDisk();
wDisk->programInit();
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)));
wDisk->show();
wDisk->raise();
@@ -536,6 +545,14 @@ void Installer::slotChangedMetaPkgSelection()
{
selectedPkgs.clear();
+ if ( radioRestore->isChecked() )
+ {
+ pushDeskCustomize->setEnabled(false);
+ textDeskSummary->setText(tr("Performing a restore from a Life-Preserver backup. Click next to start the restore wizard."));
+ return;
+ }
+
+ pushDeskCustomize->setEnabled(true);
// Set the default desktop meta-pkgs based upon the selection
if ( radioDesktop->isChecked() )
@@ -593,6 +610,7 @@ void Installer::initDesktopSelector()
connect(pushDeskCustomize,SIGNAL(clicked()), this, SLOT(slotDesktopCustomizeClicked()));
connect(radioDesktop,SIGNAL(clicked()), this, SLOT(slotChangedMetaPkgSelection()));
connect(radioServer,SIGNAL(clicked()), this, SLOT(slotChangedMetaPkgSelection()));
+ connect(radioRestore,SIGNAL(clicked()), this, SLOT(slotChangedMetaPkgSelection()));
slotChangedMetaPkgSelection();
}
@@ -652,6 +670,17 @@ void Installer::slotNext()
return;
}
+ // Start the Restore wizard
+ if ( radioRestore->isChecked() && installStackWidget->currentIndex() == 1 ) {
+ wRestore = new wizardRestore();
+ wRestore->setWindowModality(Qt::ApplicationModal);
+ wRestore->programInit();
+ connect(wRestore, SIGNAL(saved(QStringList)), this, SLOT(slotSaveRestoreSettings(QStringList)));
+ wRestore->show();
+ wRestore->raise();
+ return ;
+ }
+
// Start the TrueOS wizard
if ( radioServer->isChecked() && installStackWidget->currentIndex() == 1 ) {
bool tOS;
@@ -677,8 +706,15 @@ void Installer::slotNext()
if ( installStackWidget->currentIndex() == 2 )
{
startConfigGen();
+ QString msg;
+
+ if (radioRestore->isChecked() )
+ msg=tr("Start the restore now?");
+ else
+ msg=tr("Start the installation now?");
+
int ret = QMessageBox::question(this, tr("PC-BSD Installer"),
- tr("Start the installation now?"),
+ msg,
QMessageBox::No | QMessageBox::Yes,
QMessageBox::No);
switch (ret) {
@@ -764,6 +800,35 @@ QStringList Installer::getGlobalCfgSettings()
tmpList << "# Auto-Generated pc-sysinstall configuration";
tmpList << "installInteractive=no";
+ // Are we doing a restore?
+ if ( radioRestore->isChecked() )
+ {
+ tmpList << "installMode=zfsrestore";
+ tmpList << "";
+ tmpList << "sshHost=" + restOpts.at(0);
+ tmpList << "sshUser=" + restOpts.at(1);
+ tmpList << "sshPort=" + restOpts.at(2);
+ if ( ! restOpts.at(3).isEmpty() )
+ tmpList << "sshKey=" + restOpts.at(3);
+ tmpList << "zfsProps=" + restOpts.at(4);
+ tmp = restOpts.at(4);
+ tmp.replace(".lp-props-", "");
+ tmp.replace("#", "/");
+ tmpList << "zfsRemoteDataset=" + tmp;
+
+ // Using a custom zpool name?
+ if ( ! zpoolName.isEmpty() )
+ tmpList << "zpoolName=" + zpoolName;
+
+ // Are we force enabling ZFS 4K block sizes?
+ if ( force4K )
+ tmpList << "zfsForce4k=YES";
+
+ tmpList << "";
+ return tmpList;
+ } // End of restore options
+
+
if ( sysFinalDiskLayout.at(0).at(0) == "MANUAL" )
{
tmpList << "installMode=extract";
@@ -894,53 +959,58 @@ void Installer::startConfigGen()
cfgList+=getGlobalCfgSettings();
cfgList+=getDiskCfgSettings();
+
+ // We can skip these options if doing a restore
+ if ( ! radioRestore->isChecked() ) {
- cfgList+=getComponentCfgSettings();
+ cfgList+=getComponentCfgSettings();
- // Save the install config script to disk
- cfgList << "runExtCommand=/root/save-config.sh";
+ // Save the install config script to disk
+ cfgList << "runExtCommand=/root/save-config.sh";
- cfgList+= "";
+ cfgList+= "";
- // If doing install from package disk
- if ( hasPkgsOnMedia )
- cfgList+=getDeskPkgCfg();
+ // If doing install from package disk
+ if ( hasPkgsOnMedia )
+ cfgList+=getDeskPkgCfg();
- cfgList+= "";
+ cfgList+= "";
- if ( radioDesktop->isChecked() ) {
- // Doing PC-BSD Install
+ if ( radioDesktop->isChecked() ) {
+ // Doing PC-BSD Install
- QString lang;
- if ( comboLanguage->currentIndex() != 0 )
- lang = languages.at(comboLanguage->currentIndex()).section("(",1,1).section(")",0,0);
- else
- lang="en_US";
+ QString lang;
+ if ( comboLanguage->currentIndex() != 0 )
+ lang = languages.at(comboLanguage->currentIndex()).section("(",1,1).section(")",0,0);
+ else
+ lang="en_US";
- // Setup the desktop
- cfgList << "runCommand=sh /usr/local/share/pcbsd/scripts/sys-init.sh desktop " + lang;
+ // Setup the desktop
+ cfgList << "runCommand=sh /usr/local/share/pcbsd/scripts/sys-init.sh desktop " + lang;
- // Setup for a fresh system first boot
- cfgList << "# Touch flags to enable PC-BSD setup at first boot";
- cfgList << "runCommand=touch /var/.runxsetup";
- cfgList << "runCommand=touch /var/.pcbsd-firstboot";
- cfgList << "runCommand=touch /var/.pcbsd-firstgui";
+ // Setup for a fresh system first boot
+ cfgList << "# Touch flags to enable PC-BSD setup at first boot";
+ cfgList << "runCommand=touch /var/.runxsetup";
+ cfgList << "runCommand=touch /var/.pcbsd-firstboot";
+ cfgList << "runCommand=touch /var/.pcbsd-firstgui";
- } else {
- // Doing TrueOS Install
- cfgList+=getUsersCfgSettings();
+ } else {
+ // Doing TrueOS Install
+ cfgList+=getUsersCfgSettings();
- // Enable SSH?
- if ( fSSH )
- cfgList << "runCommand=echo 'sshd_enable=\"YES\"' >>/etc/rc.conf";
+ // Enable SSH?
+ if ( fSSH )
+ cfgList << "runCommand=echo 'sshd_enable=\"YES\"' >>/etc/rc.conf";
- // Setup the TrueOS server
- cfgList << "runCommand=sh /usr/local/share/pcbsd/scripts/sys-init.sh server";
+ // Setup the TrueOS server
+ cfgList << "runCommand=sh /usr/local/share/pcbsd/scripts/sys-init.sh server";
- }
+ }
- // Run newaliases to fix mail errors
- cfgList << "runCommand=newaliases";
+ // Run newaliases to fix mail errors
+ cfgList << "runCommand=newaliases";
+
+ } // End of restore check
// Now write out the cfgList to file
QFile cfgfile( PCSYSINSTALLCFG );
@@ -1150,6 +1220,15 @@ bool Installer::checkDiskRequirements()
// Function which begins the backend install, and connects slots to monitor it
void Installer::startInstall()
{
+
+ // Update the UI elements if doing a restore
+ if ( radioRestore->isChecked() )
+ {
+ labelFinished->setText(tr("Your system is now restored!\nClick Finish to reboot. After rebooting you may eject the install media."));
+ groupInstall->setTitle(tr("System Restore"));
+ labelInstallHeader->setText(tr("Your system is now being restored, this may take a while depending upon the size of your backup and network conditions."));
+ }
+
QString cfgFile;
if (customCfgFile.isEmpty() )
cfgFile = PCSYSINSTALLCFG;
@@ -1163,6 +1242,7 @@ void Installer::startInstall()
installFoundCounter = false;
installFoundMetaCounter = false;
installFoundFetchOutput = false;
+ inZFSSend = false;
// Setup some defaults for the secondary progress bar
progressBarInstall2->setValue(0);
@@ -1280,11 +1360,36 @@ void Installer::slotReadInstallerOutput()
tmp.truncate(75);
//qDebug() << tmp;
- // If doing a restore, don't bother checking for other values
- //if ( radioRestore->isChecked() ) {
- // labelInstallStatus->setText(tmp);
- // continue;
- //}
+ // If doing a restore we can do all parsing right here
+ if ( radioRestore->isChecked() ) {
+ line = tmp;
+
+ if ( tmp.contains("total estimated size"))
+ {
+ repTotalK = line.section(" ",-1).simplified();
+ double totSize = displayToDoubleK(repTotalK);
+ progressBarInstall->setRange(0, totSize + 1024);
+ inZFSSend = true;
+ continue;
+ }
+ if ( tmp.contains("Moving datasets to"))
+ inZFSSend=false;
+
+ if( line.contains("send from ") )
+ continue;
+ if( line.contains("TIME ") )
+ continue;
+
+ labelInstallStatus->setText(tmp);
+
+ if ( ! inZFSSend )
+ continue;
+
+ // We got here, lets parse the ZFS send message
+ parseStatusMessage(tmp);
+
+ continue;
+ } // End of restore parsing
// Parse fetch output
if ( installFoundFetchOutput ) {
@@ -1709,5 +1814,62 @@ void Installer::slotLoadConfigUSB()
void Installer::slotStartNetworkManager()
{
- system("/usr/local/bin/pc-netmanager -installer &");
+ system("/usr/local/bin/pc-netmanager -installer &");
+}
+
+void Installer::slotSaveRestoreSettings(QStringList Opts)
+{
+ restOpts = Opts;
+
+ textEditDiskSummary->clear();
+ QStringList summary = getDiskSummary();
+ for ( int i=0; i < summary.count(); ++i)
+ textEditDiskSummary->append(summary.at(i));
+
+ textEditDiskSummary->moveCursor(QTextCursor::Start);
+
+ startConfigGen();
+ installStackWidget->setCurrentIndex(installStackWidget->currentIndex() + 1);
+}
+
+void Installer::parseStatusMessage(QString stat){
+ //qDebug() << "msg:" << stat;
+ QString dispTotal;
+
+ //Divide up the status message into sections
+ stat.replace("\t"," ");
+ QString cSize = stat.section(" ",1,1,QString::SectionSkipEmpty);
+
+ //Now Setup the tooltip
+ if(!repTotalK.isEmpty()){
+ double c = displayToDoubleK(cSize);
+ progressBarInstall->setValue(c);
+ dispTotal = repTotalK;
+ } else {
+ dispTotal = "??";
+ }
+
+ //Format the tooltip String
+ QString status = cSize+"/"+dispTotal;
+
+ QString txt = QString(tr("Restoring system: %1")).arg(status);
+ labelInstallStatus->setText(txt);
+
}
+
+double Installer::displayToDoubleK(QString displayNumber){
+ QStringList labels;
+ labels << "K" << "M" << "G" << "T" << "P" << "E";
+ QString clab = displayNumber.right(1); //last character is the size label
+ displayNumber.chop(1); //remove the label from the number
+ double num = displayNumber.toDouble();
+ //Now format the number properly
+ bool ok = false;
+ for(int i=0; i<labels.length(); i++){
+ if(labels[i] == clab){ ok = true; break; }
+ else{ num = num*1024; } //get ready for the next size
+ }
+ if(!ok){ num = -1; } //could not determine the size
+ return num;
+}
+
View
16 src-qt4/pc-installgui/installer.h
@@ -16,6 +16,7 @@
#include "dialogCheckHardware.h"
#include "wizardFreeBSD.h"
#include "wizardDisk.h"
+#include "wizardRestore.h"
#define wFREEBSD 1
#define wPCSERVER 2
@@ -72,6 +73,9 @@ private slots:
void slotChangedMetaPkgSelection();
void slotSaveFBSDSettings(QString, QString, QString, QString, QString, QString, bool, bool, bool, QStringList);
+ // Restore-related slots
+ void slotSaveRestoreSettings(QStringList);
+
private:
@@ -79,6 +83,12 @@ private slots:
void startInstall(); // Function which begins the install process
void installFailed(); // Function which does post-install failure stuff
+ // Functions to parse ZFS send/recv messages
+ bool inZFSSend;
+ double displayToDoubleK(QString);
+ void parseStatusMessage(QString);
+ QString repTotalK;
+
// Disk functions
void loadDiskInfo();
bool autoGenPartitionLayout(QString target, bool isDisk);
@@ -146,6 +156,9 @@ private slots:
// FreeBSD setup wizard
wizardFreeBSD *wFBSD;
+
+ // Restore wizard
+ wizardRestore *wRestore;
// FreeBSD options
QString fRootPW;
@@ -178,6 +191,9 @@ private slots:
// Force 4K mode?
bool force4K;
+ // Restore Options
+ QStringList restOpts;
+
protected:
void closeEvent(QCloseEvent *event);
View
23 src-qt4/pc-installgui/installer.ui
@@ -284,7 +284,7 @@
<string notr="true">background-image: url(:/modules/images/backgroundimage.jpg);</string>
</property>
<property name="currentIndex">
- <number>0</number>
+ <number>4</number>
</property>
<widget class="QWidget" name="page">
<layout class="QGridLayout" name="gridLayout_3">
@@ -625,6 +625,23 @@ background: transparent;</string>
</property>
</spacer>
</item>
+ <item row="2" column="1">
+ <widget class="QRadioButton" name="radioRestore">
+ <property name="text">
+ <string>Restore from Life-Preserver backup</string>
+ </property>
+ <property name="icon">
+ <iconset resource="sysinstaller.qrc">
+ <normaloff>:/modules/images/lifepreserver.png</normaloff>:/modules/images/lifepreserver.png</iconset>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>32</width>
+ <height>32</height>
+ </size>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
@@ -1084,7 +1101,7 @@ background: transparent;</string>
</spacer>
</item>
<item row="1" column="1">
- <widget class="QGroupBox" name="groupBox_5">
+ <widget class="QGroupBox" name="groupInstall">
<property name="font">
<font>
<weight>50</weight>
@@ -1234,7 +1251,7 @@ background: transparent;</string>
</spacer>
</item>
<item row="1" column="1">
- <widget class="QLabel" name="label_3">
+ <widget class="QLabel" name="labelFinished">
<property name="styleSheet">
<string notr="true">background: transparent;</string>
</property>
View
10 src-qt4/pc-installgui/pc-installgui.pro
@@ -13,6 +13,7 @@ SOURCES += main.cpp \
dialogHelp.cpp \
wizardDisk.cpp \
wizardFreeBSD.cpp \
+ wizardRestore.cpp \
installer.cpp \
backend.cpp
HEADERS += installer.h \
@@ -24,6 +25,7 @@ HEADERS += installer.h \
dialogHelp.h \
wizardDisk.h \
wizardFreeBSD.h \
+ wizardRestore.h \
helpText.h \
backend.h
TRANSLATIONS = i18n/SysInstaller_af.ts \
@@ -97,7 +99,11 @@ TRANSLATIONS = i18n/SysInstaller_af.ts \
dotrans.path=/usr/local/share/pcbsd/i18n/
dotrans.extra=cd i18n && lrelease-qt4 -nounfinished *.ts && cp *.qm /usr/local/share/pcbsd/i18n/
-INSTALLS += target dotrans
+scripts.path=/usr/local/share/pcbsd/pc-installgui
+scripts.extra=cp scripts/* /usr/local/share/pcbsd/pc-installgui/ && chmod 755 /usr/local/share/pcbsd/pc-installgui/*.sh
+
+INSTALLS += target dotrans scripts
+
+FORMS += installer.ui dialogCheckHardware.ui dialogDesktopSelection.ui dialogFSSize.ui dialogHelp.ui wizardFreeBSD.ui dialogKeyboard.ui wizardDisk.ui dialogInfoBox.ui wizardRestore.ui
-FORMS += installer.ui dialogCheckHardware.ui dialogDesktopSelection.ui dialogFSSize.ui dialogHelp.ui wizardFreeBSD.ui dialogKeyboard.ui wizardDisk.ui dialogInfoBox.ui
RESOURCES += sysinstaller.qrc
View
24 src-qt4/pc-installgui/scripts/get-zfs-restore-list.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Script for Life-Preserver which checks a remote box and prints a list of
+# available restore points
+###########################################################################
+
+SSHUSER=$1
+SSHHOST=$2
+SSHPORT=$3
+SSHKEY=$4
+
+if [ -z "${SSHUSER}" -o -z "${SSHHOST}" -o -z "${SSHPORT}" ]; then
+ echo "ERROR: Usage get-zfs-restore-list.sh <user> <host> <port>"
+ touch /tmp/.ssh-list-failed
+ exit 150
+fi
+
+if [ -n "$SSHKEY" ] ; then
+ SSHKEY="-i $SSHKEY"
+fi
+
+cd /root
+
+ssh ${SSHKEY} -p $SSHPORT -o PasswordAuthentication=no -o NumberOfPasswordPrompts=0 $SSHUSER@$SSHHOST 'ls .lp-props* 2>/dev/null' 2>/dev/null
+exit $?
View
71 src-qt4/pc-installgui/scripts/load-usb-key.sh
@@ -0,0 +1,71 @@
+#!/bin/sh
+#-
+# Copyright (c) 2013 iXsystems, Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# Script to get life-preserver ssh files from a USB stick
+############################################################################
+
+SYSKEYS="/tmp/lpreserver"
+if [ ! -d "${SYSKEYS}" ] ; then
+ mkdir -p ${SYSKEYS} >/dev/null 2>/dev/null
+fi
+MNTDIR="/root/usbmount"
+if [ ! -d "${MNTDIR}" ] ; then
+ mkdir -p ${MNTDIR} 2>/dev/null >/dev/null
+fi
+SAVEKEYDIR="${MNTDIR}/lpreserver/"
+
+status=1
+
+# Lets check the various da* devices, look for a FAT32 USB mount
+for i in `ls /dev/da* 2>/dev/null`
+do
+ # Lets try to FAT mount
+ mount_msdosfs -o longnames ${i} $MNTDIR >/dev/null 2>/dev/null
+ if [ $? -ne 0 ] ; then continue ; fi
+ if [ ! -d "${SAVEKEYDIR}" ] ; then
+ umount ${MNTDIR} >/dev/null 2>/dev/null
+ continue
+ fi
+ ls ${SAVEKEYDIR}/*id_rsa >/dev/null 2>/dev/null
+ if [ $? -ne 0 ] ; then
+ umount ${MNTDIR} >/dev/null 2>/dev/null
+ continue
+ fi
+
+ # Looks like we have keys! Lets copy / umount / return
+ cp ${SAVEKEYDIR}/*id_rsa ${SYSKEYS}/
+ status=$?
+ sync
+ umount ${MNTDIR} >/dev/null 2>/dev/null
+ break
+done
+
+for j in `ls ${SYSKEYS}/*id_rsa 2>/dev/null`
+do
+ chmod 600 ${j}
+ echo "$j"
+done
+
+exit $status
View
41 src-qt4/pc-installgui/scripts/setup-ssh-keys.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+# Script for Life-Preserver which sets up password-less logins for ssh host
+###########################################################################
+
+SSHUSER=$1
+SSHHOST=$2
+SSHPORT=$3
+
+if [ -z "${SSHUSER}" -o -z "${SSHHOST}" ]; then
+ echo "ERROR: Usage setup-ssh-keys.sh <user> <host>"
+ touch /tmp/.ssh-auth-failed
+ exit 150
+fi
+
+cd /root
+
+echo "Preparing to setup SSH key authorization..."
+echo "When prompted, enter your password for ${SSHUSER}@${SSHHOST}"
+
+if [ ! -e ".ssh/id_rsa.pub" ]; then
+mkdir .ssh >/dev/null 2>/dev/null
+ ssh-keygen -q -t rsa -N '' -f .ssh/id_rsa
+ sync
+fi
+
+if [ ! -e ".ssh/id_rsa.pub" ]; then
+ echo "ERROR: Failed creating .ssh/id_rsa.pub"
+ touch /tmp/.ssh-auth-failed
+ exit 150
+fi
+
+# Get the .pub key
+PUBKEY="`cat .ssh/id_rsa.pub`"
+
+echo $PUBKEY | ssh -p $SSHPORT $SSHUSER@$SSHHOST 'mkdir .ssh ; chmod 700 .ssh ; tee -a .ssh/authorized_keys ; chmod 644 .ssh/authorized_keys'
+if [ $? -ne 0 ] ; then
+ touch /tmp/.ssh-auth-failed
+else
+ rm /tmp/.ssh-auth-failed >/dev/null 2>/dev/null
+fi
+exit 0
View
1  src-qt4/pc-installgui/sysinstaller.qrc
@@ -1,5 +1,6 @@
<RCC>
<qresource prefix="/modules">
+ <file>images/lifepreserver.png</file>
<file>images/configure.png</file>
<file>images/usb.png</file>
<file>images/ok.png</file>
View
12 src-qt4/pc-installgui/wizardDisk.cpp
@@ -18,6 +18,7 @@
void wizardDisk::programInit()
{
prevID = 0;
+ restoreMode=false;
populateDiskInfo();
@@ -443,6 +444,13 @@ void wizardDisk::populateDiskTree()
treeMounts->setCurrentItem(treeMounts->findItems("0", Qt::MatchFixedString).at(0));
slotTreeDiskChanged();
+ if ( restoreMode ) {
+ treeMounts->setEnabled(false);
+ pushRemoveMount->setEnabled(false);
+ pushAddMount->setEnabled(false);
+ labelMounts->setText(tr("The original system datasets / mount-points will be automatically restored."));
+ }
+
}
int wizardDisk::getDiskSliceSize()
@@ -1060,3 +1068,7 @@ void wizardDisk::slotTerminal()
system("xterm &");
}
+void wizardDisk::setRestoreMode()
+{
+ restoreMode=true;
+}
View
2  src-qt4/pc-installgui/wizardDisk.h
@@ -19,6 +19,7 @@ class wizardDisk : public QWizard, private Ui::wizardDisk
}
void programInit();
+ void setRestoreMode();
virtual int nextId() const;
public slots:
@@ -86,6 +87,7 @@ private slots:
QMenu *popupCH;
QMenu *popupNE;
dialogFSSize *rFS;
+ bool restoreMode;
enum { Page_Intro, Page_BasicDisk, Page_ZFS, Page_Mounts, Page_Expert, Page_Confirmation };
signals:
View
2  src-qt4/pc-installgui/wizardDisk.ui
@@ -672,7 +672,7 @@
</spacer>
</item>
<item row="1" column="1">
- <widget class="QLabel" name="label_18">
+ <widget class="QLabel" name="labelMounts">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
View
238 src-qt4/pc-installgui/wizardRestore.cpp
@@ -0,0 +1,238 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you want to add, delete, or rename functions or slots, use
+** Qt Designer to update this file, preserving your code.
+**
+** You should not define a constructor or destructor in this file.
+** Instead, write your code in functions called init() and destroy().
+** These will automatically be called by the form's constructor and
+** destructor.
+*****************************************************************************/
+#include "wizardRestore.h"
+#include "ui_wizardRestore.h"
+#include "backend.h"
+#include <QMessageBox>
+#include <QInputDialog>
+
+#define SCRIPTDIR QString("/usr/local/share/pcbsd/pc-installgui")
+
+void wizardRestore::programInit()
+{
+ connect(this,SIGNAL(currentIdChanged(int)),this,SLOT(slotCheckComplete()));
+ connect(lineHostName,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckComplete()));
+ connect(lineUserName,SIGNAL(textChanged(const QString)),this,SLOT(slotCheckComplete()));
+ connect(spinPort,SIGNAL(valueChanged(int)),this,SLOT(slotCheckComplete()));
+}
+
+void wizardRestore::slotClose()
+{
+ close();
+}
+
+void wizardRestore::accept()
+{
+ QString targetSys;
+ targetSys = sysList.at(comboBoxRestoreSystem->currentIndex());
+
+ QStringList rset;
+ rset << lineHostName->text();
+ rset << lineUserName->text();
+ rset << QString::number(spinPort->value());
+ rset << authKey;
+ rset << targetSys;
+ emit saved(rset);
+ close();
+}
+
+// Logic checks to see if we are ready to move onto next page
+bool wizardRestore::validatePage()
+{
+ switch (currentId()) {
+ case Page_Intro:
+ button(QWizard::NextButton)->setEnabled(true);
+ return true;
+ case Page_Host:
+ if ( lineHostName->text().isEmpty() ) {
+ button(QWizard::NextButton)->setEnabled(false);
+ return false;
+ }
+ if ( lineUserName->text().isEmpty() ) {
+ button(QWizard::NextButton)->setEnabled(false);
+ return false;
+ }
+ // if we get this far, all the fields are filled in
+ button(QWizard::NextButton)->setEnabled(true);
+ return true;
+ case Page_Auth:
+ button(QWizard::NextButton)->setEnabled(true);
+ return true;
+ case Page_System:
+ if ( comboBoxRestoreSystem->currentText().isEmpty() ) {
+ button(QWizard::NextButton)->setEnabled(false);
+ return false;
+ }
+ button(QWizard::NextButton)->setEnabled(true);
+ return true;
+ case Page_Finish:
+ button(QWizard::FinishButton)->setEnabled(true);
+ return true;
+ default:
+ button(QWizard::NextButton)->setEnabled(true);
+ return true;
+ }
+
+ return true;
+}
+
+void wizardRestore::slotCheckComplete()
+{
+ // Validate this page
+ validatePage();
+}
+
+void wizardRestore::initializePage(int page)
+{
+ switch (page) {
+ case Page_System:
+ comboBoxRestoreSystem->clear();
+
+ // Lets start the auth process
+ if ( radioUSBAuth->isChecked() ) {
+ if ( ! getUSBAuth() ) {
+ QMessageBox::critical(this, tr("No keys found!"),
+ tr("No Auth keys could be found on that memory stick!\n"
+ "Please try another USB stick or use password authentication."),
+ QMessageBox::Ok,
+ QMessageBox::Ok);
+ return;
+ }
+ } else {
+ if ( ! startPWAuth() ) {
+ QMessageBox::critical(this, tr("Connection failed!"),
+ tr("Could not connect to the backup server!\n"
+ "Please check that the server is reachable and verify your user/password."),
+ QMessageBox::Ok,
+ QMessageBox::Ok);
+ button(QWizard::NextButton)->setEnabled(false);
+ return;
+ }
+ }
+
+ if ( ! getSysList() ) {
+ QMessageBox::critical(this, tr("Connection failed!"),
+ tr("Could not connect to the backup server!\n"
+ "Please check your hostname and that the backup server is reachable."),
+ QMessageBox::Ok,
+ QMessageBox::Ok);
+ button(QWizard::NextButton)->setEnabled(false);
+ return;
+ }
+
+ break;
+ case Page_Finish:
+ plainTextEditSummary->clear();
+ plainTextEditSummary->appendPlainText(tr("Will restore from:"));
+ plainTextEditSummary->appendPlainText("Host: " + lineHostName->text());
+ plainTextEditSummary->appendPlainText("User: " + lineUserName->text());
+ plainTextEditSummary->appendPlainText("Target System: " + comboBoxRestoreSystem->currentText());
+ break;
+ }
+}
+
+bool wizardRestore::getUSBAuth()
+{
+ QStringList keys, dispKeys;
+
+ QProcess p;
+ p.start(SCRIPTDIR + "/load-usb-key.sh", QStringList());
+ while(p.state() == QProcess::Starting || p.state() == QProcess::Running) {
+ p.waitForFinished(200);
+ QCoreApplication::processEvents();
+ }
+ while (p.canReadLine())
+ keys << p.readLine().simplified();
+
+ // Did we find any key files?
+ if ( keys.isEmpty() )
+ return false;
+
+ // Only a single key? Lets use that
+ if ( keys.size() == 1 ) {
+ authKey = keys.at(0);
+ return true;
+ }
+
+ // More than one? Lets ask the user which one they want to use
+ ////////////////////
+
+ // Lets start by showing only the file-names
+ for (int i = 0; i < keys.size(); ++i)
+ dispKeys << keys.at(i).section("/", -1);
+
+ bool ok;
+ QString item = QInputDialog::getItem(this, tr("Select the SSH key to use"),
+ tr("Key File:"), dispKeys, 0, false, &ok);
+
+ if ( !ok || item.isEmpty() )
+ return false;
+
+ for (int i = 0; i < keys.size(); ++i)
+ if ( item == keys.at(i).section("/", -1) )
+ {
+ authKey = keys.at(i);
+ return true;
+ }
+
+
+ // We shouldn't get here
+ qDebug() << "Invalid end of getUSBAuth()";
+ return false;
+}
+
+bool wizardRestore::startPWAuth()
+{
+ QString cmd = "xterm -e \""+SCRIPTDIR+"/setup-ssh-keys.sh " + \
+ lineUserName->text() + \
+ " " + lineHostName->text() + \
+ " " +QString::number(spinPort->value()) + "\"";
+ system(cmd.toUtf8());
+
+ if ( QFile::exists("/tmp/.ssh-auth-failed") )
+ return false;
+
+ // Looks like auth worked!
+ return true;
+}
+
+bool wizardRestore::getSysList()
+{
+ sysList.clear();
+ comboBoxRestoreSystem->clear();
+
+ qDebug() << lineUserName->text() << lineHostName->text() << authKey;
+
+ QStringList propList;
+ QProcess p;
+ p.start(SCRIPTDIR + "/get-zfs-restore-list.sh", QStringList() << lineUserName->text() << lineHostName->text() << QString::number(spinPort->value()) << authKey );
+ while(p.state() == QProcess::Starting || p.state() == QProcess::Running) {
+ p.waitForFinished(200);
+ QCoreApplication::processEvents();
+ }
+ while (p.canReadLine())
+ propList << p.readLine().simplified();
+
+ if ( p.exitStatus() == QProcess::CrashExit || p.exitCode() != 0 )
+ return false;
+
+ // Lets start by showing only the systemNames
+ for (int i = 0; i < propList.size(); ++i) {
+ if ( ! propList.at(i).startsWith(".lp-props-" ) )
+ continue;
+ comboBoxRestoreSystem->addItem(propList.at(i).section("#", -1));
+ sysList << propList.at(i);
+ }
+
+ return true;
+}
+
View
42 src-qt4/pc-installgui/wizardRestore.h
@@ -0,0 +1,42 @@
+
+#ifndef WIZARDRESTORE_H
+#define WIZARDRESTORE_H
+
+#include "ui_wizardRestore.h"
+#include <qstring.h>
+
+class wizardRestore : public QWizard, private Ui::wizardRestore
+{
+ Q_OBJECT
+
+public:
+ wizardRestore() : QWizard()
+ {
+ setupUi(this);
+ }
+ void programInit();
+ virtual void initializePage(int);
+
+public slots:
+
+protected:
+
+private slots:
+ virtual void accept();
+ void slotClose();
+ void slotCheckComplete();
+
+private:
+ bool getUSBAuth();
+ bool startPWAuth();
+ bool getSysList();
+ bool validatePage();
+ enum { Page_Intro, Page_Host, Page_Auth, Page_System, Page_Finish };
+ QStringList sysList;
+ QString authKey;
+
+signals:
+ void saved(QStringList);
+
+} ;
+#endif // WIZARDRESTORE_H
View
794 src-qt4/pc-installgui/wizardRestore.ui
@@ -0,0 +1,794 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>wizardRestore</class>
+ <widget class="QWizard" name="wizardRestore">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>527</width>
+ <height>363</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string notr="true">Restore Wizard</string>
+ </property>
+ <property name="windowIcon">
+ <iconset resource="sysinstaller.qrc">
+ <normaloff>:/modules/images/lifepreserver.png</normaloff>:/modules/images/lifepreserver.png</iconset>
+ </property>
+ <property name="wizardStyle">
+ <enum>QWizard::ClassicStyle</enum>
+ </property>
+ <widget class="QWizardPage" name="Page_Intro">
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0" rowspan="3">
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>55</width>
+ <height>55</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="sysinstaller.qrc">:/modules/images/lifepreserver.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_10">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>258</width>
+ <height>18</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="label">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>This wizard will walk you though the process of restoring your system from a Life-Preserver backup. Click next to begin. </string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" rowspan="2">
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>18</width>
+ <height>178</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1">
+ <spacer name="verticalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::MinimumExpanding</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>228</width>
+ <height>163</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWizardPage" name="Page_Host">
+ <layout class="QGridLayout" name="gridLayout_2">
+ <item row="0" column="0" rowspan="4">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="label_13">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>55</width>
+ <height>55</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="sysinstaller.qrc">:/modules/images/network.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_9">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>118</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </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>268</width>
+ <height>18</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>To get started please enter the hostname, username and port of your backup server.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <spacer name="verticalSpacer_3">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>288</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="2" rowspan="2">
+ <spacer name="horizontalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>18</width>
+ <height>198</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="1">
+ <widget class="QGroupBox" name="groupReplicate">
+ <property name="title">
+ <string>Backup Server</string>
+ </property>
+ <property name="checkable">
+ <bool>false</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_9">
+ <item row="0" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_8">
+ <item>
+ <widget class="QLabel" name="label_22">
+ <property name="text">
+ <string>Host Name</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineHostName"/>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_7">
+ <item>
+ <widget class="QLabel" name="label_23">
+ <property name="text">
+ <string>User Name</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineUserName"/>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="0">
+ <layout class="QHBoxLayout" name="horizontalLayout_4">
+ <item>
+ <widget class="QLabel" name="label_4">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>SSH Port</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <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>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QSpinBox" name="spinPort">
+ <property name="maximum">
+ <number>999999</number>
+ </property>
+ <property name="value">
+ <number>22</number>
+ </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>
+ </layout>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <spacer name="verticalSpacer_4">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>218</width>
+ <height>97</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWizardPage" name="Page_Auth">
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0" rowspan="4">
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QLabel" name="label_12">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>55</width>
+ <height>55</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="sysinstaller.qrc">:/modules/images/add_user.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_7">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>78</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1" colspan="2">
+ <spacer name="verticalSpacer_6">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>326</width>
+ <height>18</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1" colspan="3">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>If you saved your Life-Preserver key onto a USB stick, select it below, otherwise you may wish to use password authentication.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <spacer name="verticalSpacer_11">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="1" colspan="2">
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Server Authentication</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
+ <widget class="QRadioButton" name="radioUSBAuth">
+ <property name="text">
+ <string>Use USB key</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0">
+ <widget class="QRadioButton" name="radioPasswordAuth">
+ <property name="text">
+ <string>Use password authentication</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="3">
+ <spacer name="horizontalSpacer_7">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>18</width>
+ <height>128</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="4" column="2">
+ <spacer name="verticalSpacer_8">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>299</width>
+ <height>17</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWizardPage" name="Page_System">
+ <layout class="QGridLayout" name="gridLayout_6">
+ <item row="0" column="1">
+ <spacer name="verticalSpacer_13">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>299</width>
+ <height>18</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="label_15">
+ <property name="text">
+ <string>The following systems are backed up on this server, select the one you wish to restore. </string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" rowspan="5">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>18</width>
+ <height>197</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1">
+ <spacer name="verticalSpacer_14">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>299</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="3" column="1">
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Restore System Selection</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_5">
+ <item row="0" column="0">
+ <widget class="QComboBox" name="comboBoxRestoreSystem"/>
+ </item>
+ <item row="0" column="1">
+ <spacer name="horizontalSpacer_9">
+ <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>
+ </widget>
+ </item>
+ <item row="4" column="1">
+ <spacer name="verticalSpacer_16">
+ <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="5" column="1">
+ <spacer name="verticalSpacer_15">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>299</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="0" rowspan="6">
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <widget class="QLabel" name="label_14">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>55</width>
+ <height>55</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="sysinstaller.qrc">:/modules/images/systemsettings.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_12">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>78</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWizardPage" name="Page_Finish">
+ <layout class="QGridLayout" name="gridLayout_7">
+ <item row="3" column="1">
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>Restore Summary</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout_8">
+ <item row="0" column="0">
+ <widget class="QPlainTextEdit" name="plainTextEditSummary">
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="0" column="0" rowspan="6">
+ <layout class="QVBoxLayout" name="verticalLayout_5">
+ <item>
+ <widget class="QLabel" name="label_17">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>55</width>
+ <height>55</height>
+ </size>
+ </property>
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap resource="sysinstaller.qrc">:/modules/images/systemsettings.png</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer_17">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>78</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="1">
+ <spacer name="verticalSpacer_18">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>238</width>
+ <height>18</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="1" column="1">
+ <widget class="QLabel" name="label_18">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>The system is ready to be restored, click Finish to continue.</string>
+ </property>
+ <property name="wordWrap">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="2" rowspan="5">
+ <spacer name="horizontalSpacer_5">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>18</width>
+ <height>197</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="1">
+ <spacer name="verticalSpacer_19">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>248</width>
+ <height>13</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="5" column="1">
+ <spacer name="verticalSpacer_20">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>218</width>
+ <height>107</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ <resources>
+ <include location="sysinstaller.qrc"/>
+ </resources>
+ <connections/>
+</ui>
View
4 src-qt4/port-files/pkg-plist
@@ -42,6 +42,9 @@ bin/flashpluginctl
bin/xorg-startupcheck
sbin/PCDMd
sbin/PCDM-xloop
+share/pcbsd/pc-installgui/load-usb-key.sh
+share/pcbsd/pc-installgui/get-zfs-restore-list.sh
+share/pcbsd/pc-installgui/setup-ssh-keys.sh
share/pcbsd/xstartup/enable-ibus.sh
share/pcbsd/xstartup/checkupdater.sh
share/pcbsd/xstartup/life-preserver.sh
@@ -2609,6 +2612,7 @@ include/pcbsd-ui.h
@dirrm share/pcbsd/pc-controlpanel/items
@dirrm share/pcbsd/pc-controlpanel/icons
@dirrm share/pcbsd/pc-controlpanel
+@dirrm share/pcbsd/pc-installgui
@dirrm share/pcbsd/pc-netmanager/pics
@dirrm share/pcbsd/pc-netmanager
@dirrm share/pcbsd/pc-sounddetect
View
2  src-sh/pc-sysinstall/backend/functions-zfsrestore.sh
@@ -101,7 +101,7 @@ restore_zfs_from_remote()
# Lets start pulling our ZFS replication
zSEND="ssh -p $SSHPORT ${SSHKEY} ${SSHUSER}@${SSHHOST} zfs send -Rv ${ZFSDATASET}@${lastSNAP}"
zRECV="zfs receive -evuF ${ZPOOLNAME}"
- $zSEND | $zRECV
+ $zSEND | $zRECV >/dev/null 2>/dev/null
if [ $? -ne 0 ] ; then
exit_err "Failed ZFS send / receive"
fi

No commit comments for this range

Something went wrong with that request. Please try again.