Add kernelversion and kernelrelease options to falco driver loader entrypoint

Signed-off-by: Paul Rey <contact@paulrey.io>
This commit is contained in:
Paul Rey 2024-03-19 14:45:10 +01:00 committed by poiana
parent 2dfac14cd1
commit 2f6fdfa972

View File

@ -32,6 +32,8 @@ print_usage() {
echo " --clean try to remove an already present driver installation"
echo " --compile try to compile the driver locally (default true)"
echo " --download try to download a prebuilt driver (default true)"
echo " --kernel-release <value> set the kernel release"
echo " --kernel-version <value> set the kernel version"
echo " --http-insecure enable insecure downloads"
echo " --print-env skip execution and print env variables for other tools to consume"
echo ""
@ -55,6 +57,8 @@ ENABLE_DOWNLOAD="false"
HTTP_INSECURE="false"
has_driver=
has_opts=
extra_args=
while test $# -gt 0; do
case "$1" in
kmod|ebpf)
@ -91,6 +95,14 @@ while test $# -gt 0; do
print_usage
exit 1
;;
--kernel-release)
extra_args+="--kernelrelease=$2 "
shift
;;
--kernel-version)
extra_args+="--kernelversion=$2 "
shift
;;
--print-env)
/usr/bin/falcoctl driver printenv
exit 0
@ -109,9 +121,6 @@ while test $# -gt 0; do
shift
done
if [ -z "$has_opts" ]; then
ENABLE_COMPILE="true"
ENABLE_DOWNLOAD="true"
fi
echo "Extra args: $extra_args"
/usr/bin/falcoctl driver install --compile=$ENABLE_COMPILE --download=$ENABLE_DOWNLOAD --http-insecure=$HTTP_INSECURE --http-headers="$FALCOCTL_DRIVER_HTTP_HEADERS"
/usr/bin/falcoctl driver install --compile=$ENABLE_COMPILE --download=$ENABLE_DOWNLOAD --http-insecure=$HTTP_INSECURE --http-headers="$FALCOCTL_DRIVER_HTTP_HEADERS" $extra_args