mirror of
https://github.com/falcosecurity/falco.git
synced 2025-06-27 15:17:50 +00:00
update(scripts/falco-driver-loader): load the latest version first
Signed-off-by: Leonardo Grasso <me@leonardograsso.com>
This commit is contained in:
parent
e1e8715a0f
commit
8a1de131f4
@ -196,8 +196,12 @@ load_kernel_module_download() {
|
|||||||
if curl -L --create-dirs "${FALCO_DRIVER_CURL_OPTIONS}" -o "${HOME}/.falco/${FALCO_KERNEL_MODULE_FILENAME}" "${URL}"; then
|
if curl -L --create-dirs "${FALCO_DRIVER_CURL_OPTIONS}" -o "${HOME}/.falco/${FALCO_KERNEL_MODULE_FILENAME}" "${URL}"; then
|
||||||
echo "* Download succeeded"
|
echo "* Download succeeded"
|
||||||
chcon -t modules_object_t "${HOME}/.falco/${FALCO_KERNEL_MODULE_FILENAME}" > /dev/null 2>&1 || true
|
chcon -t modules_object_t "${HOME}/.falco/${FALCO_KERNEL_MODULE_FILENAME}" > /dev/null 2>&1 || true
|
||||||
insmod "${HOME}/.falco/${FALCO_KERNEL_MODULE_FILENAME}" && echo "* Success: ${DRIVER_NAME} module found and inserted"
|
if insmod "${HOME}/.falco/${FALCO_KERNEL_MODULE_FILENAME}"; then
|
||||||
exit $?
|
echo "* Success: ${DRIVER_NAME} module found and inserted"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
>&2 echo "Unable to insmod the prebuilt ${DRIVER_NAME} module"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
>&2 echo "Unable to find a prebuilt ${DRIVER_NAME} module"
|
>&2 echo "Unable to find a prebuilt ${DRIVER_NAME} module"
|
||||||
return
|
return
|
||||||
@ -241,11 +245,6 @@ load_kernel_module() {
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "* Trying to load a system ${DRIVER_NAME} module, if present"
|
|
||||||
if modprobe "${DRIVER_NAME}" > /dev/null 2>&1; then
|
|
||||||
echo "* Success: ${DRIVER_NAME} module found and loaded with modprobe"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "* Looking for a ${DRIVER_NAME} module locally (kernel ${KERNEL_RELEASE})"
|
echo "* Looking for a ${DRIVER_NAME} module locally (kernel ${KERNEL_RELEASE})"
|
||||||
|
|
||||||
@ -268,6 +267,13 @@ load_kernel_module() {
|
|||||||
load_kernel_module_compile
|
load_kernel_module_compile
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Last try (might load a previous driver version)
|
||||||
|
echo "* Trying to load a system ${DRIVER_NAME} module, if present"
|
||||||
|
if modprobe "${DRIVER_NAME}" > /dev/null 2>&1; then
|
||||||
|
echo "* Success: ${DRIVER_NAME} module found and loaded with modprobe"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Not able to download a prebuilt module nor to compile one on-the-fly
|
# Not able to download a prebuilt module nor to compile one on-the-fly
|
||||||
>&2 echo "Consider compiling your own ${DRIVER_NAME} driver and loading it or getting in touch with the Falco community"
|
>&2 echo "Consider compiling your own ${DRIVER_NAME} driver and loading it or getting in touch with the Falco community"
|
||||||
exit 1
|
exit 1
|
||||||
|
Loading…
Reference in New Issue
Block a user