Using two different methods for encrypted/non encrypted drives.

This commit is contained in:
Anton Hvornum 2020-07-08 15:43:54 +00:00
parent 99944634e3
commit 078567f81c
2 changed files with 19 additions and 10 deletions

View File

@ -62,18 +62,27 @@ class Installer():
## so we'll use the old manual method until we get that sorted out. ## so we'll use the old manual method until we get that sorted out.
for root, folders, uids in os.walk('/dev/disk/by-partuuid'): if self.partition.encrypted:
for uid in uids: print(f'Trying to locate {os.path.basename(self.partition.path)} under /dev/disk/by-partuuid')
real_path = os.path.realpath(os.path.join(root, uid)) for root, folders, uids in os.walk('/dev/disk/by-partuuid'):
if not os.path.basename(real_path) == os.path.basename(self.partition.path): continue for uid in uids:
real_path = os.path.realpath(os.path.join(root, uid))
if not os.path.basename(real_path) == os.path.basename(self.partition.path): continue
if self.partition.encrypted:
entry.write(f'options cryptdevice=PARTUUID={uid}:luksdev root=/dev/mapper/luksdev rw intel_pstate=no_hwp\n') entry.write(f'options cryptdevice=PARTUUID={uid}:luksdev root=/dev/mapper/luksdev rw intel_pstate=no_hwp\n')
else: return True
break
else:
print(f'Trying to locate {os.path.basename(self.partition.path)} under /dev/disk/by-uuid')
for root, folders, uids in os.walk('/dev/disk/by-uuid'):
for uid in uids:
real_path = os.path.realpath(os.path.join(root, uid))
if not os.path.basename(real_path) == os.path.basename(self.partition.path): continue
entry.write(f'options root=PARTUUID={uid} rw intel_pstate=no_hwp\n') entry.write(f'options root=PARTUUID={uid} rw intel_pstate=no_hwp\n')
return True return True
break break
raise RequirementError(f'Could not identify the UUID of {partition}, there for {self.mountpoint}/boot/loader/entries/arch.conf will be broken until fixed.') raise RequirementError(f'Could not identify the UUID of {self.partition}, there for {self.mountpoint}/boot/loader/entries/arch.conf will be broken until fixed.')
def add_additional_packages(self, *packages): def add_additional_packages(self, *packages):
self.pacstrap(*packages) self.pacstrap(*packages)

View File

@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup( setuptools.setup(
name="archinstall", name="archinstall",
version="2.0.3rc11", version="2.0.3rc12",
author="Anton Hvornum", author="Anton Hvornum",
author_email="anton@hvornum.se", author_email="anton@hvornum.se",
description="Arch Linux installer - guided, templates etc.", description="Arch Linux installer - guided, templates etc.",