]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Arch: Fix root login when using systemd-nspawn 424/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Fri, 22 May 2020 18:43:59 +0000 (20:43 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sat, 23 May 2020 19:29:31 +0000 (21:29 +0200)
mkosi

diff --git a/mkosi b/mkosi
index 18540d28a0b5fd4cf460e7cba3521233f158e432..f566f2ec70a1860a4b32c212ed297b58ed9bea57 100755 (executable)
--- 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: