mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-13 11:55:50 +00:00
falco-driver-loader add TMPDIR support
Closes 2517 Make wrapper now uses $TMPDIR if set. Signed-off-by: jabdr <jd@q321.de>
This commit is contained in:
parent
c18d545259
commit
b83b1e2578
@ -252,6 +252,7 @@ load_kernel_module_compile() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Try to compile using all the available gcc versions
|
# Try to compile using all the available gcc versions
|
||||||
|
MAKEWRAPPER="${TMPDIR:-"/tmp"}/falco-dkms-make"
|
||||||
for CURRENT_GCC in $(ls "$(dirname "$(which gcc)")"/gcc*); do
|
for CURRENT_GCC in $(ls "$(dirname "$(which gcc)")"/gcc*); do
|
||||||
# Filter away gcc-{ar,nm,...}
|
# Filter away gcc-{ar,nm,...}
|
||||||
# Only gcc compiler has `-print-search-dirs` option.
|
# Only gcc compiler has `-print-search-dirs` option.
|
||||||
@ -260,10 +261,10 @@ load_kernel_module_compile() {
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
echo "* Trying to dkms install ${DRIVER_NAME} module with GCC ${CURRENT_GCC}"
|
echo "* Trying to dkms install ${DRIVER_NAME} module with GCC ${CURRENT_GCC}"
|
||||||
echo "#!/usr/bin/env bash" > /tmp/falco-dkms-make
|
echo "#!/usr/bin/env bash" > "$MAKEWRAPPER"
|
||||||
echo "make CC=${CURRENT_GCC} \$@" >> /tmp/falco-dkms-make
|
echo "make CC=${CURRENT_GCC} \$@" >> "$MAKEWRAPPER"
|
||||||
chmod +x /tmp/falco-dkms-make
|
chmod +x "$MAKEWRAPPER"
|
||||||
if dkms install --directive="MAKE='/tmp/falco-dkms-make'" -m "${DRIVER_NAME}" -v "${DRIVER_VERSION}" -k "${KERNEL_RELEASE}" 2>/dev/null; then
|
if dkms install --directive="MAKE=${MAKEWRAPPER}" -m "${DRIVER_NAME}" -v "${DRIVER_VERSION}" -k "${KERNEL_RELEASE}" 2>/dev/null; then
|
||||||
echo "* ${DRIVER_NAME} module installed in dkms"
|
echo "* ${DRIVER_NAME} module installed in dkms"
|
||||||
KO_FILE="/var/lib/dkms/${DRIVER_NAME}/${DRIVER_VERSION}/${KERNEL_RELEASE}/${ARCH}/module/${DRIVER_NAME}"
|
KO_FILE="/var/lib/dkms/${DRIVER_NAME}/${DRIVER_VERSION}/${KERNEL_RELEASE}/${ARCH}/module/${DRIVER_NAME}"
|
||||||
if [ -f "$KO_FILE.ko" ]; then
|
if [ -f "$KO_FILE.ko" ]; then
|
||||||
@ -296,6 +297,7 @@ load_kernel_module_compile() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
rm -f "$MAKEWRAPPER"
|
||||||
}
|
}
|
||||||
|
|
||||||
load_kernel_module_download() {
|
load_kernel_module_download() {
|
||||||
|
Loading…
Reference in New Issue
Block a user