summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/qt5/horizonwizard.cc75
-rw-r--r--ui/qt5/horizonwizard.hh18
2 files changed, 93 insertions, 0 deletions
diff --git a/ui/qt5/horizonwizard.cc b/ui/qt5/horizonwizard.cc
index 2a8c9cc..1edf599 100644
--- a/ui/qt5/horizonwizard.cc
+++ b/ui/qt5/horizonwizard.cc
@@ -276,6 +276,27 @@ HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent) {
#ifdef HAS_INSTALL_ENV
interfaces = probe_ifaces();
tain_now_set_stopwatch_g();
+
+# if defined(__powerpc64__)
+ arch = ppc64;
+# elif defined(__powerpc__)
+ arch = ppc;
+# elif defined(__aarch64__)
+ arch = aarch64;
+# elif defined(__arm__)
+ arch = armv7;
+# elif defined(__i386__)
+ arch = pmmx;
+# elif defined(__x86_64__)
+ arch = x86_64;
+# else
+# error You are attempting to compile the Installation Environment UI \
+on an unknown architecture. Please add a definition to horizonwizard.hh, a \
+setting in this preprocessor block, and a case statement for the automatic \
+partitioner to continue. You may also wish to add an option to archpage.cc.
+# endif
+#else /* !HAS_INSTALL_ENV */
+ arch = UnknownCPU;
#endif /* HAS_INSTALL_ENV */
}
@@ -319,6 +340,60 @@ QString HorizonWizard::toHScript() {
lines << ("hostname " + field("hostname").toString());
+ switch(arch) {
+ case aarch64:
+ lines << "arch aarch64";
+ break;
+ case armv7:
+ lines << "arch armv7";
+ break;
+ case pmmx:
+ lines << "arch pmmx";
+ break;
+ case ppc:
+ lines << "arch ppc";
+ break;
+ case ppc64:
+ lines << "arch ppc64";
+ break;
+ case x86_64:
+ lines << "arch x86_64";
+ break;
+ case UnknownCPU:
+ /* no arch line. hopefully it's run on the target. */
+ break;
+ }
+
+ if(auto_erase_disk.empty()) {
+ lines << part_lines;
+ } else {
+ /* XXX TODO: examples for thoughts on auto-partition setups are in
+ * architecture-specific comments below */
+ switch(arch) {
+ case aarch64:
+ /* Do GPT stuff */
+ break;
+ case armv7:
+ /* Run away */
+ break;
+ case pmmx:
+ /* Do MBR stuff */
+ break;
+ case ppc:
+ /* Do APM stuff */
+ break;
+ case ppc64:
+ /* Figure stuff out */
+ break;
+ case x86_64:
+ /* Do EFI */
+ break;
+ case UnknownCPU:
+ /* Probably MBR, as it's the most common. */
+ break;
+ }
+ }
+
switch(this->pkgtype) {
case Mobile:
lines << "pkginstall powerdevil upower";
diff --git a/ui/qt5/horizonwizard.hh b/ui/qt5/horizonwizard.hh
index d7ce52d..637d12b 100644
--- a/ui/qt5/horizonwizard.hh
+++ b/ui/qt5/horizonwizard.hh
@@ -74,6 +74,16 @@ public:
QString mac;
};
+ enum Arch {
+ aarch64,
+ armv7,
+ pmmx,
+ ppc,
+ ppc64,
+ x86_64,
+ UnknownCPU
+ };
+
enum PackageType {
Standard,
Mobile,
@@ -105,6 +115,14 @@ public:
std::string mirror_domain;
/*! The version of Adélie to install. Typically "1.0". */
std::string version;
+ /*! The architecture being installed. */
+ Arch arch;
+ /*! The disk to erase and partition based on the system. */
+ std::string auto_erase_disk;
+ /*! The HorizonScript lines describing what to do about partitioning.
+ * If auto_erase_disk is set, this is not used.
+ * Otherwise, this should have any relevant disklabel/partition/fs etc. */
+ QStringList part_lines;
#ifdef NON_LIBRE_FIRMWARE
/*! Determines whether firmware will be installed. */
bool firmware;