Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk/filesystem.py
diff options
context:
space:
mode:
authorWerner Llácer <wllacer@gmail.com>2021-12-31 13:47:41 +0100
committerGitHub <noreply@github.com>2021-12-31 13:47:41 +0100
commit7f9b7991e902489efb3501a98a7d6998ca15a0a5 (patch)
tree96766f566987f7cb042e7a7a2a132182d3fc1018 /archinstall/lib/disk/filesystem.py
parentc3e2b993160930f7f74f1e822199914b0eeeead9 (diff)
Btrfs2 (#787)
* All the changes needed to make btrfs subvolumes work. It boils down to two points; the handling of the addressing of subvolumes re. physical partitions, and the small changes at the bootloader level * We added a new script only_hd for testing purposes. It only handles hadrd drive management * restoring an escape hatch during subvolume processing * hipercommented manage_btrfs_subvolumes * Ready to be able to select and process options in subvolume mounting * Separte nodatacow processing * Solving a flake8 complain * Use of bind names @ get_filesystem_type * compress mount option bypass * Preparations for encryption handling * Compatibility to master version re. encrypted btrfs volumes * Now we can create subvolumes and mountpoints inside an encrypted btrfs partition * changes for entries file generation with systemd-bootctl * flake8 corrections plus some comments Co-authored-by: Anton Hvornum <anton@hvornum.se>
Diffstat (limited to 'archinstall/lib/disk/filesystem.py')
-rw-r--r--archinstall/lib/disk/filesystem.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/archinstall/lib/disk/filesystem.py b/archinstall/lib/disk/filesystem.py
index 72be7e70..51ef949b 100644
--- a/archinstall/lib/disk/filesystem.py
+++ b/archinstall/lib/disk/filesystem.py
@@ -37,10 +37,10 @@ class Filesystem:
for i in range(storage['DISK_RETRY_ATTEMPTS']):
self.partprobe()
time.sleep(5)
-
+
# TODO: Convert to blkid (or something similar, but blkid doesn't support traversing to list sub-PARTUUIDs based on blockdevice path?)
output = json.loads(SysCommand(f"lsblk --json -o+PARTUUID {self.blockdevice.device}").decode('UTF-8'))
-
+
for device in output['blockdevices']:
for index, partition in enumerate(device['children']):
if (partuuid := partition.get('partuuid', None)) and partuuid.lower() == uuid:
@@ -93,8 +93,12 @@ class Filesystem:
storage['arguments']['!encryption-password'] = get_password(f"Enter a encryption password for {partition['device_instance']}")
partition['!password'] = storage['arguments']['!encryption-password']
-
- loopdev = f"{storage.get('ENC_IDENTIFIER', 'ai')}{pathlib.Path(partition['mountpoint']).name}loop"
+ # to be able to generate an unique name in case the partition will not be mounted
+ if partition.get('mountpoint',None):
+ ppath = partition['mountpoint']
+ else:
+ ppath = partition['device_instance'].path
+ loopdev = f"{storage.get('ENC_IDENTIFIER', 'ai')}{pathlib.Path(ppath).name}loop"
partition['device_instance'].encrypt(password=partition['!password'])
@@ -207,9 +211,9 @@ class Filesystem:
SysCommand(f'bash -c "umount {device}?"')
except:
pass
-
+
self.partprobe()
worked = self.raw_parted(f'{device} mklabel {disk_label}').exit_code == 0
self.partprobe()
-
+
return worked