Skip to content

Commit 2170975

Browse files
authored
install audit-libs before systemd (#2584)
1 parent b1d626e commit 2170975

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

toolkit/tools/imagegen/installutils/installutils.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,8 @@ func PackageNamesFromConfig(config configuration.Config) (packageList []*pkgjson
372372
func PopulateInstallRoot(installChroot *safechroot.Chroot, packagesToInstall []string, config configuration.SystemConfig, installMap, mountPointToFsTypeMap, mountPointToMountArgsMap map[string]string, isRootFS bool, encryptedRoot diskutils.EncryptedRootDevice, diffDiskBuild, hidepidEnabled bool) (err error) {
373373
const (
374374
filesystemPkg = "filesystem"
375+
auditlibsPkg = "audit-libs"
376+
systemdPkg = "systemd"
375377
)
376378

377379
defer stopGPGAgent(installChroot)
@@ -415,6 +417,17 @@ func PopulateInstallRoot(installChroot *safechroot.Chroot, packagesToInstall []s
415417
return
416418
}
417419

420+
// If systemd package is in the list, install audit-libs first to ensure it is available
421+
for _, pkg := range packagesToInstall {
422+
if strings.HasPrefix(pkg, systemdPkg) {
423+
logger.Log.Infof("Installing audit-libs package before systemd")
424+
packagesInstalled, err = TdnfInstallWithProgress(auditlibsPkg, installRoot, packagesInstalled, totalPackages, true)
425+
if err != nil {
426+
return
427+
}
428+
}
429+
}
430+
418431
hostname := config.Hostname
419432
if !isRootFS && mountPointToFsTypeMap[rootMountPoint] != overlay {
420433
// Add /etc/hostname

0 commit comments

Comments
 (0)