mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-11-30 11:56:18 -05:00
The drive wizard never offers an EFI system partition
On a Debian install the onboarding wizard offered the EFI system partition (unlabeled vfat at /boot/efi) as the primary WROLPi drive; choosing it would mount the boot partition over /media/wrolpi. Candidates were filtered by the "EFI" label only, and the Debian installer leaves the ESP unlabeled. /boot/efi is now an excluded mountpoint, and partitions with the EFI system partition type (GPT GUID or MBR 0xef, from lsblk PARTTYPE) are excluded even when unmounted, e.g. on a second internal disk. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
80678e1f6e
commit
4b84a4d6d4
4 changed files with 68 additions and 2 deletions
|
|
@ -98,6 +98,22 @@ class TestGetBlockDevices:
|
|||
assert result[0].fstype == "ext4"
|
||||
assert result[0].model == "Samsung SSD"
|
||||
|
||||
def test_reads_partition_type(self):
|
||||
"""The partition type identifies an EFI system partition whatever its label or mount."""
|
||||
lsblk_output = json.dumps({"blockdevices": [{
|
||||
"name": "sda", "path": "/dev/sda", "size": "500G", "type": "disk", "children": [{
|
||||
"name": "sda1", "path": "/dev/sda1", "size": "512M", "type": "part", "fstype": "vfat",
|
||||
"parttype": "c12a7328-f81f-11d2-ba4b-00a0c93ec93b",
|
||||
}],
|
||||
}]})
|
||||
with mock.patch("controller.lib.disks.is_docker_mode", return_value=False):
|
||||
with mock.patch("subprocess.run") as mock_run:
|
||||
mock_run.return_value = mock.Mock(returncode=0, stdout=lsblk_output)
|
||||
result = get_block_devices()
|
||||
|
||||
assert "PARTTYPE" in mock_run.call_args.args[0][-1].split(",")
|
||||
assert result[0].parttype == "c12a7328-f81f-11d2-ba4b-00a0c93ec93b"
|
||||
|
||||
def test_filters_unsupported_filesystems(self):
|
||||
"""Should only return devices with supported filesystems."""
|
||||
lsblk_output = json.dumps({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue