diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-07-23 10:08:56 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-07-25 09:48:12 +0200 |
commit | 6628d93d8684d1fd8f8bc2c60f83d6045b503ac0 (patch) | |
tree | 1303d0eda2fb2a8adf95b605e96cca1dcc9cbdc9 /ogcp | |
parent | efd0b8acb3f4f098697c8c30bd196dacda39b704 (diff) |
views: restrict EFI part size to 500MiB or higher
Modern Windows systems require higher EFI partition sizes than
most other OS.
Validate partition & format form to ensure the EFI partition has
as size of 500MiB or higher.
Diffstat (limited to 'ogcp')
-rw-r--r-- | ogcp/views.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 525ed3a..72a8b14 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -714,6 +714,7 @@ def action_setup_show(): @login_required def action_setup_modify(): form = SetupForm(request.form) + MIN_EFI_SIZE = 500 if form.validate(): cache_count = 0 for partition in form.partitions: @@ -724,6 +725,10 @@ def action_setup_modify(): flash(_('The EFI partition requires a FAT32 filesystem'), category='error') return redirect(url_for('commands')) + if partition.part_type.data == 'EFI' and partition.size.data < MIN_EFI_SIZE: + flash(_(f'The EFI partition requires a size of {MIN_EFI_SIZE}MiB or higher'), category='error') + return redirect(url_for('commands')) + if partition.size.data <= 0: flash(_('Partitions can\'t have a size of zero or lower'), category='error') return redirect(url_for('commands')) |