From ab4f2f5077a7ed7db389d85396821807a74cef99 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 10 May 2020 18:59:38 +0000 Subject: [PATCH 1/2] scripts/generate-kernel-patch: Use the generic drivers Makefile for CentOS 6.x git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8892 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/generate-kernel-patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/generate-kernel-patch b/scripts/generate-kernel-patch index 91bd9bc25..fbf736e19 100755 --- a/scripts/generate-kernel-patch +++ b/scripts/generate-kernel-patch @@ -5,7 +5,7 @@ # Script for converting the SCST source tree as it exists in the Subversion # repository to a Linux kernel patch. # -# Copyright (C) 2008-2009 Bart Van Assche +# Copyright (C) 2008-2020 Bart Van Assche # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -342,7 +342,8 @@ else "drivers/Kconfig" fi -if [ -e "scst/kernel/in-tree/Makefile.drivers.Linux-${kver}.patch" ]; then +if [ "${full_kver#2.6.32-}" = "${full_kver}" ] && + [ -e "scst/kernel/in-tree/Makefile.drivers.Linux-${kver}.patch" ]; then add_patch "scst/kernel/in-tree/Makefile.drivers.Linux-${kver}.patch"\ "drivers/Makefile" else From f40d96c8a070bbc5df5a6a7109c1fc1146eb0c72 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 10 May 2020 19:00:39 +0000 Subject: [PATCH 2/2] scripts/run-regression-tests: Make the CentOS build less noisy git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8893 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/run-regression-tests | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/scripts/run-regression-tests b/scripts/run-regression-tests index cb9a4362d..b1c007b98 100755 --- a/scripts/run-regression-tests +++ b/scripts/run-regression-tests @@ -263,6 +263,7 @@ 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 \ @@ -315,7 +316,10 @@ CONFIG_X86_X32 \ ( cd "${outputdir}/linux-$1" && if [ "${multiple_patches}" = "false" ]; then - patch -p1 -f -s <"${patchfile}" >"${patchoutput}" + if ! patch -p1 -f -s <"${patchfile}" >"${patchoutput}"; then + echo "Error: applying ${patchfile} failed." + exit 1 + fi else rm -f "${patchoutput}" for p in "${outputdir}/${patchdir}"/*; do @@ -326,7 +330,11 @@ 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 + make -s oldconfig "${configureoutput}" && + for c in $enable; do + grep -q "^$c=[ym]" .config || + echo "Enabling $c failed." + done ) } @@ -424,7 +432,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 $* ..." @@ -675,12 +683,21 @@ do if [ "${run_checkpatch}" = "true" ]; then run_checkpatch "$k" fi - patch_and_configure_kernel "$k" + patch_and_configure_kernel "$k" || continue case "$k" in + *^*) + # CentOS. + ;; 2.*|3.*) - # Tell the kernel that we are using gcc 4.6. + # Tell the kernel that we are using gcc 4.6 since older kernel + # versions do not suppor recent gcc versions. 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).