From ff0760b772c9cc56c08f0671b2def815b5e8242e Mon Sep 17 00:00:00 2001 From: N0VA Date: Tue, 10 Feb 2026 15:23:19 +0100 Subject: [PATCH] Add GUI progress bar and improve systemd-boot installation reliability --- iridium_installer/backend/os_install.py | 3 ++- iridium_installer/ui/window.py | 32 +++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/iridium_installer/backend/os_install.py b/iridium_installer/backend/os_install.py index 40c294a..77a7a90 100644 --- a/iridium_installer/backend/os_install.py +++ b/iridium_installer/backend/os_install.py @@ -284,7 +284,8 @@ def configure_system(mount_root, partition_info, user_info=None, disk_device=Non f.write("bls\n") # Initialize systemd-boot - run_command(["chroot", mount_root, "bootctl", "install", "--path=/boot"]) + # We use --force to overwrite any existing entries and ensure it's the primary bootloader + run_command(["chroot", mount_root, "bootctl", "install", "--path=/boot", "--force"]) # Sync kernels and generate BLS entries # Since we rsync'd, kernels are in /lib/modules and /boot diff --git a/iridium_installer/ui/window.py b/iridium_installer/ui/window.py index dd30210..1dc62d1 100644 --- a/iridium_installer/ui/window.py +++ b/iridium_installer/ui/window.py @@ -182,6 +182,13 @@ class InstallerWindow(Adw.ApplicationWindow): spinner.start() box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=12) + + self.progress_bar = Gtk.ProgressBar() + self.progress_bar.set_show_text(True) + self.progress_bar.set_margin_start(24) + self.progress_bar.set_margin_end(24) + box.append(self.progress_bar) + box.append(spinner) # Log view @@ -226,6 +233,31 @@ class InstallerWindow(Adw.ApplicationWindow): mark = self.log_buffer.create_mark("end", end_iter, False) self.log_view.scroll_to_mark(mark, 0.0, True, 0.0, 1.0) + # Update progress bar based on keywords or rsync progress + msg_lower = msg.lower() + if "step 1:" in msg_lower: + self.progress_bar.set_fraction(0.1) + self.progress_bar.set_text("Partitioning...") + elif "step 2:" in msg_lower: + self.progress_bar.set_fraction(0.2) + self.progress_bar.set_text("Mounting...") + elif "step 3:" in msg_lower: + self.progress_bar.set_fraction(0.3) + self.progress_bar.set_text("Installing OS...") + elif "step 4:" in msg_lower: + self.progress_bar.set_fraction(0.9) + self.progress_bar.set_text("Configuring Bootloader...") + elif "%" in msg and "to-check" in msg: + # Parse rsync progress (e.g., "1,234,567 80% 10.00MB/s 0:00:05") + import re + match = re.search(r"(\d+)%", msg) + if match: + percentage = int(match.group(1)) + # Map 0-100% of rsync to 0.3-0.8 of total progress + fraction = 0.3 + (percentage / 100.0) * 0.5 + self.progress_bar.set_fraction(fraction) + self.progress_bar.set_text(f"Syncing files... {percentage}%") + def show_finish_page(self, message, success=True): if self.log_handler: logging.getLogger().removeHandler(self.log_handler)