Merge pull request #289 from dylanmtaylor/chroot-prompt
Implement chroot prompt after successful installation
This commit is contained in:
commit
4391dd68d5
|
|
@ -1,4 +1,4 @@
|
||||||
import os, stat, time, shutil, pathlib
|
import os, stat, time, shutil, pathlib, subprocess
|
||||||
|
|
||||||
from .exceptions import *
|
from .exceptions import *
|
||||||
from .disk import *
|
from .disk import *
|
||||||
|
|
@ -81,6 +81,7 @@ class Installer():
|
||||||
if not (missing_steps := self.post_install_check()):
|
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.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.sync_log_to_install_medium()
|
||||||
|
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.log('Some required steps were not successfully installed/configured before leaving the installer:', bg='black', fg='red', level=LOG_LEVELS.Warning)
|
self.log('Some required steps were not successfully installed/configured before leaving the installer:', bg='black', fg='red', level=LOG_LEVELS.Warning)
|
||||||
|
|
@ -190,6 +191,9 @@ class Installer():
|
||||||
def arch_chroot(self, cmd, *args, **kwargs):
|
def arch_chroot(self, cmd, *args, **kwargs):
|
||||||
return self.run_command(cmd)
|
return self.run_command(cmd)
|
||||||
|
|
||||||
|
def drop_to_shell(self):
|
||||||
|
subprocess.check_call(f"/usr/bin/arch-chroot {self.target}", shell=True)
|
||||||
|
|
||||||
def configure_nic(self, nic, dhcp=True, ip=None, gateway=None, dns=None, *args, **kwargs):
|
def configure_nic(self, nic, dhcp=True, ip=None, gateway=None, dns=None, *args, **kwargs):
|
||||||
if dhcp:
|
if dhcp:
|
||||||
conf = Networkd(Match={"Name": nic}, Network={"DHCP": "yes"})
|
conf = Networkd(Match={"Name": nic}, Network={"DHCP": "yes"})
|
||||||
|
|
|
||||||
|
|
@ -331,3 +331,11 @@ def perform_installation(mountpoint):
|
||||||
|
|
||||||
ask_user_questions()
|
ask_user_questions()
|
||||||
perform_installation_steps()
|
perform_installation_steps()
|
||||||
|
|
||||||
|
installation.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:
|
||||||
|
installation.drop_to_shell()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue