From c90f8aa823c55cc6ac6758733e6383c7fc168cfe Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 8 Aug 2020 21:25:42 +0000 Subject: user/horizon: Update to latest git --- user/horizon/APKBUILD | 9 +- user/horizon/git.patch | 660 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 666 insertions(+), 3 deletions(-) create mode 100644 user/horizon/git.patch diff --git a/user/horizon/APKBUILD b/user/horizon/APKBUILD index dcc9d9bf7..3a7e89a8e 100644 --- a/user/horizon/APKBUILD +++ b/user/horizon/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: A. Wilcox pkgname=horizon pkgver=0.9.3 -pkgrel=0 +pkgrel=1 pkgdesc="Installation tools for Adélie Linux" url="https://horizon.adelielinux.org/" arch="all" @@ -17,7 +17,9 @@ makedepends="bcnm-dev boost-dev cmake curl-dev eudev-dev libarchive-dev libcap-dev libx11-dev libxkbfile-dev qt5-qtbase-dev" subpackages="$pkgname-image $pkgname-dbg $pkgname-dev $pkgname-doc $pkgname-qt5 $pkgname-tools $pkgname-wizard $pkgname-boot" -source="https://distfiles.adelielinux.org/source/horizon-$pkgver.tar.xz" +source="https://distfiles.adelielinux.org/source/horizon-$pkgver.tar.xz + git.patch + " build() { if [ "$CBUILD" != "$CHOST" ]; then @@ -146,4 +148,5 @@ GLOBALS "$subpkgdir"/usr/share/xsessions/horizon.desktop } -sha512sums="99c1d939abc33c4a072712e75c6c8ada16deb1fe59b9da839dffd695a0d40dbf48499cc00751285300127a7fc701e8e1c434e9f8a222f1981ccbebd6ee72e43e horizon-0.9.3.tar.xz" +sha512sums="99c1d939abc33c4a072712e75c6c8ada16deb1fe59b9da839dffd695a0d40dbf48499cc00751285300127a7fc701e8e1c434e9f8a222f1981ccbebd6ee72e43e horizon-0.9.3.tar.xz +7c7c4297ae8d0d879a01ac38c0699dd9338e9b9675a0804dc3ec915e98900343e001d0a0558fcaccbf9f5cfafbf9ae869c7ec194d1529683b5874941a77b0125 git.patch" diff --git a/user/horizon/git.patch b/user/horizon/git.patch new file mode 100644 index 000000000..3f15448bf --- /dev/null +++ b/user/horizon/git.patch @@ -0,0 +1,660 @@ +diff --git a/devel/script/2_keys.xml b/devel/script/2_keys.xml +index 4438881..9ffeba8 100644 +--- a/devel/script/2_keys.xml ++++ b/devel/script/2_keys.xml +@@ -655,7 +655,7 @@ svcenable udev-trigger boot + The <literal>svcenable</literal> Key — Typical Desktop + + svcenable dbus +-svcenable consolekit ++svcenable elogind + svcenable sddm + + This configures the target computer to start up a display manager and its required daemons during system boot, enabling graphical logins. +diff --git a/devel/script/4_json.xml b/devel/script/4_json.xml +new file mode 100644 +index 0000000..b0234a4 +--- /dev/null ++++ b/devel/script/4_json.xml +@@ -0,0 +1,451 @@ ++ ++ ++ JSON Schema ++ The Horizon system supports converting JSON files to HorizonScript. This chapter describes the JSON schema supported by the Horizon JSON tooling. ++ It is important to note that not all features of Horizon are available from JSON. For more advanced use cases, consider writing HorizonScript files directly. However, it is felt that supporting JSON interchange is important for interoperability with external systems. ++
++ Overall document structure ++ There are two document formats supported by the Horizon JSON tooling. The most common is a simple structure where a single root object contains the Horizon JSON keys. The second, and less common, describes multiple configurations called "images" in a single JSON file. The root object contains a single key/value pair, images, which is an array of objects containing Horizon JSON keys. See for more information. ++
++
++ Supported keys ++ ++
++ <literal>hostname</literal> ++ ++ Format ++ String ++ ++ ++ Short Description ++ The device's host name. ++ ++ ++ Corresponding HorizonScript key ++ hostname ++ ++
++
++ <literal>packages</literal> ++ ++ Format ++ Array of String ++ ++ ++ Short Description ++ A list of packages to install to the device. ++ ++ ++ Corresponding HorizonScript key ++ pkginstall ++ ++
++
++ <literal>rootpw</literal> ++ ++ Format ++ String ++ ++ ++ Short Description ++ The encrypted root password for the device. ++ ++ ++ Corresponding HorizonScript key ++ rootpw ++ ++
++
++ <literal>arch</literal> ++ ++ Format ++ String ++ ++ ++ Short Description ++ The device's CPU architecture. ++ ++ ++ Corresponding HorizonScript key ++ arch ++ ++
++
++ <literal>language</literal> ++ ++ Format ++ String ++ ++ ++ Short Description ++ The language to use for the device's interface. ++ ++ ++ Corresponding HorizonScript key ++ language ++ ++
++
++ <literal>keymap</literal> ++ ++ Format ++ String ++ ++ ++ Short Description ++ The keyboard map to use for the device's hardware inputs. ++ ++ ++ Corresponding HorizonScript key ++ keymap ++ ++
++
++ <literal>firmware</literal> ++ ++ Format ++ String or Boolean ++ ++ ++ Short Description ++ Determines whether or not the device will have non-free firmware installed. ++ ++ ++ Corresponding HorizonScript key ++ firmware ++ ++
++
++ <literal>services</literal> ++ ++ Format ++ Array of Object ++ ++ ++ Short Description ++ Specifies additional services to start on device boot. ++ ++ ++ Object Structure ++ ++ ++ ++ service ++ (String) The name of the service to start. ++ ++ ++ runlevel ++ (String) The runlevel that the service should start under. If no runlevel is specified, default is used. ++ ++ ++ ++ ++ ++ Corresponding HorizonScript key ++ svcenable ++ ++
++
++ <literal>netconfig</literal> ++ ++ Format ++ String ++ ++ ++ Short Description ++ Determines the network configuration system used on the device. ++ ++ ++ Corresponding HorizonScript key ++ netconfigtype ++ ++
++
++ <literal>netaddresses</literal> ++ ++ Format ++ Array of Object ++ ++ ++ Short Description ++ Specifies the device's network addressing configuration. ++ ++ ++ Object Structure ++ ++ ++ ++ id ++ (String) This connection's identifier. This field is for operator reference only - it will not appear in the HorizonScript or in the device's configuration. ++ ++ ++ interface ++ (String) The network interface to use for this address. ++ ++ ++ addr-type ++ (String) The type of this address: none to bring up the interface without an address (common for bridging), dhcp for DHCP, or static for static addressing. ++ ++ ++ address ++ (Object) The network address. Only valid if addr-type is static. ++ ++ ++ If static addressing is desired, the address object is described below. ++ ++ ++ ip-address ++ (String) The IPv4 or IPv6 address for this connection. ++ ++ ++ net-prefix ++ (Number) The network prefix for this connection. Valid values are 1-32 for IPv4, and 1-128 for IPv6. ++ ++ ++ gateway ++ (String) The IPv4 or IPv6 address for the gateway for this connection. ++ ++ ++ ++ ++ ++ Corresponding HorizonScript key ++ netaddress ++ ++
++ ++
++ <literal>nameservers</literal> ++ ++ Format ++ Array of String ++ ++ ++ Short Description ++ IP addresses used for Domain Name System (DNS) resolution. ++ ++ ++ Corresponding HorizonScript key ++ nameserver ++ ++
++
++ <literal>access-points</literal> ++ ++ Format ++ Array of Object ++ ++ ++ Short Description ++ Specifies the device's wireless networking configuration. ++ ++ ++ Object Structure ++ ++ ++ ++ interface ++ (String) The wireless network interface to use for this access point. ++ ++ ++ ssid ++ (String) The SSID for this access point. ++ ++ ++ security ++ (String) The security type to use for this access point: none, wep, or wpa. ++ ++ ++ password ++ (String) The shared secret to use for authenticating this wireless link. ++ ++ ++ ++ ++ ++ Corresponding HorizonScript key ++ netssid ++ ++
++
++ <literal>timezone</literal> ++ ++ Format ++ String ++ ++ ++ Short Description ++ The time zone to use on the device. ++ ++ ++ Corresponding HorizonScript key ++ timezone ++ ++
++
++ <literal>repositories</literal> ++ ++ Format ++ Array of String ++ ++ ++ Short Description ++ The APK repositories to use for package installation on the device. ++ ++ ++ Corresponding HorizonScript key ++ repository ++ ++
++
++ <literal>signingkeys</literal> ++ ++ Format ++ Array of String ++ ++ ++ Short Description ++ The location of the signing key(s) used by the device's APK repositories. ++ ++ ++ Corresponding HorizonScript key ++ signingkey ++ ++
++
++ <literal>users</literal> ++ ++ Format ++ Array of Object ++ ++ ++ Short Description ++ Specifies the device's user accounts. ++ ++ ++ Object Structure ++ ++ ++ ++ username ++ (String) The login name of this account. ++ ++ ++ alias ++ (String) The friendly name/GECOS of this account. ++ ++ ++ passphrase ++ (String) The encrypted passphrase to use to authenticate to this account. See for information about the format of passphrase. ++ ++ ++ groups ++ (String) Comma-separated list of this account's member groups. ++ ++ ++ ++ ++ ++ Corresponding HorizonScript keys ++ username, useralias, userpw, usergroups ++ ++
++
++
++ Examples ++ ++ ++ Basic example of Horizon JSON file ++ ++{ ++ "hostname": "horizon-json-testmachine.adelielinux.org", ++ "packages": ["adelie-base-posix", "easy-kernel", "easy-kernel-modules", ++ "netifrc", "openrc", "s6-linux-init"], ++ "rootpw": "...", ++ "root": "/dev/sda1", ++ "netaddresses": [{"id":"eth0", "interface":"eth0", "addr-type":"dhcp"}], ++ "nameservers": ["9.9.9.9"], ++ "timezone": "America/Chicago", ++ "repositories": ["https://distfiles.adelielinux.org/adelie/1.0/system", ++ "https://distfiles.adelielinux.org/adelie/1.0/user"], ++ "signingkeys": ["/etc/apk/keys/powerpc-1@packages.adelielinux.org.pub", ++ "/etc/apk/keys/powerpc-2@packages.adelielinux.org.pub"] ++} ++ ++ ++ ++ Example of multi-configuration Horizon JSON file ++ ++{"images": ++ [ ++ {"name": "Test Image", ++ "hostname": "horizon-json-testmachine.adelielinux.org", ++ "packages": ["adelie-base-posix", "easy-kernel", "easy-kernel-modules", ++ "netifrc", "openrc", "s6-linux-init"], ++ "rootpw": "...", ++ "root": "/dev/sda1", ++ "arch": "ppc64", ++ "language": "en_GB.UTF-8", ++ "keymap": "us", ++ "firmware": false, ++ "netconfig": "netifrc", ++ "netaddresses": [{"id":"eth0", "interface":"eth0", "addr-type":"dhcp"}], ++ "nameservers": ["9.9.9.9"], ++ "timezone": "America/Chicago", ++ "repositories": ["https://distfiles.adelielinux.org/adelie/1.0/system", ++ "https://distfiles.adelielinux.org/adelie/1.0/user"], ++ "signingkeys": ["/etc/apk/keys/powerpc-1@packages.adelielinux.org.pub", ++ "/etc/apk/keys/powerpc-2@packages.adelielinux.org.pub"] ++ } ++ ] ++} ++ ++ ++ ++
++
+diff --git a/devel/script/script.xml b/devel/script/script.xml +index f8c1a65..bf82a06 100644 +--- a/devel/script/script.xml ++++ b/devel/script/script.xml +@@ -4,6 +4,7 @@ + + + ++ + ]> + + +@@ -11,8 +12,8 @@ + + A.WilcoxAdélie Linux + +- Specification for HorizonScript (Horizon release 1.0) +- 2020-06-13 ++ Specification for HorizonScript (Horizon release 1.0) + JSON specification 1.0 ++ 2020-07-20 + + 20192020 + Adélie Linux +@@ -26,4 +27,5 @@ + &chap1; + &chap2; + &chap3; ++ &chap4; + +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/hscript/script.cc b/hscript/script.cc +index 20ccbe5..6e436b7 100644 +--- a/hscript/script.cc ++++ b/hscript/script.cc +@@ -225,7 +225,12 @@ Script *Script::load(std::istream &sstream, const ScriptOptions &opts, + char nextline[SCRIPT_LINE_MAX]; + const std::string delim(" \t"); + int errors = 0, warnings = 0; +- std::string curr_name = fs::canonical(fs::path(name)); ++ std::string curr_name; ++ if(name == "/dev/stdin") { ++ curr_name = ""; ++ } else { ++ curr_name = fs::canonical(fs::path(name)); ++ } + std::set seen = {curr_name}; + bool inherit = false; + std::istream *my_stream = &sstream; +@@ -311,7 +316,7 @@ Script *Script::load(std::istream &sstream, const ScriptOptions &opts, + } + + if(my_stream->fail() && !my_stream->eof()) { +- output_error("installfile:" + std::to_string(lineno + 1), ++ output_error(curr_name + ":" + std::to_string(lineno + 1), + "line exceeds maximum length", + "Maximum line length is " + + std::to_string(SCRIPT_LINE_MAX)); +@@ -319,14 +324,14 @@ Script *Script::load(std::istream &sstream, const ScriptOptions &opts, + } + + if(my_stream->bad() && !my_stream->eof()) { +- output_error("installfile:" + std::to_string(lineno), ++ output_error(curr_name + ":" + std::to_string(lineno), + "I/O error while reading installfile", ""); + errors++; + } + + /* Ensure all required keys are present. */ + #define MISSING_ERROR(key) \ +- output_error(name, "expected value for key '" + std::string(key) + "'",\ ++ output_error(curr_name, "expected value for key '" + std::string(key) + "'",\ + "this key is required");\ + errors++; + +@@ -349,7 +354,7 @@ Script *Script::load(std::istream &sstream, const ScriptOptions &opts, + } + #undef MISSING_ERROR + +- output_log("parser", "0", name, ++ output_log("parser", "0", curr_name, + std::to_string(errors) + " error(s), " + + std::to_string(warnings) + " warning(s).", ""); + +diff --git a/ui/qt5/horizonwizard.cc b/ui/qt5/horizonwizard.cc +index 6c2ea9e..92b81db 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; +@@ -608,13 +633,13 @@ QString HorizonWizard::toHScript() { + lines << "pkginstall adelie-base-posix firefox-esr libreoffice " + "thunderbird vlc kde x11 bluez sddm"; + lines << "svcenable bluetooth"; +- lines << "svcenable consolekit"; ++ lines << "svcenable elogind"; + lines << "svcenable sddm"; + break; + case Compact: + lines << "pkginstall adelie-base netsurf featherpad lxqt-desktop " + "abiword gnumeric sddm xorg-apps xorg-drivers xorg-server"; +- lines << "svcenable consolekit"; ++ lines << "svcenable elogind"; + lines << "svcenable sddm"; + break; + case TextOnly: +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