From 7455ccc8d061312d58204c0d9e8123477c8ca5bb Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Mon, 28 Nov 2022 18:17:34 +0000 Subject: [PATCH] Set root password Fixes: #13009 Signed-off-by: Michael Tremer --- src/python/__init__.py | 2 ++ src/python/step.py | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/src/python/__init__.py b/src/python/__init__.py index cd9eeb3..860fcc9 100644 --- a/src/python/__init__.py +++ b/src/python/__init__.py @@ -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! diff --git a/src/python/step.py b/src/python/step.py index 98c3773..1331ae4 100644 --- a/src/python/step.py +++ b/src/python/step.py @@ -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 -- 2.47.2