From ec64a68549bc85f6d1085ad31e64837b86b0c8ee Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 22 May 2020 20:43:59 +0200 Subject: [PATCH] Arch: Fix root login when using systemd-nspawn --- mkosi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mkosi b/mkosi index 18540d28a..f566f2ec7 100755 --- a/mkosi +++ b/mkosi @@ -2168,6 +2168,14 @@ Server = {repository_server} with open(os.path.join(workspace, 'root', 'etc/locale.conf'), 'w') as f: f.write('LANG=en_US.UTF-8\n') + # Arch still uses pam_securetty which prevents root login into + # systemd-nspawn containers. See https://bugs.archlinux.org/task/45903. + def rm_securetty(line: str) -> str: + if 'pam_securetty.so' in line: + return '' + return line + patch_file(os.path.join(root, 'etc/pam.d/login'), rm_securetty) + @completestep('Installing openSUSE') def install_opensuse(args: CommandLineArguments, workspace: str, do_run_build_script: bool) -> None: -- 2.47.2