Re: [lttng-dev] [PATCH] Fix: list lttng sub-directory in Kbuild

Mathieu Desnoyers via lttng-dev <[email protected]>
Newsgroups org.lttng.lists.lttng-dev
Message-ID <[email protected]>
On 8/10/23 06:05, Richa Bharti wrote:
> From: Richa Bharti <[email protected]>

Hi!

Thanks for your patch. I'm adding Michael Jeanson and the lttng-dev 
mailing list in CC.

Thanks,

Mathieu

> 
> * Linux kernel>=6.1 reads sub-directory from Kbuild
> * Kernel < 6.1 reads sub-directory from Makefile
> 
> Signed-off-by: Richa Bharti <[email protected]>
> ---
>   scripts/built-in.sh | 12 +++++++++++-
>   1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/built-in.sh b/scripts/built-in.sh
> index f0594ec..2451230 100755
> --- a/scripts/built-in.sh
> +++ b/scripts/built-in.sh
> @@ -14,9 +14,19 @@ KERNEL_DIR="$(readlink --canonicalize-existing "$1")"
>   # Symlink the lttng-modules directory in the kernel source
>   ln -sf "$(pwd)" "${KERNEL_DIR}/lttng"
>   
> +# Get kernel version from Makefile
> +version=$(grep -m 1 VERSION ${KERNEL_DIR}/Makefile | sed 's/^.*= //g')
> +patchlevel=$(grep -m 1 PATCHLEVEL ${KERNEL_DIR}/Makefile | sed 's/^.*= //g')
> +kernel_version=${version}.${patchlevel}
> +
>   # Graft ourself to the kernel build system
>   echo 'source "lttng/src/Kconfig"' >> "${KERNEL_DIR}/Kconfig"
> -sed -i 's#+= kernel/#+= kernel/ lttng/#' "${KERNEL_DIR}/Makefile"
> +
> +if awk "BEGIN {exit !(${kernel_version} >= 6.1)}"; then
> +	echo 'obj-y += lttng/' >> "${KERNEL_DIR}/Kbuild"
> +else
> +	sed -i 's#+= kernel/#+= kernel/ lttng/#' "${KERNEL_DIR}/Makefile"
> +fi
>   
>   echo >&2
>   echo "    $0: done." >&2

-- 
Mathieu Desnoyers
EfficiOS Inc.
https://www.efficios.com

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.