fix: mount pseudo-fs during install, simplify partitioning, and add mount point config

This commit is contained in:
2026-02-03 20:49:41 +01:00
parent dc417d15d3
commit 848b2e7e74
5 changed files with 70 additions and 140 deletions

View File

@@ -145,100 +145,6 @@ class InstallerWindow(Adw.ApplicationWindow):
self.stack.set_visible_child_name(self.page_ids[self.current_page_index])
self.update_buttons()
def on_next_clicked(self, button):
# Logic before transition
current_page_name = self.page_ids[self.current_page_index]
if current_page_name == "storage":
selected_disk = self.storage_page.get_selected_disk()
self.partitioning_page.load_partitions(selected_disk)
next_index = self.current_page_index + 1
if current_page_name == "install_mode":
mode = self.install_mode_page.get_mode()
if mode == "automatic":
# Skip partitioning page
next_index = self.page_ids.index("modules")
else:
# Go to partitioning page
next_index = self.page_ids.index("partitioning")
if current_page_name == "user":
# Prepare summary instead of installing immediately
disk = self.storage_page.get_selected_disk()
mode = self.install_mode_page.get_mode()
modules = self.modules_page.get_modules()
user_info = self.user_page.get_user_info()
partitions_config = {}
if mode == "manual":
partitions_config = self.partitioning_page.get_config()
elif mode == "automatic":
partitions = calculate_auto_partitions(disk)
partitions_config = {"partitions": partitions}
# Update summary page
self.summary_page.update_summary(
disk_info=disk,
mode=mode,
partitions=partitions_config,
user_info=user_info,
modules=modules,
)
# Proceed to summary page (which is next_index after user)
if current_page_name == "summary":
# THIS IS THE REAL INSTALL TRIGGER
print("Install process triggered!")
disk = self.storage_page.get_selected_disk()
mode = self.install_mode_page.get_mode()
modules = self.modules_page.get_modules()
user_info = self.user_page.get_user_info()
if self.mock_mode:
print("!!! MOCK MODE ENABLED - NO CHANGES WILL BE MADE !!!")
print(f"Target Disk: {disk}")
print(f"Mode: {mode}")
print(f"Modules: {modules}")
print(f"User: {user_info}")
print("Simulation complete.")
# Show success in UI even in mock
self.show_finish_page("Mock Installation Complete!")
else:
from ..backend.disk import auto_partition_disk, mount_partitions
from ..backend.os_install import install_minimal_os, configure_system
# Simple progress UI transition
self.show_progress_page("Installing Iridium OS...")
# We should really run this in a thread to keep UI responsive,
# but for "barely bootable" requirement and simplicity:
try:
# Step 1: Partitioning
print("Step 1: Partitioning...")
parts = auto_partition_disk(disk)
# Step 2: Mounting
print("Step 2: Mounting...")
mount_root = "/mnt"
mount_partitions(parts, mount_root)
# Step 3: OS Installation
print("Step 3: OS Installation...")
install_minimal_os(mount_root)
# Step 4: Configure
print("Step 4: Configuration...")
configure_system(mount_root, parts)
self.show_finish_page("Installation Successful!")
except Exception as e:
print(f"Installation failed: {e}")
self.show_finish_page(f"Installation Failed: {e}", success=False)
return
def show_progress_page(self, message):
prog_page = Adw.StatusPage()
prog_page.set_title(message)
@@ -282,10 +188,6 @@ class InstallerWindow(Adw.ApplicationWindow):
name = "finish_install"
self.stack.add_named(finish_page, name)
self.stack.set_visible_child_name(name)
# Make bottom bar visible but maybe just with a close button if we didn't have the child btn
# self.bottom_bar.set_visible(True)
# self.next_button.set_label("Finish")
def on_next_clicked(self, button):
# Logic before transition
@@ -312,6 +214,7 @@ class InstallerWindow(Adw.ApplicationWindow):
mode = self.install_mode_page.get_mode()
modules = self.modules_page.get_modules()
user_info = self.user_page.get_user_info()
mount_root = self.welcome_page.get_mount_root()
partitions_config = {}
if mode == "manual":
@@ -327,6 +230,7 @@ class InstallerWindow(Adw.ApplicationWindow):
partitions=partitions_config,
user_info=user_info,
modules=modules,
mount_root=mount_root,
)
# Proceed to summary page (which is next_index after user)
@@ -337,6 +241,7 @@ class InstallerWindow(Adw.ApplicationWindow):
mode = self.install_mode_page.get_mode()
modules = self.modules_page.get_modules()
user_info = self.user_page.get_user_info()
mount_root = self.welcome_page.get_mount_root()
if self.mock_mode:
print("!!! MOCK MODE ENABLED - NO CHANGES WILL BE MADE !!!")
@@ -344,6 +249,7 @@ class InstallerWindow(Adw.ApplicationWindow):
print(f"Mode: {mode}")
print(f"Modules: {modules}")
print(f"User: {user_info}")
print(f"Mount Root: {mount_root}")
print("Simulation complete.")
# Show success in UI even in mock
self.show_finish_page("Mock Installation Complete!")
@@ -363,7 +269,6 @@ class InstallerWindow(Adw.ApplicationWindow):
# Step 2: Mounting
print("Step 2: Mounting...")
mount_root = "/mnt"
mount_partitions(parts, mount_root)
# Step 3: OS Installation
@@ -384,4 +289,4 @@ class InstallerWindow(Adw.ApplicationWindow):
if next_index < len(self.page_ids):
self.current_page_index = next_index
self.stack.set_visible_child_name(self.page_ids[self.current_page_index])
self.update_buttons()
self.update_buttons()