index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-03-21 15:25:24 +0100 |
---|---|---|
committer | Anton Hvornum <anton@hvornum.se> | 2021-03-21 15:25:24 +0100 |
commit | 93faf07b6948074e9071faf75f96ff220714d5f9 (patch) | |
tree | 3b781b9781ae79a01aa547709bb8db829a37cf82 | |
parent | 60817334224a8ade4c7e600498fe9bd8f540bf29 (diff) |
-rw-r--r-- | archinstall/lib/installer.py | 9 | ||||
-rw-r--r-- | archinstall/lib/profiles.py | 1 |
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 2604e77d..8d7d6967 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -381,6 +381,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.installer + if type(profile) == str: profile = Profile(self, profile) diff --git a/archinstall/lib/profiles.py b/archinstall/lib/profiles.py index 34ba09da..ee2ff39a 100644 --- a/archinstall/lib/profiles.py +++ b/archinstall/lib/profiles.py @@ -142,7 +142,6 @@ class Script(): if not self.namespace in sys.modules or self.spec is None: self.load_instructions() - __builtins__['installation'] = self.installer # TODO: Replace this with a import archinstall.session instead self.spec.loader.exec_module(sys.modules[self.namespace]) return sys.modules[self.namespace] |