-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. Add intel/arm container builds 2. Do not pre-load module on build so that arm modules don't fail intel builds and vice versa
- Loading branch information
Showing
6 changed files
with
32 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
# Build container with all available modules | ||
FROM alpine:3.18 | ||
|
||
COPY ko/*.ko /tmp/modules/ | ||
COPY scripts/load-all-modules.sh /opt/scripts/load-all-modules.sh | ||
COPY ko/*.ko /opt/modules/ | ||
COPY scripts/entrypoint.sh /opt/scripts/entrypoint.sh | ||
|
||
RUN /opt/scripts/load-all-modules.sh | ||
RUN apk add kmod | ||
ENTRYPOINT [ "/opt/scripts/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
#!/bin/sh | ||
|
||
# Get the current kernel version | ||
current_kernel_version=$(uname -r) | ||
kernel_version=$(uname -r) | ||
|
||
# Check if the module directory exists for the current kernel | ||
module_path="/opt/lib/modules/${current_kernel_version}/pf_ring.ko" | ||
module_path="/opt/modules/pf-ring-${kernel_version}.ko" | ||
|
||
if [ -f "$module_path" ]; then | ||
# Check if the module is already loaded | ||
if ! lsmod | grep -q pf_ring; then | ||
echo "Loading pf_ring module for kernel ${current_kernel_version}" | ||
insmod $module_path | ||
echo "Loading pf_ring module for kernel ${kernel_version}" | ||
module_load_path="/opt/lib/modules/${kernel_version}/pf_ring.ko" | ||
mkdir /opt/lib/modules/${kernel_version} -p | ||
cp $module_path ${module_load_path} | ||
depmod -b /opt ${kernel_version} | ||
insmod ${module_load_path} | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to load module from $module_path" | ||
echo "Failed to load module from ${module_load_path}" | ||
echo "Falling back to AF_PACKET" | ||
exit 0 | ||
fi | ||
echo "pf_ring module loaded for kernel ${kernel_version}" | ||
else | ||
echo "pf_ring module is already loaded for kernel ${current_kernel_version}" | ||
echo "pf_ring module is already loaded for kernel ${kernel_version}" | ||
exit 0 | ||
fi | ||
else | ||
echo "No pf_ring module found for the current kernel version ${current_kernel_version}" | ||
echo "No pf_ring module found for the current kernel version ${kernel_version}" | ||
echo "Falling back to AF_PACKET" | ||
fi |
This file was deleted.
Oops, something went wrong.