Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/installer.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-03-21 17:52:59 +0100
committerGitHub <noreply@github.com>2021-03-21 17:52:59 +0100
commit7c54b4ce72ba8d7689ff54215414fdb2341a59bb (patch)
treedd045e42df15bac68a81ca49a9c9a11b1618389f /archinstall/lib/installer.py
parent75d1395b107d983c8b97f10ee757ee6f28487afa (diff)
parent83c0ee4b225d3263b7aa564035130151f8163584 (diff)
Merge pull request #118 from Torxed/torx-fix-profile-issues
Fixed profile issues as well as partition cache issues. Also added some more debug logs for support cases.
Diffstat (limited to 'archinstall/lib/installer.py')
-rw-r--r--archinstall/lib/installer.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 2604e77d..1c66f6ac 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -352,6 +352,7 @@ class Installer():
if self.partition.encrypted:
+ log(f"Identifying root partition {self.partition} to boot based on disk UUID, looking for '{os.path.basename(self.partition.real_device)}'.", level=LOG_LEVELS.Debug)
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))
@@ -363,6 +364,7 @@ class Installer():
return True
break
else:
+ log(f"Identifying root partition {self.partition} to boot based on partition UUID, looking for '{os.path.basename(self.partition.path)}'.", level=LOG_LEVELS.Debug)
for root, folders, uids in os.walk('/dev/disk/by-partuuid'):
for uid in uids:
real_path = os.path.realpath(os.path.join(root, uid))
@@ -373,6 +375,7 @@ class Installer():
self.helper_flags['bootloader'] = bootloader
return True
break
+
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.")
else:
raise RequirementError(f"Unknown (or not yet implemented) bootloader added to add_bootloader(): {bootloader}")
@@ -381,6 +384,15 @@ class Installer():
return self.pacstrap(*packages)
def install_profile(self, profile):
+ # TODO: Replace this with a import archinstall.session instead in the profiles.
+ # The tricky thing with doing the import archinstall.session instead is that
+ # profiles might be run from a different chroot, and there's no way we can
+ # guarantee file-path safety when accessing the installer object that way.
+ # Doing the __builtins__ replacement, ensures that the global vriable "installation"
+ # is always kept up to date. It's considered a nasty hack - but it's a safe way
+ # of ensuring 100% accuracy of archinstall session variables.
+ __builtins__['installation'] = self
+
if type(profile) == str:
profile = Profile(self, profile)