]> git.ipfire.org Git - people/ms/bricklayer.git/commitdiff
Set root password
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 28 Nov 2022 18:17:34 +0000 (18:17 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 28 Nov 2022 18:17:34 +0000 (18:17 +0000)
Fixes: #13009
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/__init__.py
src/python/step.py

index cd9eeb30a0e7897c4d81055226cbe96d1ea22bb3..860fcc9994e8017d83a214f8cfa72393027b9674 100644 (file)
@@ -70,6 +70,7 @@ class Bricklayer(object):
                                "kernel",
                                "network",
                                "kernel-tools",
+                               "passwd",
                        ],
 
                        # Set the default swap size to 1 GiB
@@ -115,6 +116,7 @@ class Bricklayer(object):
                disk.CreateFilesystems,
                disk.MountFilesystems,
                packages.InstallPackages,
+               step.SetRootPassword,
                bootloaders.InstallBootloader,
 
                # Done!
index 98c37736af4c55033cff3ece1279a94db943d9fa..1331ae4ec7840d76e5e5e55307b533aad1c87a68 100644 (file)
@@ -215,6 +215,17 @@ class RootPassword(InteractiveStep):
                self.bricklayer.settings["root-password"] = password
 
 
+class SetRootPassword(Step):
+       def run(self):
+               with self.tui.progress(_("Applying Configuration"),
+                               _("Setting password for the '%s' user...")) as t:
+                       p = self.bricklayer.setup_pakfire()
+
+                       # XXX execute currently has no way to write to stdin, which is
+                       # why we reset the root password here, so that we will have a working login
+                       p.execute(["passwd", "--delete", "root"])
+
+
 class ToggleFirstInstallStatus(Step):
        first_install = True