diff --git a/DEBIAN/control b/DEBIAN/control index 92f91f80..08c9ce3a 100644 --- a/DEBIAN/control +++ b/DEBIAN/control @@ -1,10 +1,10 @@ Package: system-installer -Version: 2.5.0 +Version: 2.5.5 Maintainer: Thomas Castleman Homepage: https://github.com/drauger-os-development/system-installer Section: admin Architecture: amd64 Priority: important -Depends: arch-install-scripts, python3 (>=3.6.7-1~18.04), bash, gir1.2-gtk-3.0 (>=3.24.12-1ubuntu1), coreutils (>=8.28-1ubuntu1), apt (>=1.6.11), squashfs-tools (>=1:4.3-6ubuntu0.18.04.1), zenity (>=3.28.1-1), grub2-common (>=2.02-2ubuntu8.13), initramfs-tools (>=0.130ubuntu3.8), systemd (>=237-3ubuntu10.24), locales (>=2.27-3ubuntu1), procps (>=2:3.3.12-3ubuntu1.1), grep (>=3.1-2), keyboard-configuration, util-linux (>=2.34-0.1ubuntu2), python3-parted (>=3.11.2), python3-psutil (>=5.5.0), python3-apt (>=2.0.0), python3-urllib3 (>=1.26.5-1~exp1), python3-gnupg (>=0.4.5), python3-xmltodict (>=0.11.0) +Depends: arch-install-scripts, python3 (>=3.6.7-1~18.04), bash, gir1.2-gtk-3.0 (>=3.24.12-1ubuntu1), coreutils (>=8.28-1ubuntu1), apt (>=1.6.11), squashfs-tools (>=1:4.3-6ubuntu0.18.04.1), zenity (>=3.28.1-1), grub2-common (>=2.02-2ubuntu8.13), initramfs-tools (>=0.130ubuntu3.8), systemd (>=237-3ubuntu10.24), locales (>=2.27-3ubuntu1), procps (>=2:3.3.12-3ubuntu1.1), grep (>=3.1-2), keyboard-configuration, util-linux (>=2.34-0.1ubuntu2), python3-parted (>=3.11.2), python3-psutil (>=5.5.0), python3-apt (>=2.0.0), python3-urllib3 (>=1.26.5-1~exp1), python3-gnupg (>=0.4.5), python3-xmltodict (>=0.11.0), python3-dnspython Description: System Installer for Drauger OS System Installer for Drauger OS diff --git a/build.conf b/build.conf new file mode 100644 index 00000000..46da63bc --- /dev/null +++ b/build.conf @@ -0,0 +1,9 @@ +# This file is for defining some simple build settings +# start a line with a hashtag (#) to denote a comment +# +# ALL URLs should be rsync URLS +# +# META_URL contains the meta package for the kernel +META_URL=rsync://rsync.draugeros.org/apt/pool/main/l/linux-meta +# PACK_URL contains the actual kernel image and header packages +PACK_URL=rsync://rsync.draugeros.org/apt/pool/main/l/linux-upstream diff --git a/build.sh b/build.sh index 36723ad6..b999b1ca 100755 --- a/build.sh +++ b/build.sh @@ -5,6 +5,9 @@ ARCH=$(cat DEBIAN/control | grep 'Architecture: '| sed 's/Architecture: //g') FOLDER="$PAK\_$VERSION\_$ARCH" FOLDER=$(echo "$FOLDER" | sed 's/\\//g') OPTIONS="$1" +SETTINGS=$(grep -v "^#" build.conf | sed 's/=/ /g') +META_URL=$(echo "$SETTINGS" | grep "META_URL" | awk '{print $2}') +PACK_URL=$(echo "$SETTINGS" | grep "PACK_URL" | awk '{print $2}') mkdir ../"$FOLDER" ############################################################## # # @@ -19,8 +22,8 @@ mkdir ../"$FOLDER" if [ "$OPTIONS" != "--pool" ]; then cd usr/share/system-installer echo -e "\t###\tDOWNLOADING\t###\t" - rsync -vr rsync://rsync.draugeros.org/apt/pool/main/l/linux-upstream kernel - rsync -vr rsync://rsync.draugeros.org/apt/pool/main/l/linux-meta kernel + rsync -vr "$PACK_URL" kernel + rsync -vr "$META_URL" kernel echo -e "\t###\tDELETING CRUFT\t###\t" list=$(ls kernel) for each in $list; do @@ -115,6 +118,8 @@ fi rm "$base"/usr/bin/system-installer # delete C++ source from package rm "$FOLDER"/usr/bin/system-installer.cxx +# delete Python cache files +find "$FOLDER" -maxdepth 10 -type d -name __pycache__ -exec rm -rfv {} \; #build the shit dpkg-deb --build "$FOLDER" rm -rf "$FOLDER" diff --git a/development.md b/development.md index fde09f19..69255c82 100644 --- a/development.md +++ b/development.md @@ -17,7 +17,7 @@ The following are not required but may help out To install all of the dependencies at once, use ```bash - sudo apt install -y python3 gir1.2-gtk-3.0 p7zip-full python3-parted python3-gnupg arch-install-scripts coreutils squashfs-tools pylint + sudo apt install -y python3 gir1.2-gtk-3.0 p7zip-full python3-parted python3-dev python3-gnupg arch-install-scripts coreutils squashfs-tools pylint ``` # How to get started diff --git a/etc/system-installer/oem-install.json b/etc/system-installer/oem-install.json index 2751223e..1f8e9a5d 100644 --- a/etc/system-installer/oem-install.json +++ b/etc/system-installer/oem-install.json @@ -2,6 +2,7 @@ "LANG": "OEM", "TIME_ZONE": "OEM", "AUTO_PART": true, + "COMPAT_MODE": true, "ROOT": "OEM", "EFI": "OEM", "HOME": "OEM", diff --git a/etc/system-installer/settings.json b/etc/system-installer/settings.json index 6d05996e..b3123e53 100644 --- a/etc/system-installer/settings.json +++ b/etc/system-installer/settings.json @@ -7,9 +7,11 @@ "upload": "rsync://rsync.draugeros.org/reports-upload" }, "ping servers": [ - "https://apt.draugeros.org", - "https://ubuntu.com", - "https://debian.org" + "draugeros.org", + "ubuntu.com", + "debian.org", + "google.com", + "example.com" ], "ping count": 2, "partitioning": { @@ -46,6 +48,8 @@ "mdswh": 128 } }, - "run_post_oem": ["/usr/share/drauger-welcome/main_ui.py"], - "kernel_meta_pkg": "linux-drauger" + "run_post_oem": ["/usr/bin/drauger-welcome"], + "kernel_meta_pkg": "linux-drauger", + "remove_pkgs": ["system-installer", + "persistence-daemon"] } diff --git a/testing_distros.md b/testing_distros.md new file mode 100644 index 00000000..bae917ca --- /dev/null +++ b/testing_distros.md @@ -0,0 +1,30 @@ +# Testing Distros + +This list details which distros have been tested and are known working with `system-installer`. Config changes to get `system-installer` working are acceptable. + +## To test: + - [ ] Get the distro booted up in a VM or on a live USB/CD/DVD + - [ ] Run `git clone https://github.com/drauger-os-development/system-installer` to clone the repo + - [ ] `cd` into the folder: `cd system-installer` + - [ ] Make any necessary changes to the default config to get `system-installer` to work. + - [ ] Install Packages needed to build: `sudo apt install python3-dev libpython3-dev` + - [ ] Build the package: `./build.sh` + - [ ] Install the package: `sudo apt install ../system-installer_*.deb` + - [ ] Run `system-installer` in a terminal and try to install the OS! + +## When testing, please do these things: + - [ ] Install using the auto-partitioner (on both EFI and BIOS) + - [ ] Install using the manual partitioner (on both EFI and BIOS) + - [ ] Install with and without Restricted Extras enabled + +## For extra credit, try: + - [ ] Installing using Quick Install + - [ ] Installing using OEM install (this includes the End User Experience) + - [ ] Sending an Installation Report + - [ ] Installing with a RAID array configured in the installer + + +## Tested Distros ✅ +✅ **Drauger OS 7.5.1** - KNOWN WORKING + +✅ **Drauger OS 7.6** - KNOWN WORKING diff --git a/usr/bin/system-installer.cxx b/usr/bin/system-installer.cxx index 2fe84f96..a991c5c5 100644 --- a/usr/bin/system-installer.cxx +++ b/usr/bin/system-installer.cxx @@ -1,7 +1,7 @@ /* * system-installer.cxx * - * Copyright 2022 Thomas Castleman + * Copyright 2023 Thomas Castleman * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -46,7 +46,7 @@ using namespace std; -str VERSION = "2.5.0"; +str VERSION = "2.5.5"; str R = "\033[0;31m"; str G = "\033[0;32m"; str Y = "\033[1;33m"; diff --git a/usr/share/system-installer/UI/main.py b/usr/share/system-installer/UI/main.py index a6552f5f..7be111e4 100755 --- a/usr/share/system-installer/UI/main.py +++ b/usr/share/system-installer/UI/main.py @@ -215,6 +215,47 @@ def reset(self, button): self.show_all() def oem_startup(self, widget): + """Start up OEM installation""" + self.clear_window() + + # show a confirmation window + + label = Gtk.Label() + label.set_markup(""" + Are you sure you want to do an OEM installation? + + OEM installation should ONLY be used by OEMs, or those installing\t\t + Drauger OS for other people, ahead of time. It has several limitations\t\t + over a normal or quick installation: + + * Takes up the entire drive it is installed to + * Locale, keyboard, and password must be set AFTER installation\t\t + * Hostname and username can not be set by the user + * Restricted Extras AND Updates are automatically installed + * A Swap file will automatically be generated to enable Hybrid Sleep\t\t +""") + label.set_justify(Gtk.Justification.LEFT) + label = self._set_default_margins(label) + self.grid.attach(label, 1, 1, 3, 1) + + button1 = Gtk.Button.new_with_label("Proceed -->") + button1.connect("clicked", self.oem_run) + button1 = self._set_default_margins(button1) + self.grid.attach(button1, 3, 2, 1, 1) + + button2 = Gtk.Button.new_with_label("Exit") + button2.connect("clicked", self.exit) + button2 = self._set_default_margins(button2) + self.grid.attach(button2, 2, 2, 1, 1) + + button3 = Gtk.Button.new_with_label("<-- Back") + button3.connect("clicked", self.reset) + button3 = self._set_default_margins(button3) + self.grid.attach(button3, 1, 2, 1, 1) + + self.show_all() + + def oem_run(self, widget): """Start up OEM installation""" self.data = "/etc/system-installer/oem-install.json" self.complete() @@ -1632,23 +1673,23 @@ def options(self, button): self.grid.attach(label1, 1, 2, 2, 1) self.extras = Gtk.CheckButton.new_with_label("Install Restricted Extras") - if self.data["EXTRAS"] == 1: + if self.data["EXTRAS"]: self.extras.set_active(True) self.extras = self._set_default_margins(self.extras) self.grid.attach(self.extras, 1, 3, 2, 1) - # label2 = Gtk.Label() - # label2.set_markup(""" - # Update the system during installation""") - # label2.set_justify(Gtk.Justification.LEFT) - # label2 = self._set_default_margins(label2) - # self.grid.attach(label2, 1, 4, 2, 1) + label2 = Gtk.Label() + label2.set_markup(""" + Update the system during installation""") + label2.set_justify(Gtk.Justification.LEFT) + label2 = self._set_default_margins(label2) + self.grid.attach(label2, 1, 4, 2, 1) - # self.updates = Gtk.CheckButton.new_with_label("Update during Installation") - # if self.data["UPDATES"] == 1: - # self.updates.set_active(True) - # self.updates = self._set_default_margins(self.updates) - # self.grid.attach(self.updates, 1, 5, 2, 1) + self.updates = Gtk.CheckButton.new_with_label("Update during Installation") + if self.data["UPDATES"]: + self.updates.set_active(True) + self.updates = self._set_default_margins(self.updates) + self.grid.attach(self.updates, 1, 5, 2, 1) label2 = Gtk.Label() label2.set_markup(""" @@ -1658,13 +1699,13 @@ def options(self, button): self.grid.attach(label2, 1, 6, 2, 1) self.login = Gtk.CheckButton.new_with_label("Enable Auto-Login") - if self.data["LOGIN"] == 1: + if self.data["LOGIN"]: self.login.set_active(True) self.login = self._set_default_margins(self.login) self.grid.attach(self.login, 1, 7, 2, 1) self.compat_mode = Gtk.CheckButton.new_with_label("Enable Bootloader Compatibility Mode") - if self.data["COMPAT_MODE"] == 1: + if self.data["COMPAT_MODE"]: self.compat_mode.set_active(True) self.compat_mode = self._set_default_margins(self.compat_mode) @@ -1694,8 +1735,7 @@ def options(self, button): def options_next(self, button): """Set update and extras settings""" self.data["EXTRAS"] = self.extras.get_active() - # self.data["UPDATES"] = self.updates.get_active() - self.data["UPDATES"] = False + self.data["UPDATES"] = self.updates.get_active() self.data["LOGIN"] = self.login.get_active() self.data["COMPAT_MODE"] = self.compat_mode.get_active() global OPTIONS_COMPLETION diff --git a/usr/share/system-installer/UI/report.py b/usr/share/system-installer/UI/report.py index 6e48c7f2..6e9c5cdb 100755 --- a/usr/share/system-installer/UI/report.py +++ b/usr/share/system-installer/UI/report.py @@ -3,7 +3,7 @@ # # report.py # -# Copyright 2022 Thomas Castleman +# Copyright 2023 Thomas Castleman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -462,7 +462,7 @@ def generate_message(self): if custom == self.default_message: output['CUSTOM MESSAGE'] = "NONE" else: - output['CUSTOM MESSAGE'] = custom + output['CUSTOM MESSAGE'] = custom.split("\n") else: output['CUSTOM MESSAGE'] = "NONE" try: @@ -702,7 +702,7 @@ def ram_info(): if ram_capacity[each] == []: del ram_capacity[each] swap_capacity = check_output(["swapon", "--show"]).decode().split("\n") - return {"RAM": ram_capacity, "SWAP": swap_capacity} + return {"RAM": dict(ram_capacity), "SWAP": swap_capacity} def disk_info(): diff --git a/usr/share/system-installer/check_internet.py b/usr/share/system-installer/check_internet.py index c224f560..3b275272 100755 --- a/usr/share/system-installer/check_internet.py +++ b/usr/share/system-installer/check_internet.py @@ -3,7 +3,7 @@ # # check_internet.py # -# Copyright 2022 Thomas Castleman +# Copyright 2023 Thomas Castleman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -22,19 +22,25 @@ # # """Ping servers to see if we have internet""" -from subprocess import check_output, CalledProcessError import json +import dns.resolver as res import common -def ping(mirror, count): - """Ping the mirrors""" +def ping(mirror): + """Try doing a DNS resolution on the mirrors""" # We need just the domain name, so we have to parse things down a bit - mirror = mirror.split("/")[2] - command = ["ping", "-c", str(count), "-q", mirror] - # get the ping times - output = check_output(command).decode("utf-8").split("\n")[-2] - return float(output.split("/")[-2]) + if mirror[:4] == "http": + mirror = mirror.split("/")[2] + if mirror[-1] == "/": + mirror = mirror[:-1] + try: + res.resolve(mirror, "A") + return True + except (res.NoNameservers, res.NoAnswer): + return False + except res.NXDOMAIN: + return None def has_internet(): @@ -44,18 +50,24 @@ def has_internet(): with open("/etc/system-installer/settings.json", "r") as mirrors_file: mirrors = json.load(mirrors_file) - ping_count = mirrors["ping count"] mirrors = mirrors["ping servers"] # get only the unique mirrors mirrors = common.unique(mirrors) # Get our ping times + results = [] try: # Ping all listed servers, in case one or more is blocked for each in mirrors: - ping(each, ping_count) - - except CalledProcessError: + results.append(ping(each)) + except: return False - - return True + true = 0 + false = 0 + for each in results: + if each: + true += 1 + else: + false += 1 + + return (true > false) diff --git a/usr/share/system-installer/common.py b/usr/share/system-installer/common.py index 8cdadf3c..9dab086a 100755 --- a/usr/share/system-installer/common.py +++ b/usr/share/system-installer/common.py @@ -3,7 +3,7 @@ # # common.py # -# Copyright 2022 Thomas Castleman +# Copyright 2023 Thomas Castleman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/usr/share/system-installer/engine.py b/usr/share/system-installer/engine.py index a0a1fc03..445a0af3 100755 --- a/usr/share/system-installer/engine.py +++ b/usr/share/system-installer/engine.py @@ -151,6 +151,11 @@ def copy_log_to_disk(): additional_settings = oem.pre_install.show_main() for each in additional_settings: SETTINGS[each] = additional_settings[each] + if "COMPAT_MODE" not in SETTINGS: + # this is an old quick install file. It has likely worked for the user before. + # honor the file, but offer to update it + # TODO: Add offer to update Quick Install File + SETTINGS["COMPAT_MODE"] = False except TypeError: pass diff --git a/usr/share/system-installer/modules/__init__.py b/usr/share/system-installer/modules/__init__.py index e1e87886..922922f2 100755 --- a/usr/share/system-installer/modules/__init__.py +++ b/usr/share/system-installer/modules/__init__.py @@ -3,7 +3,7 @@ # # __init__.py # -# Copyright 2022 Thomas Castleman +# Copyright 2023 Thomas Castleman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -32,3 +32,4 @@ import modules.make_user as make_user import modules.purge as purge import modules.verify_install as verify_install +import modules.common as common diff --git a/usr/share/system-installer/modules/common.py b/usr/share/system-installer/modules/common.py new file mode 120000 index 00000000..a11703ea --- /dev/null +++ b/usr/share/system-installer/modules/common.py @@ -0,0 +1 @@ +../common.py \ No newline at end of file diff --git a/usr/share/system-installer/modules/install_updates.py b/usr/share/system-installer/modules/install_updates.py index 7b0c8d50..6ae510e7 100755 --- a/usr/share/system-installer/modules/install_updates.py +++ b/usr/share/system-installer/modules/install_updates.py @@ -3,7 +3,7 @@ # # install_updates.py # -# Copyright 2022 Thomas Castleman +# Copyright 2023 Thomas Castleman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/usr/share/system-installer/modules/master.py b/usr/share/system-installer/modules/master.py index 8ee3ca11..c0861edd 100755 --- a/usr/share/system-installer/modules/master.py +++ b/usr/share/system-installer/modules/master.py @@ -244,14 +244,14 @@ def install_kernel(release): # it's just easier and more reliable packages = ["linux-headers-" + release, "linux-image-" + release] install_command = ["dpkg", "--install"] - subproc.check_call(["apt-get", "purge", "-y"] + packages, - stdout=stderr.buffer) - subproc.check_call(["apt-get", "autoremove", "-y", "--purge"], - stdout=stderr.buffer) + subproc.check_call(["dpkg", "-P", "--force-all"] + packages, + stdout=stderr.buffer) packages = [each for each in os.listdir("/repo") if "linux-" in each] os.chdir("/repo") subproc.check_call(install_command + packages, stdout=stderr.buffer) os.chdir("/") + subproc.check_call(["apt-get", "autopurge", "-y"], + stdout=stderr.buffer) def install_bootloader(efi, root, release, distro, compat_mode): @@ -391,6 +391,7 @@ def _install_systemd_boot(release, root, distro, compat_mode): def setup_lowlevel(efi, root, distro, compat_mode): """Set up kernel and bootloader""" release = subproc.check_output(["uname", "--release"]).decode()[0:-1] + eprint(f"Running kernel: { release }") install_kernel(release) set_plymouth_theme() __update__(91) diff --git a/usr/share/system-installer/modules/verify_install.py b/usr/share/system-installer/modules/verify_install.py index 1006e7d9..e44aeaae 100755 --- a/usr/share/system-installer/modules/verify_install.py +++ b/usr/share/system-installer/modules/verify_install.py @@ -3,7 +3,7 @@ # # verify_install.py # -# Copyright 2022 Thomas Castleman +# Copyright 2023 Thomas Castleman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,11 +24,12 @@ """Verify that installation completed correctly""" from __future__ import print_function from sys import stderr -from os import path, remove +import os from shutil import move -import subprocess +import subprocess as subproc import apt import auto_partitioner +import common from modules import purge @@ -47,7 +48,7 @@ def add_boot_entry(root, distro): disk = root[:8] part = root[8:] - subprocess.check_call(["efibootmgr", "--create", "--disk", disk, "--part", + subproc.check_call(["efibootmgr", "--create", "--disk", disk, "--part", part, "--loader", r"\EFI\systemd\systemd-bootx64.efi", "--label", distro], stdout=stderr.buffer, stderr=stderr.buffer) @@ -55,7 +56,7 @@ def add_boot_entry(root, distro): def set_default_entry(distro): """Set default boot entry""" - entries = subprocess.check_output(["efibootmgr"]).decode().split("\n") + entries = subproc.check_output(["efibootmgr"]).decode().split("\n") entries = [each.split(" ") for each in entries] del entries[0] del entries[0] @@ -76,12 +77,12 @@ def set_default_entry(distro): order = ",".join(entries[0][1]) # clean up a bit del entries, code - subprocess.check_call(["efibootmgr", "-o", order]) + subproc.check_call(["efibootmgr", "-o", order]) def is_default_entry(distro): """Check if we are the default boot entry""" - entries = subprocess.check_output(["efibootmgr"]).decode().split("\n") + entries = subproc.check_output(["efibootmgr"]).decode().split("\n") entries = [each.split(" ") for each in entries] del entries[0] del entries[0] @@ -109,10 +110,10 @@ def is_default_entry(distro): def verify(username, root, distro): """Verify installation success""" __eprint__(" ### verify_install.py STARTED ### ") - if path.isdir("/home/home/live"): + if os.path.isdir("/home/home/live"): move("/home/home/live", "/home/" + username) try: - remove("/home/" + username + "/Desktop/system-installer.desktop") + os.remove("/home/" + username + "/Desktop/system-installer.desktop") except FileNotFoundError: pass if auto_partitioner.is_EFI(): @@ -134,6 +135,13 @@ def verify(username, root, distro): if (("grub" in each.name) and each.is_installed): if "common" not in each.name: each.mark_delete() + versions = common.unique([each.split("-")[1] for each in os.listdir("/boot") if len(each.split("-")) > 1]) + for release in versions: + __eprint__(f"Generating Initramfs for Kernel v{ release }") + subproc.check_call(["mkinitramfs", "-o", + f"/boot/initrd.img-{ release }", + release]) + subproc.check_call(["update-systemd-boot"]) cache.commit() purge.autoremove(cache) cache.close() diff --git a/usr/share/system-installer/oem/post_install/UI.py b/usr/share/system-installer/oem/post_install/UI.py index 5478962e..e3f119eb 100755 --- a/usr/share/system-installer/oem/post_install/UI.py +++ b/usr/share/system-installer/oem/post_install/UI.py @@ -3,7 +3,7 @@ # # main.py # -# Copyright 2022 Thomas Castleman +# Copyright 2023 Thomas Castleman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -115,6 +115,8 @@ def reset(self, button): global DEFAULT self.clear_window() + self.set_position(Gtk.WindowPosition.CENTER) + label = Gtk.Label() label.set_markup(DEFAULT) label.set_justify(Gtk.Justification.LEFT) @@ -134,6 +136,8 @@ def user(self, button): """User setup Window""" self.clear_window() + self.set_position(Gtk.WindowPosition.CENTER) + label = Gtk.Label() label.set_markup(""" Set Up Main User @@ -221,6 +225,8 @@ def locale(self, button): """Language and Time Zone settings menu""" self.clear_window() + self.set_position(Gtk.WindowPosition.CENTER) + label = Gtk.Label() label.set_markup(""" Choose your Language and Time Zone""") @@ -331,6 +337,8 @@ def keyboard(self, button): """Keyboard Settings Dialog""" self.clear_window() + self.set_position(Gtk.WindowPosition.CENTER) + label = Gtk.Label() label.set_markup(""" Choose your Keyboard layout\t diff --git a/usr/share/system-installer/oem/pre_install.py b/usr/share/system-installer/oem/pre_install.py index eadf8606..005b9d96 100755 --- a/usr/share/system-installer/oem/pre_install.py +++ b/usr/share/system-installer/oem/pre_install.py @@ -3,7 +3,7 @@ # # pre_install.py # -# Copyright 2022 Thomas Castleman +# Copyright 2023 Thomas Castleman # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -86,6 +86,8 @@ def auto_partition(self, button): """Auto Partitioning Settings Window""" self.clear_window() + self.set_position(Gtk.WindowPosition.CENTER) + # Get a list of disks and their capacity self.devices = json.loads(subprocess.check_output(["lsblk", "-n", "-i", "--json", "-o", "NAME,SIZE,TYPE,FSTYPE"]).decode()) @@ -167,6 +169,8 @@ def define_array(self, widget, error=None): """Define btrfs RAID Array settings""" self.clear_window() + self.set_position(Gtk.WindowPosition.CENTER) + dev = [] for each2 in enumerate(self.devices): if "loop" in self.devices[each2[0]]["name"]: @@ -508,6 +512,8 @@ def exit(self, button): """Exit dialog""" self.clear_window() + self.set_position(Gtk.WindowPosition.CENTER) + label = Gtk.Label() label.set_markup("""\nAre you sure you want to exit?