From b6fd436c29f5d4b17579e5d2ba867a5ec41dd584 Mon Sep 17 00:00:00 2001 From: Achilleas Koutsou Date: Mon, 10 Jun 2024 15:53:21 +0200 Subject: [PATCH] manifest: add shadow-utils and pam when users are created org.osbuild.users runs useradd, usermod, passwd, and mkhomedir_helper in the os tree using chroot. Most image types should already have the required packages, but some minimal image types, like 'tar' don't, so let's add them for the stage to run and to enable user management in the image. --- pkg/manifest/os.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/manifest/os.go b/pkg/manifest/os.go index 2054ec79f7..321049ffa4 100644 --- a/pkg/manifest/os.go +++ b/pkg/manifest/os.go @@ -246,6 +246,16 @@ func (p *OS) getPackageSetChain(Distro) []rpmmd.PackageSet { } } + if len(p.Users) > 0 { + // org.osbuild.users runs useradd, usermod, passwd, and + // mkhomedir_helper in the os tree using chroot. Most image types + // should already have the required packages, but some minimal image + // types, like 'tar' don't, so let's add them for the stage to run and + // to enable user management in the image. + packages = append(packages, "shadow-utils", "pam") + + } + osRepos := append(p.repos, p.ExtraBaseRepos...) chain := []rpmmd.PackageSet{