Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
authorDaniel Girtler <girtler.daniel@gmail.com>2024-04-23 17:02:07 +1000
committerGitHub <noreply@github.com>2024-04-23 09:02:07 +0200
commitbeeb9d7fde8db7ed0dc9fb10cf7eec27f33b4a82 (patch)
treebe9afc1badeb73d70f8fe6ebde47880b7eb811ec /archinstall
parent0ea6dbbd7677b94e863b2ab333431716886b5f84 (diff)
Fix 2191 - Handle unknown device/partition type (#2470)
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/disk/device_model.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/archinstall/lib/disk/device_model.py b/archinstall/lib/disk/device_model.py
index 7edaa5b6..5736b423 100644
--- a/archinstall/lib/disk/device_model.py
+++ b/archinstall/lib/disk/device_model.py
@@ -19,7 +19,6 @@ from ..exceptions import DiskError, SysCallError
from ..general import SysCommand
from ..output import debug, error
from ..storage import storage
-from ..output import info
if TYPE_CHECKING:
_: Any
@@ -449,8 +448,11 @@ class _DeviceInfo:
device = disk.device
if device.type == 18:
device_type = 'loop'
- else:
+ elif device.type in parted.devices:
device_type = parted.devices[device.type]
+ else:
+ debug(f'Device code not unknown: {device.type}')
+ device_type = parted.devices[parted.DEVICE_UNKNOWN]
sector_size = SectorSize(device.sectorSize, Unit.B)
free_space = [DeviceGeometry(g, sector_size) for g in disk.getFreeSpaceRegions()]
@@ -568,7 +570,7 @@ class PartitionType(Enum):
if code == parted.PARTITION_NORMAL:
return PartitionType.Primary
else:
- info(f'Partition code not supported: {code}')
+ debug(f'Partition code not supported: {code}')
return PartitionType._Unknown
def get_partition_code(self) -> Optional[int]: