Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples/full_automated_installation.py
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2023-09-24 19:47:38 +1000
committerGitHub <noreply@github.com>2023-09-24 19:47:38 +1000
commitb141609990fa4f7305443ee6ea6fe8796604c539 (patch)
tree5326555c522bb3b3e128a579917c892593e9e2b9 /examples/full_automated_installation.py
parent9e3e4a5df5b6ff106bcbf30273cdb0de9af7e02e (diff)
Fix 1669 | Refactor display of sizes in tables (#2100)
* Use sector as default display * Display tables in sector size * Refactor size * Update * Update * fix flake8 --------- Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'examples/full_automated_installation.py')
-rw-r--r--examples/full_automated_installation.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/examples/full_automated_installation.py b/examples/full_automated_installation.py
index 79e85348..d25575d4 100644
--- a/examples/full_automated_installation.py
+++ b/examples/full_automated_installation.py
@@ -23,8 +23,8 @@ device_modification = disk.DeviceModification(device, wipe=True)
boot_partition = disk.PartitionModification(
status=disk.ModificationStatus.Create,
type=disk.PartitionType.Primary,
- start=disk.Size(1, disk.Unit.MiB),
- length=disk.Size(512, disk.Unit.MiB),
+ start=disk.Size(1, disk.Unit.MiB, device.device_info.sector_size),
+ length=disk.Size(512, disk.Unit.MiB, device.device_info.sector_size),
mountpoint=Path('/boot'),
fs_type=disk.FilesystemType.Fat32,
flags=[disk.PartitionFlag.Boot]
@@ -35,20 +35,23 @@ device_modification.add_partition(boot_partition)
root_partition = disk.PartitionModification(
status=disk.ModificationStatus.Create,
type=disk.PartitionType.Primary,
- start=disk.Size(513, disk.Unit.MiB),
- length=disk.Size(20, disk.Unit.GiB),
+ start=disk.Size(513, disk.Unit.MiB, device.device_info.sector_size),
+ length=disk.Size(20, disk.Unit.GiB, device.device_info.sector_size),
mountpoint=None,
fs_type=fs_type,
mount_options=[],
)
device_modification.add_partition(root_partition)
+start_home = root_partition.length
+length_home = device.device_info.total_size - start_home
+
# create a new home partition
home_partition = disk.PartitionModification(
status=disk.ModificationStatus.Create,
type=disk.PartitionType.Primary,
- start=root_partition.length,
- length=disk.Size(100, disk.Unit.Percent, total_size=device.device_info.total_size),
+ start=start_home,
+ length=length_home,
mountpoint=Path('/home'),
fs_type=fs_type,
mount_options=[]