fix: mount pseudo-fs during install, simplify partitioning, and add mount point config
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user