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>2022-04-11 22:46:06 +0200
committerGitHub <noreply@github.com>2022-04-11 22:46:06 +0200
commitf644022e0cbcb13069ea8caff4d5791db3925911 (patch)
treeabb0c218de1277b5329fbb5858206f2d3fdb2693 /archinstall/lib/installer.py
parent57b16d5468493dbc4b134a43bb55cf52571acb0b (diff)
This should address and resolve #587 (#1070)
* This should address and resolve #587 * Forgot one line from copying from local test script Co-authored-by: Anton Hvornum <anton.feeds@gmail.com>
Diffstat (limited to 'archinstall/lib/installer.py')
-rw-r--r--archinstall/lib/installer.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index f10b4064..9959b0a8 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -1028,7 +1028,12 @@ class Installer:
# This means the root account isn't locked/disabled with * in /etc/passwd
self.helper_flags['user'] = True
- return SysCommand(f"/usr/bin/arch-chroot {self.target} sh -c \"echo '{user}:{password}' | chpasswd\"").exit_code == 0
+ combo = f'{user}:{password}'
+ echo = shlex.join(['echo', combo])
+ sh = shlex.join(['sh', '-c', echo])
+
+ result = SysCommand(f"/usr/bin/arch-chroot {self.target} " + sh[:-1] + " | chpasswd'")
+ return result.exit_code == 0
def user_set_shell(self, user :str, shell :str) -> bool:
self.log(f'Setting shell for {user} to {shell}', level=logging.INFO)