Implement chroot prompt after successful installation

Try os.subprocess


Revert to subprocess.check_call
This commit is contained in:
Dylan Taylor 2021-04-12 09:10:00 -04:00
parent 897b67f751
commit b44c0e5197
1 changed files with 8 additions and 1 deletions

View File

@ -1,4 +1,4 @@
import os, stat, time, shutil, pathlib
import os, stat, time, shutil, pathlib, subprocess
from .exceptions import *
from .disk import *
@ -81,6 +81,13 @@ class Installer():
if not (missing_steps := self.post_install_check()):
self.log('Installation completed without any errors. You may now reboot.', bg='black', fg='green', level=LOG_LEVELS.Info)
self.sync_log_to_install_medium()
self.log("For post-installation tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation", fg="yellow")
choice = input("Would you like to chroot into the newly created installation and perform post-installation configuration? [Y/n] ")
if choice.lower() in ("y", ""):
try:
subprocess.check_call(f"arch-chroot {self.target}", shell=True)
except:
pass
return True
else:
self.log('Some required steps were not successfully installed/configured before leaving the installer:', bg='black', fg='red', level=LOG_LEVELS.Warning)