Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1964,18 +1964,22 @@ def set_user_password(self, user: User) -> bool:
def user_set_shell(self, user: str, shell: str) -> bool:
info(f'Setting shell for {user} to {shell}')

cmd = ['arch-chroot', '-S', str(self.target), 'chsh', '-s', shell, user]
try:
self.arch_chroot(f'sh -c "chsh -s {shell} {user}"')
run(cmd)
return True
except SysCallError:
except CalledProcessError as err:
debug(f'Error setting user shell: {err}')
return False

def chown(self, owner: str, path: str, options: list[str] = []) -> bool:
cleaned_path = path.replace("'", "\\'")
def chown(self, owner: str, path: str, options: list[str] | None = None) -> bool:
options = options or []
cmd = ['arch-chroot', '-S', str(self.target), 'chown', *options, owner, path]
try:
self.arch_chroot(f"sh -c 'chown {' '.join(options)} {owner} {cleaned_path}'")
run(cmd)
return True
except SysCallError:
except CalledProcessError as err:
debug(f'Error changing ownership of {path}: {err}')
return False

def set_vconsole(self, locale_config: LocaleConfiguration) -> None:
Expand Down