From 6cc546887d6054c02d4f287f936ba7bf1fc24e04 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 11 Apr 2021 16:04:03 -0400 Subject: If user does not change keyboard language, log it. --- archinstall/lib/installer.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'archinstall/lib/installer.py') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 4ff9e80a..3b218dff 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -449,4 +449,6 @@ class Installer(): with open(f'{self.target}/etc/vconsole.conf', 'w') as vconsole: vconsole.write(f'KEYMAP={language}\n') vconsole.write(f'FONT=lat9w-16\n') + else: + self.log(f'Keyboard language was not changed from default (no language specified).', level=LOG_LEVELS.Info) return True -- cgit v1.2.3-70-g09d2 From de693b70807bd5bc35be9e446ac9a8d9f3121ecd Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 11 Apr 2021 16:51:07 -0400 Subject: Make it yellow --- archinstall/lib/installer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'archinstall/lib/installer.py') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 3b218dff..7aa64816 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -450,5 +450,5 @@ class Installer(): vconsole.write(f'KEYMAP={language}\n') vconsole.write(f'FONT=lat9w-16\n') else: - self.log(f'Keyboard language was not changed from default (no language specified).', level=LOG_LEVELS.Info) + self.log(f'Keyboard language was not changed from default (no language specified).', fg="yellow", level=LOG_LEVELS.Info) return True -- cgit v1.2.3-70-g09d2 From b44c0e51976ed3c177341c78da49ccec4cd81b5b Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Mon, 12 Apr 2021 09:10:00 -0400 Subject: Implement chroot prompt after successful installation Try os.subprocess Revert to subprocess.check_call --- archinstall/lib/installer.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'archinstall/lib/installer.py') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 7aa64816..7c3ee051 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -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) -- cgit v1.2.3-70-g09d2 From 3034def365a0f139a41b20c8933e61e86f298eaf Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Mon, 12 Apr 2021 10:09:37 -0400 Subject: Move logic to guided --- archinstall/lib/installer.py | 11 ++++------- examples/guided.py | 8 ++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'archinstall/lib/installer.py') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 7c3ee051..c50b2ac7 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -81,13 +81,7 @@ 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) @@ -197,6 +191,9 @@ class Installer(): def arch_chroot(self, cmd, *args, **kwargs): 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): if dhcp: conf = Networkd(Match={"Name": nic}, Network={"DHCP": "yes"}) diff --git a/examples/guided.py b/examples/guided.py index beb577c8..d50063f3 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -327,3 +327,11 @@ def perform_installation(mountpoint): ask_user_questions() 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 -- cgit v1.2.3-70-g09d2 From f6d6e0328eb95a29ebbc0f4a6f596831aed28227 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Mon, 12 Apr 2021 16:06:50 -0400 Subject: Implement function to set the shell for a user (#291) --- archinstall/lib/installer.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'archinstall/lib/installer.py') diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 7aa64816..f21287c3 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -443,6 +443,12 @@ class Installer(): o = b''.join(sys_command(f"/usr/bin/arch-chroot {self.target} sh -c \"echo '{user}:{password}' | chpasswd\"")) pass + + def user_set_shell(self, user, shell): + self.log(f'Setting shell for {user} to {shell}', level=LOG_LEVELS.Info) + + o = b''.join(sys_command(f"/usr/bin/arch-chroot {self.target} sh -c \"chsh -s {shell} {user}\"")) + pass def set_keyboard_language(self, language): if len(language.strip()): -- cgit v1.2.3-70-g09d2