summaryrefslogtreecommitdiff
path: root/ui/qt5/horizonwizard.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-19 17:35:05 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-19 17:35:05 -0600
commitb0f8b8e769b433a943b14e70ea4522c537eb8c29 (patch)
treeba3d81502fd24f5e44417873434f09df6d1b7c6f /ui/qt5/horizonwizard.cc
parente6c49ef39a795939585f7a19cdf6bbdcc62975cc (diff)
downloadhorizon-b0f8b8e769b433a943b14e70ea4522c537eb8c29.tar.gz
horizon-b0f8b8e769b433a943b14e70ea4522c537eb8c29.tar.bz2
horizon-b0f8b8e769b433a943b14e70ea4522c537eb8c29.tar.xz
horizon-b0f8b8e769b433a943b14e70ea4522c537eb8c29.zip
Qt UI: Early handling of architecture (for the purposes of auto-partitioning and RE)
Diffstat (limited to 'ui/qt5/horizonwizard.cc')
-rw-r--r--ui/qt5/horizonwizard.cc75
1 files changed, 75 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";