Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 3fba916

Browse files
committed
[#248] ld_preload systemd shared lib to fix debian lib load
1 parent a256397 commit 3fba916

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

aci-builder/bin-run/builder.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,18 @@ func (b *Builder) runBuild() error {
204204
func (b *Builder) prepareNspawnArgsAndEnv(commandPath string) ([]string, []string, error) {
205205
var args []string
206206
env := os.Environ()
207+
env = append(env, "LD_LIBRARY_PATH="+b.stage1Rootfs+"/dgr/usr/lib")
208+
env = append(env, "LD_PRELOAD="+b.stage1Rootfs+"/dgr/usr/lib/libsystemd-shared-232.so") // debian lib dir hell
207209
args = append(args, b.stage1Rootfs+"/dgr/usr/lib/ld-linux-x86-64.so.2")
210+
args = append(args, "--library-path")
211+
args = append(args, b.stage1Rootfs+"/dgr/usr/lib")
208212
args = append(args, b.stage1Rootfs+"/dgr/usr/bin/systemd-nspawn")
209213
if context := os.Getenv(rktcommon.EnvSELinuxContext); context != "" {
210214
args = append(args, fmt.Sprintf("-Z%s", context))
211215
}
212216
args = append(args, "--register=no")
213217
args = append(args, "-q")
214218
args = append(args, "--link-journal=auto")
215-
env = append(env, "LD_LIBRARY_PATH="+b.stage1Rootfs+"/dgr/usr/lib")
216219
if !logs.IsDebugEnabled() {
217220
args = append(args, "--quiet")
218221
}

0 commit comments

Comments
 (0)