diff --git a/internal/onload_device/reserve.go b/internal/onload_device/reserve.go index aef43af..5c36d7c 100644 --- a/internal/onload_device/reserve.go +++ b/internal/onload_device/reserve.go @@ -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" @@ -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{