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

@@ -504,11 +504,6 @@ class PartitioningPage(Adw.Bin):
box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=12, margin_top=24, margin_bottom=24, margin_start=24, margin_end=24)
win.set_content(box)
# Name entry
name_entry = Gtk.Entry(text="Linux filesystem")
box.append(Gtk.Label(label="Partition Name:"))
box.append(name_entry)
# Size entry
size_box = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=12)
size_entry = Gtk.Entry(text=str(int(data["bytes"] / (1024*1024))))
@@ -530,18 +525,15 @@ class PartitioningPage(Adw.Bin):
box.append(Gtk.Label(label="Filesystem:"))
box.append(fs_dropdown)
# Auto-update FS and Name based on Type
# Auto-update FS based on Type
def on_type_changed(dropdown, pspec):
selected_type = type_names[dropdown.get_selected()]
if selected_type == "EFI System":
fs_dropdown.set_selected(1) # fat32
name_entry.set_text("EFI System")
elif selected_type == "Swap":
fs_dropdown.set_selected(2) # swap
name_entry.set_text("Swap")
else:
fs_dropdown.set_selected(0) # ext4
name_entry.set_text("Linux filesystem")
type_dropdown.connect("notify::selected", on_type_changed)
@@ -551,18 +543,19 @@ class PartitioningPage(Adw.Bin):
def on_create(b):
from ...backend.disk import create_partition
name = name_entry.get_text()
selected_type = type_names[type_dropdown.get_selected()]
if selected_type == "EFI System" and name == "Linux filesystem":
error_label.set_text("Can't set partition name to Linux filesystem")
return
# Default name based on type
if selected_type == "EFI System":
name = "EFI System"
elif selected_type == "Swap":
name = "Swap"
else:
name = "Linux filesystem"
size_text = size_entry.get_text()
try:
size_mb = int(size_text)
# If they are using the max proposed size, use 0 to avoid alignment issues
# with sgdisk +sizeM logic exceeding disk boundaries.
max_mb = int(data["bytes"] / (1024*1024))
if size_mb >= max_mb:
size_mb = 0

View File

@@ -27,6 +27,15 @@ class SummaryPage(Adw.Bin):
content_box.set_spacing(24)
clamp.set_child(content_box)
# Installation Settings
self.install_group = Adw.PreferencesGroup()
self.install_group.set_title("Installation Settings")
content_box.append(self.install_group)
self.mount_row = Adw.ActionRow()
self.mount_row.set_title("Installation Root (Mount Point)")
self.install_group.add(self.mount_row)
# Storage and partitioning
self.storage_group = Adw.PreferencesGroup()
self.storage_group.set_title("Storage & Partitioning")
@@ -66,7 +75,10 @@ class SummaryPage(Adw.Bin):
self.modules_row.set_title("Additional Modules")
self.software_group.add(self.modules_row)
def update_summary(self, disk_info, mode, partitions, user_info, modules):
def update_summary(self, disk_info, mode, partitions, user_info, modules, mount_root):
# Update Mount Root
self.mount_row.set_subtitle(mount_root)
# Update Disk
self.disk_row.set_subtitle(str(disk_info))

View File

@@ -50,6 +50,19 @@ class WelcomePage(Adw.Bin):
dropdown = Gtk.DropDown.new_from_strings(languages)
box.append(dropdown)
# Mount Point Entry
mount_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=6)
mount_box.set_margin_top(24)
mount_label = Gtk.Label(label="Installation Root (Mount Point):")
mount_label.set_halign(Gtk.Align.START)
self.mount_entry = Gtk.Entry(text="/mnt")
mount_box.append(mount_label)
mount_box.append(self.mount_entry)
box.append(mount_box)
page.set_child(box)
self.set_child(page)
def get_mount_root(self):
return self.mount_entry.get_text()