From 6b6c9c84bed1e4640f5f46282da1767827f977a9 Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Tue, 23 Nov 2021 11:37:51 +0000 Subject: Adding a warning when /boot is reasonably too small (#738) * Moved convert_size_to_gb() into disk/helpers.py, Added a Partition().size property meta function. Using the .size value to check if /boot is too small which will raise an exception. The only drawback is that it's done post-formatting. This in order to catch scenarios where formatting isn't used. * Changed /boot warning from 0.15GB to 0.25GB * Changed the wording in the warning when /boot is too small. --- examples/guided.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'examples') diff --git a/examples/guided.py b/examples/guided.py index e48ad89d..1ee31d38 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -264,6 +264,12 @@ def perform_installation(mountpoint): # This *can* be done outside of the installation, but the installer can deal with it. installation.mount_ordered_layout(archinstall.storage['disk_layouts']) + # Placing /boot check during installation because this will catch both re-use and wipe scenarios. + for partition in installation.partitions: + if partition.mountpoint == installation.target + '/boot': + if partition.size <= 0.25: # in GB + raise archinstall.DiskError(f"The selected /boot partition in use is not large enough to properly install a boot loader. Please resize it to at least 256MB and re-run the installation.") + # if len(mirrors): # Certain services might be running that affects the system during installation. # Currently, only one such service is "reflector.service" which updates /etc/pacman.d/mirrorlist -- cgit v1.2.3-54-g00ecf