Skip to content

Commit

Permalink
[SMAGENT-981] calculate HASH of fedora atomic kernel config (#1172)
Browse files Browse the repository at this point in the history
* calculate HASH of fedora atomic kernel config
* changed path to /lib/modules/.../config
* added comment on symlink assumption inside container
  • Loading branch information
hwchen authored Jul 18, 2018
1 parent 23404e2 commit 6956082
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sysdig-probe-loader
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ get_kernel_config() {
elif [ ! -z "${SYSDIG_HOST_ROOT}" ] && [ -f "${SYSDIG_HOST_ROOT}/usr/lib/ostree-boot/config-${KERNEL_RELEASE}" ]; then
echo "Found kernel config at ${SYSDIG_HOST_ROOT}/usr/lib/ostree-boot/config-${KERNEL_RELEASE}"
HASH=$(md5sum "${SYSDIG_HOST_ROOT}/usr/lib/ostree-boot/config-${KERNEL_RELEASE}" | cut -d' ' -f1)
elif [ -f /lib/modules/${KERNEL_RELEASE}/config ]; then
# this code works both for native host and agent container assuming that
# Dockerfile sets up the desired symlink /lib/modules -> $SYSDIG_HOST_ROOT/lib/modules
echo "Found kernel config at /lib/modules/${KERNEL_RELEASE}/config"
HASH=$(md5sum "/lib/modules/${KERNEL_RELEASE}/config" | cut -d' ' -f1)
fi

if [ -z "${HASH}" ]; then
Expand Down

0 comments on commit 6956082

Please sign in to comment.