X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=scripts%2Fbuilt-in.sh;fp=scripts%2Fbuilt-in.sh;h=5e57e9341c03f6c0ab4e05a6cfcb68197d2e6d42;hb=6c27a5ccba05b088fbfcf8cd982c25649838298d;hp=0000000000000000000000000000000000000000;hpb=1c124020c743254923d8e76ab5dcd1f69709982e;p=lttng-modules.git diff --git a/scripts/built-in.sh b/scripts/built-in.sh new file mode 100755 index 00000000..5e57e934 --- /dev/null +++ b/scripts/built-in.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# SPDX-License-Identifier: (GPL-2.0 OR LGPL-2.1) + +set -e + +usage() { + echo "usage: $0 " >&2 + exit 1 +} + +[ "$#" -eq 1 ] || usage +KERNEL_DIR="$(readlink --canonicalize-existing "$1")" + +# Symlink the lttng-modules directory in the kernel source +ln -sf "$(pwd)" "${KERNEL_DIR}/lttng" + +# Graft ourself to the kernel build system +echo 'source "lttng/Kconfig"' >> "${KERNEL_DIR}/Kconfig" +sed -i 's#+= kernel/#+= kernel/ lttng/#' "${KERNEL_DIR}/Makefile" + +echo >&2 +echo " $0: done." >&2 +echo " $0: now you can build the kernel with LTTng support." >&2 +echo " $0: make sure you enable it (CONFIG_LTTNG) before building." >&2 +echo >&2