Files
scst/scripts/kernel/generate-patched-kernel
T
Gleb Chesnokov 43e717c7f1 scripts: Group kernel maintenance helpers under kernel/
Move patch generation, specialization, regression, kernel selection and
module signing helpers together, with their shared shell libraries. Update
component Makefiles, CI, nightly jobs, packaging metadata, documentation
and KUnit tooling references alongside the move.

Adjust repository-root and source-inventory lookups for the deeper path.
Resolve rhel-rpm-functions relative to kernel-functions through
BASH_SOURCE, since it is also sourced by the QLogic extraction helpers.

Keep the regression runner behavior and the nightly kernel matrix intact,
including the existing checkpatch, sparse and smatch switches and policy.
2026-10-19 10:31:32 +03:00

56 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
############################################################################
#
# Script for generating a kernel source tree with the SCST patches applied.
#
# Copyright (C) 2010 Bart Van Assche <bvanassche@acm.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, version 2
# of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
############################################################################
function usage {
echo "Usage: $0 <kernel version>"
}
script_dir="$(dirname "$0")"
if [ "${script_dir#/}" = "${script_dir}" ]; then
script_dir="$PWD/$script_dir"
fi
script_dir="${script_dir%/.}"
scst_dir="$(dirname "$(dirname "${script_dir}")")"
# shellcheck source=./kernel-functions
source "${script_dir}/kernel-functions"
if [ "$1" = "" ]; then
echo "Error: missing kernel version argument."
exit 1
fi
target="linux-$1"
kernel_version="$(kernel_version "$1")"
download_and_extract_kernel_tree "$1" || exit $?
cd "${target}" || exit $?
"${script_dir}/../source/list-source-files" "${scst_dir}" |
grep -- "-${kernel_version}.*.patch$" |
grep -v /in-tree/ |
while read -r p; do
echo "==== $p"
patch -p1 <"${scst_dir}/$p" || exit $?
done