From 21dff37461c8a7655b176b15f6dd7b55deac131f Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Wed, 22 Jul 2020 18:27:33 -0500 Subject: Add initial MIPS port, sans automatic partitioner MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Help with the automatic partitioner by parties interested in the MIPS ports of Adélie (and/or Alpine and/or postmarketOS) would be very desirable. I'm only currently aware myself of how to partition SGI MIPS64 machines. My gut tells me we probably need the `subarch` system like for PPC64, but I am not sure how non-SGI MIPS64 machines need to be partitioned. --- hscript/meta.cc | 16 ++++++++++++++++ ui/qt5/horizonwizard.cc | 25 +++++++++++++++++++++++++ ui/qt5/horizonwizard.hh | 4 ++++ 3 files changed, 45 insertions(+) diff --git a/hscript/meta.cc b/hscript/meta.cc index d79f3f5..1227e60 100644 --- a/hscript/meta.cc +++ b/hscript/meta.cc @@ -722,6 +722,18 @@ const std::string my_arch(const Horizon::Script *script) { return "pmmx"; # elif defined(__x86_64__) return "x86_64"; +# elif defined(__mips64) +# if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + return "mips64el"; +# else /* If byte order is not defined, default to big endian. */ + return "mips64"; +# endif +# elif defined(__mips__) +# if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + return "mipsel"; +# else /* If byte order is not defined, default to big endian. */ + return "mips"; +# endif # else # error Unknown architecture. # endif @@ -755,6 +767,10 @@ bool Bootloader::validate() const { const static std::set valid_x86 = {"grub-bios", "grub-efi"}; return valid_x86.find(this->value()) != valid_x86.end(); + } else if(arch == "mips64" || arch == "mips" || + arch == "mips64el" || arch == "mipsel") { + const static std::set valid_mips = {}; + return valid_mips.find(this->value()) != valid_mips.end(); } else { output_error(pos, "bootloader: unknown architecture", arch); return false; diff --git a/ui/qt5/horizonwizard.cc b/ui/qt5/horizonwizard.cc index 6c2ea9e..d87e041 100644 --- a/ui/qt5/horizonwizard.cc +++ b/ui/qt5/horizonwizard.cc @@ -352,6 +352,18 @@ HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent) { arch = pmmx; # elif defined(__x86_64__) arch = x86_64; +# elif defined(__mips64) +# if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + arch = mips64el; +# else /* If byte order is not defined, default to big endian. */ + arch = mips64; +# endif +# elif defined(__mips__) +# if defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ + arch = mipsel; +# else /* If byte order is not defined, default to big endian. */ + arch = mips; +# endif # else # error You are attempting to compile the Installation Environment UI \ on an unknown architecture. Please add a definition to horizonwizard.hh, a \ @@ -551,6 +563,19 @@ QString HorizonWizard::toHScript() { lines << "signingkey https://distfiles.adelielinux.org/adelie/keys/x86-1@packages.adelielinux.org.pub"; lines << "signingkey https://distfiles.adelielinux.org/adelie/keys/x86-2@packages.adelielinux.org.pub"; break; + case mips64: + lines << "arch mips64"; + /* XXX: MIPS signing keys are needed before we ship anything. */ + break; + case mips: + lines << "arch mips"; + break; + case mips64el: + lines << "arch mips64el"; + break; + case mipsel: + lines << "arch mipsel"; + break; case UnknownCPU: /* no arch line. hopefully it's run on the target. */ break; diff --git a/ui/qt5/horizonwizard.hh b/ui/qt5/horizonwizard.hh index bf53ae0..8af9df7 100644 --- a/ui/qt5/horizonwizard.hh +++ b/ui/qt5/horizonwizard.hh @@ -96,6 +96,10 @@ public: enum Arch { aarch64, armv7, + mips, + mips64, + mipsel, + mips64el, pmmx, ppc, ppc64, -- cgit v1.2.3-60-g2f50