Skip to content

Commit

Permalink
Add onloadDependFiles to copy dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
neomantra committed Jan 23, 2024
1 parent afd24e2 commit ed9c8fb
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/onload_device/reserve.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ var onloadBinaryFiles = []string{
"onload_stackdump",
}

// onloadDependFiles are the dependencies of the onload command, copied directly from host to target
var onloadDependFiles = []string{
"/sbin/lsmod",
}

// onloadPreloadFile is the library file used by LD_PRELOAD
const onloadPreloadFile = "libonload.so"

Expand Down Expand Up @@ -150,6 +155,13 @@ func (d *OnloadDevicePlugin) Reserve(deviceIDs []string) (*device.ContainerReser
ReadOnly: true,
})
}
for _, depName := range onloadDependFiles {
resp.Mounts = append(resp.Mounts, &device.Mount{
TaskPath: depName,
HostPath: depName,
ReadOnly: true,
})
}
}
if d.config.TaskProfileDirPath != "" && d.config.HostProfileDirPath != "" {
resp.Mounts = append(resp.Mounts, &device.Mount{
Expand Down

0 comments on commit ed9c8fb

Please sign in to comment.