Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall
diff options
context:
space:
mode:
Diffstat (limited to 'archinstall')
-rw-r--r--archinstall/lib/disk.py16
-rw-r--r--archinstall/lib/hardware.py10
2 files changed, 18 insertions, 8 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index d0e3f6a2..de39bafd 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -448,16 +448,16 @@ class Filesystem:
if self.blockdevice.keep_partitions is False:
log(f'Wiping {self.blockdevice} by using partition format {self.mode}', level=logging.DEBUG)
if self.mode == GPT:
- if self.raw_parted(f'{self.blockdevice.device} mklabel gpt').exit_code == 0:
+ if self.parted_mklabel(self.blockdevice.device, "gpt"):
self.blockdevice.flush_cache()
return self
else:
- raise DiskError('Problem setting the partition format to GPT:', f'/usr/bin/parted -s {self.blockdevice.device} mklabel gpt')
+ raise DiskError('Problem setting the disk label type to GPT:', f'/usr/bin/parted -s {self.blockdevice.device} mklabel gpt')
elif self.mode == MBR:
- if SysCommand(f'/usr/bin/parted -s {self.blockdevice.device} mklabel msdos').exit_code == 0:
+ if self.parted_mklabel(self.blockdevice.device, "msdos"):
return self
else:
- raise DiskError('Problem setting the partition format to MBR:', f'/usr/bin/parted -s {self.blockdevice.device} mklabel msdos')
+ raise DiskError('Problem setting the disk label type to msdos:', f'/usr/bin/parted -s {self.blockdevice.device} mklabel msdos')
else:
raise DiskError(f'Unknown mode selected to format in: {self.mode}')
@@ -552,6 +552,14 @@ class Filesystem:
def set(self, partition: int, string: str):
return self.parted(f'{self.blockdevice.device} set {partition + 1} {string}') == 0
+ def parted_mklabel(self, device: str, disk_label: str):
+ # Try to unmount devices before attempting to run mklabel
+ try:
+ SysCommand(f'bash -c "umount {device}?"')
+ except:
+ pass
+ return self.raw_parted(f'{device} mklabel {disk_label}').exit_code == 0
+
def device_state(name, *args, **kwargs):
# Based out of: https://askubuntu.com/questions/528690/how-to-get-list-of-all-non-removable-disk-device-names-ssd-hdd-and-sata-ide-onl/528709#528709
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index 45e042db..a63155f5 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -48,10 +48,12 @@ AVAILABLE_GFX_DRIVERS = {
"intel-media-driver",
"vulkan-intel",
],
- "Nvidia": {
- "open-source": ["mesa", "xf86-video-nouveau", "libva-mesa-driver"],
- "proprietary": ["nvidia"],
- },
+ "Nvidia (open-source)": [
+ "mesa",
+ "xf86-video-nouveau",
+ "libva-mesa-driver"
+ ],
+ "Nvidia (proprietary)": ["nvidia"],
"VMware / VirtualBox (open-source)": ["mesa", "xf86-video-vmware"],
}