summaryrefslogtreecommitdiffstats
path: root/src/utils/disk.py
Commit message (Collapse)AuthorAgeFilesLines
* utils: add enforce_gpt argument to get_efi_partition()Alejandro Sirgo Rica2024-03-261-3/+6
| | | | | | | The Windows bootloader only supports a UEFI boot from a GPT partition. Set enforce_gpt to True in every codepath related to Windows. When enforce_gpt is set to True get_efi_partition() raises an exception when an MBR partition scheme is detected.
* utils: add disk index checks in get_partition_deviceAlejandro Sirgo Rica2024-03-211-1/+5
| | | | | Control the possibility of a bad disk index. Handle the checks in a similar fashion to the get_efi_partition function.
* utils: improve logging in the get_efi_partition functionAlejandro Sirgo Rica2024-03-081-13/+16
| | | | | Log each partition that gets checked and make the exception messages more informative.
* disk: add get_efi_partition functionJose M. Guisado2024-03-041-0/+24
| | | | | | | | | | | | | Add utility function inside disk.py to find, if any, the first ESP partition of a given disk. The disk is provided as an integer (starting at 1 following OpenGnsys scripts usual values), meaning the (n-1)th disk from the disk array returned from get_disks(). In the future a better mechanism should be put in place to fetch probed disks from a running client. This change is part of the upcoming drop of "IniciarSesion" script in favor of a Python native approach. Specifically regarding UEFI systems.
* src: improve error check in image_create and image_restoreAlejandro Sirgo Rica2024-02-141-1/+1
| | | | | | | | | cover more error cases where exceptions need to be raised. check return code in the invoked subprocess. restoreImageCustom has been intentionally left behind, it is unclear what this custom script returns on success and error.
* utils: add get_partition_deviceJose M. Guisado2022-09-141-0/+17
| | | | | Maps a disk and partition number to the corresponding device path ('/dev/sdXY', '/dev/nvmeXnYpZ', ...)
* Add utils modulesJose M. Guisado2022-04-211-0/+19
* disk.py Disk discovery * fs.py Uses psutil to fetch fs usage information * menu.py ogBrowser menu generation * net.py: gets nic status information IP address, MAC address and ethernet speed. * probe.py: probes mountpoints for operating systems Uses hivexget command to try fetching Windows installation information. Looks for /etc/os-release for probing linux systems.