mirror of
https://github.com/SCST-project/scst.git
synced 2026-09-29 03:05:46 +00:00
Undo the changes from r8916
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.4.x@8917 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
#
|
||||
# Script for running those SCST regression tests that can be run automatically.
|
||||
#
|
||||
# Copyright (C) 2008-2020 Bart Van Assche <bvanassche@acm.org>
|
||||
# Copyright (C) 2008-2009 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
|
||||
@@ -199,23 +199,22 @@ function compile_scst_patched {
|
||||
}
|
||||
|
||||
# Generate a kernel patch from the SCST source tree for kernel version $1
|
||||
# and with generate-kernel-patch options $2. $1 may be a
|
||||
# ${kver}^${distro}^${release} triplet.
|
||||
# and with generate-kernel-patch options $2.
|
||||
function generate_kernel_patch {
|
||||
local kver
|
||||
local patchfile="${outputdir}/scst-${1/^*}-kernel.patch"
|
||||
local patchfile_m="${outputdir}/scst-${1/^*}-kernel-matching-line-numbers.patch"
|
||||
local patchfile="${outputdir}/scst-$1-kernel.patch"
|
||||
local patchfile_m="${outputdir}/scst-$1-kernel-matching-line-numbers.patch"
|
||||
local driver_options=""
|
||||
|
||||
kver="$(kernel_version "${1/^*}")"
|
||||
kver="$(kernel_version "$1")"
|
||||
driver_options=(-l)
|
||||
[ "${mpt_scst}" = "true" ] && driver_options+=("-m")
|
||||
|
||||
"${scriptsdir}"/generate-kernel-patch "${driver_options[@]}" $2 "$1" > "${patchfile}"
|
||||
"${scriptsdir}"/generate-kernel-patch "${driver_options[@]}" "$2" "$1" > "${patchfile}"
|
||||
|
||||
"${scriptsdir}"/generate-kernel-patch "${driver_options[@]}" -n $2 "$1" > "${patchfile_m}"
|
||||
"${scriptsdir}"/generate-kernel-patch "${driver_options[@]}" -n "$2" "$1" > "${patchfile_m}"
|
||||
|
||||
"${scriptsdir}"/generate-kernel-patch "${driver_options[@]}" -p "${outputdir}/${patchdir}" $2 "$1"
|
||||
"${scriptsdir}"/generate-kernel-patch "${driver_options[@]}" -p "${outputdir}/${patchdir}" "$2" "$1"
|
||||
}
|
||||
|
||||
# Run checkpatch on the generated kernel patch. Assumes that there is a
|
||||
@@ -263,16 +262,15 @@ function patch_and_configure_kernel {
|
||||
kver="$(kernel_version "$1")"
|
||||
local patchfile="${outputdir}/scst-$1-kernel-matching-line-numbers.patch"
|
||||
local patchoutput="${outputdir}/patch-command-output-$1.txt"
|
||||
local configureoutput="${outputdir}/configure-output.txt"
|
||||
local disable=" \
|
||||
CONFIG_BINARY_PRINTF \
|
||||
CONFIG_BLK_DEV_IO_TRACE \
|
||||
CONFIG_BRANCH_PROFILE_NONE \
|
||||
CONFIG_CONTEXT_SWITCH_TRACER \
|
||||
CONFIG_DEBUG_SECTION_MISMATCH \
|
||||
CONFIG_DEBUG_STRICT_USER_COPY_CHECKS \
|
||||
CONFIG_DYNAMIC_FTRACE \
|
||||
CONFIG_EVENT_TRACE_TEST_SYSCALLS \
|
||||
CONFIG_EVENT_TRACING \
|
||||
CONFIG_FTRACE \
|
||||
CONFIG_FTRACE_MCOUNT_RECORD \
|
||||
CONFIG_FTRACE_NMI_ENTER \
|
||||
@@ -294,7 +292,6 @@ CONFIG_MMIOTRACE \
|
||||
CONFIG_NET_DROP_MONITOR \
|
||||
CONFIG_NOP_TRACER \
|
||||
CONFIG_RETPOLINE \
|
||||
CONFIG_RH_KABI_SIZE_ALIGN_CHECKS \
|
||||
CONFIG_SCHED_TRACER \
|
||||
CONFIG_SECURITY_SELINUX \
|
||||
CONFIG_STACK_TRACER \
|
||||
@@ -308,18 +305,6 @@ CONFIG_X86_X32 \
|
||||
"
|
||||
local enable="CONFIG_UNWINDER_FRAME_POINTER"
|
||||
|
||||
case "$1" in
|
||||
2.6.32-*)
|
||||
echo "Enabling CONFIG_EVENT_TRACING for CentOS 6.x"
|
||||
enable="$enable \
|
||||
CONFIG_DEBUG_KERNEL \
|
||||
CONFIG_FTRACE \
|
||||
CONFIG_EVENT_TRACING \
|
||||
CONFIG_DYNAMIC_DEBUG";;
|
||||
*)
|
||||
disable="$disable CONFIG_EVENT_TRACING";;
|
||||
esac
|
||||
|
||||
echo "Patching and configuring kernel ..."
|
||||
if [ "$ipv6" = "false" ]; then
|
||||
disable="$disable CONFIG_IPV6"
|
||||
@@ -327,10 +312,7 @@ CONFIG_X86_X32 \
|
||||
(
|
||||
cd "${outputdir}/linux-$1" &&
|
||||
if [ "${multiple_patches}" = "false" ]; then
|
||||
if ! patch -p1 -f -s <"${patchfile}" >"${patchoutput}"; then
|
||||
echo "Error: applying ${patchfile} failed."
|
||||
exit 1
|
||||
fi
|
||||
patch -p1 -f -s <"${patchfile}" >"${patchoutput}"
|
||||
else
|
||||
rm -f "${patchoutput}"
|
||||
for p in "${outputdir}/${patchdir}"/*; do
|
||||
@@ -341,11 +323,7 @@ CONFIG_X86_X32 \
|
||||
make -s allmodconfig &>"${outputdir}/make-config-output.txt" &&
|
||||
for c in $disable; do sed -i.tmp "s/^$c=[ym]\$/$c=n/" .config; done &&
|
||||
for c in $enable; do sed -i.tmp "s/^\(# \)*$c\(=.*\| is not set\)\$/$c=y/" .config; done &&
|
||||
make -s oldconfig </dev/null &>"${configureoutput}" &&
|
||||
for c in $enable; do
|
||||
grep -q "^$c=[ym]" .config ||
|
||||
echo "Enabling $c failed."
|
||||
done
|
||||
make -s oldconfig </dev/null &>/dev/null
|
||||
)
|
||||
}
|
||||
|
||||
@@ -443,7 +421,7 @@ function run_smatch {
|
||||
kver="$(kernel_version "$1")"
|
||||
plevel="$(patchlevel "$1")"
|
||||
local outputfile="${outputdir}/smatch-$1-output.txt"
|
||||
local disable="" # "CONFIG_DYNAMIC_DEBUG"
|
||||
local disable="CONFIG_DYNAMIC_DEBUG"
|
||||
shift
|
||||
|
||||
echo "Running smatch on the patched kernel in $* ..."
|
||||
@@ -652,7 +630,7 @@ do
|
||||
run_smatch="true"
|
||||
ipv6="true"
|
||||
global_multiple_patches="${multiple_patches}"
|
||||
while true; do
|
||||
while [ "${kv%-?}" != "${kv}" ] || [ "${kv%-??}" != "${kv}" ]; do
|
||||
kv_without_opt="${kv%-?}"
|
||||
if [ "${kv_without_opt}" = "${kv}" ]; then
|
||||
kv_without_opt="${kv%-??}"
|
||||
@@ -667,7 +645,7 @@ do
|
||||
'-nm') run_smatch="false";;
|
||||
'-u') generate_kernel_patch_options="-u";;
|
||||
'-p') multiple_patches="true";;
|
||||
*) break;;
|
||||
*) echo "Error: unknown option ${kopt}."; exit 1;;
|
||||
esac
|
||||
kv="${kv_without_opt}"
|
||||
done
|
||||
@@ -678,7 +656,6 @@ do
|
||||
(
|
||||
cd "${outputdir}" &&
|
||||
download_and_extract_kernel_tree "$k" &&
|
||||
k="${k/^*}" &&
|
||||
cd "linux-$k/include/linux" &&
|
||||
if [ ! -e compiler-gcc6.h ]; then
|
||||
for f in compiler-gcc5.h compiler-gcc4.h; do
|
||||
@@ -690,25 +667,15 @@ do
|
||||
fi
|
||||
) ||
|
||||
continue
|
||||
k="${k/^*}"
|
||||
if [ "${run_checkpatch}" = "true" ]; then
|
||||
run_checkpatch "$k"
|
||||
fi
|
||||
patch_and_configure_kernel "$k" || continue
|
||||
patch_and_configure_kernel "$k"
|
||||
case "$k" in
|
||||
*^*)
|
||||
# CentOS.
|
||||
;;
|
||||
2.*|3.*)
|
||||
# Tell the kernel that we are using gcc 4.6 since older kernel
|
||||
# versions do not suppor recent gcc versions.
|
||||
# Tell the kernel that we are using gcc 4.6.
|
||||
KCFLAGS="-U__GNUC__ -U__GNUC_MINOR__ -D__GNUC__=4 -D__GNUC_MINOR__=6"
|
||||
esac
|
||||
case "$k" in
|
||||
3.10.0-*)
|
||||
# Make the CentOS 7.x build less noisy.
|
||||
KCFLAGS+=" -Wno-deprecated-declarations";
|
||||
esac
|
||||
# See also commit bd664f6b3e37 ("disable new gcc-7.1.1 warnings for now";
|
||||
# v4.13) and commit 6f303d60534c ("gcc-9: silence 'address-of-packed-member'
|
||||
# warning"; v5.1).
|
||||
|
||||
Reference in New Issue
Block a user