Fix: scsi: sd: Atomic write support added in 6.11-rc1
[lttng-modules.git] / scripts / built-in.sh
CommitLineData
f59ec0be 1#!/bin/bash
b7cdc182 2# SPDX-License-Identifier: (GPL-2.0-only OR LGPL-2.1-only)
61baff6e 3# SPDX-FileCopyrightText: 2015-2021 EfficiOS Inc.
f59ec0be
MJ
4
5set -e
6
7usage() {
8 echo "usage: $0 <kernel source tree>" >&2
9 exit 1
10}
11
12[ "$#" -eq 1 ] || usage
13KERNEL_DIR="$(readlink --canonicalize-existing "$1")"
14
15# Symlink the lttng-modules directory in the kernel source
16ln -sf "$(pwd)" "${KERNEL_DIR}/lttng"
17
18# Graft ourself to the kernel build system
25fd0688 19echo 'source "lttng/src/Kconfig"' >> "${KERNEL_DIR}/Kconfig"
78d67057
MJ
20
21# In kernel v6.1, subdirectories were moved to Kbuild
22if grep -qE '^obj-y[[:space:]]+\+= kernel/' "${KERNEL_DIR}/Kbuild"; then
23 echo 'obj-y += lttng/' >> "${KERNEL_DIR}/Kbuild"
24else
25 sed -i 's#+= kernel/#+= kernel/ lttng/#' "${KERNEL_DIR}/Makefile"
26fi
f59ec0be
MJ
27
28echo >&2
29echo " $0: done." >&2
30echo " $0: now you can build the kernel with LTTng support." >&2
31echo " $0: make sure you enable it (CONFIG_LTTNG) before building." >&2
32echo >&2
This page took 0.055932 seconds and 4 git commands to generate.