Change of variables to support new partition lookup.
This commit is contained in:
parent
72ad1ad5e0
commit
9ebd8b8719
|
|
@ -322,13 +322,13 @@ class Installer():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def add_bootloader(self, bootloader='systemd-bootctl'):
|
def add_bootloader(self, bootloader='systemd-bootctl'):
|
||||||
# This logic is only for debug/log purposes:
|
|
||||||
# (it could be completely ommitted if we just print /mnt instead)
|
|
||||||
boot_partition = None
|
boot_partition = None
|
||||||
|
root_partition = None
|
||||||
for partition in self.partitions:
|
for partition in self.partitions:
|
||||||
if partition.mountpoint == self.target+'/boot':
|
if partition.mountpoint == self.target+'/boot':
|
||||||
boot_partition = partition
|
boot_partition = partition
|
||||||
break
|
elif partition.mountpoint == self.target:
|
||||||
|
root_partition = partition
|
||||||
|
|
||||||
self.log(f'Adding bootloader {bootloader} to {boot_partition}', level=LOG_LEVELS.Info)
|
self.log(f'Adding bootloader {bootloader} to {boot_partition}', level=LOG_LEVELS.Info)
|
||||||
|
|
||||||
|
|
@ -372,14 +372,14 @@ 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.
|
||||||
|
|
||||||
|
|
||||||
if self.partition.encrypted:
|
if root_partition.encrypted:
|
||||||
log(f"Identifying root partition by DISK-UUID on {self.partition}, looking for '{os.path.basename(self.partition.real_device)}'.", level=LOG_LEVELS.Debug)
|
log(f"Identifying root partition by DISK-UUID on {root_partition}, looking for '{os.path.basename(root_partition.real_device)}'.", level=LOG_LEVELS.Debug)
|
||||||
for root, folders, uids in os.walk('/dev/disk/by-uuid'):
|
for root, folders, uids in os.walk('/dev/disk/by-uuid'):
|
||||||
for uid in uids:
|
for uid in uids:
|
||||||
real_path = os.path.realpath(os.path.join(root, uid))
|
real_path = os.path.realpath(os.path.join(root, uid))
|
||||||
|
|
||||||
log(f"Checking root partition match {os.path.basename(real_path)} against {os.path.basename(self.partition.real_device)}: {os.path.basename(real_path) == os.path.basename(self.partition.real_device)}", level=LOG_LEVELS.Debug)
|
log(f"Checking root partition match {os.path.basename(real_path)} against {os.path.basename(root_partition.real_device)}: {os.path.basename(real_path) == os.path.basename(root_partition.real_device)}", level=LOG_LEVELS.Debug)
|
||||||
if not os.path.basename(real_path) == os.path.basename(self.partition.real_device): continue
|
if not os.path.basename(real_path) == os.path.basename(root_partition.real_device): continue
|
||||||
|
|
||||||
entry.write(f'options cryptdevice=UUID={uid}:luksdev root=/dev/mapper/luksdev rw intel_pstate=no_hwp\n')
|
entry.write(f'options cryptdevice=UUID={uid}:luksdev root=/dev/mapper/luksdev rw intel_pstate=no_hwp\n')
|
||||||
|
|
||||||
|
|
@ -387,13 +387,13 @@ class Installer():
|
||||||
return True
|
return True
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
log(f"Identifying root partition by PART-UUID on {self.partition}, looking for '{os.path.basename(self.partition.path)}'.", level=LOG_LEVELS.Debug)
|
log(f"Identifying root partition by PART-UUID on {root_partition}, looking for '{os.path.basename(root_partition.path)}'.", level=LOG_LEVELS.Debug)
|
||||||
entry.write(f'options root=PARTUUID={self.partition.uuid} rw intel_pstate=no_hwp\n')
|
entry.write(f'options root=PARTUUID={root_partition.uuid} rw intel_pstate=no_hwp\n')
|
||||||
|
|
||||||
self.helper_flags['bootloader'] = bootloader
|
self.helper_flags['bootloader'] = bootloader
|
||||||
return True
|
return True
|
||||||
|
|
||||||
raise RequirementError(f"Could not identify the UUID of {self.partition}, there for {self.target}/boot/loader/entries/arch.conf will be broken until fixed.")
|
raise RequirementError(f"Could not identify the UUID of {root_partition}, there for {self.target}/boot/loader/entries/arch.conf will be broken until fixed.")
|
||||||
else:
|
else:
|
||||||
raise RequirementError(f"Unknown (or not yet implemented) bootloader added to add_bootloader(): {bootloader}")
|
raise RequirementError(f"Unknown (or not yet implemented) bootloader added to add_bootloader(): {bootloader}")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue