From 3680f5757258d24b44aea556532c4d7aaeacd985 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 3 Dec 2014 17:14:42 +0000 Subject: [PATCH] scripts: Merge 5827:5907 from trunk git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5908 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scripts/generate-release-archive | 12 ++++++---- scripts/rebuild-rhel-kernel-rpm | 38 +++++++++++++++++++++++++++++++- scripts/specialize-patch | 10 +++++++-- 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/scripts/generate-release-archive b/scripts/generate-release-archive index 1c4fe2d75..3980ac7dd 100755 --- a/scripts/generate-release-archive +++ b/scripts/generate-release-archive @@ -4,15 +4,19 @@ usage() { echo "Usage: $(basename $0) name version" } -if [ $# != 2 ]; then +if [ $# -lt 2 ]; then usage exit 1 fi scriptdir="$(dirname "$0")" -name="$1" -version="$2" +name="$1"; shift +version="$1"; shift +files="$*" +if [ -z "$files" ]; then + files=$($scriptdir/list-source-files) +fi tar --owner=root --group=root --transform="s|^|$name-$version/|" \ - -cjf $name-$version.tar.bz2 $($scriptdir/list-source-files) && + -cjf $name-$version.tar.bz2 $files && ls -l $name-$version.tar.bz2 diff --git a/scripts/rebuild-rhel-kernel-rpm b/scripts/rebuild-rhel-kernel-rpm index e4a96c1d7..df8569a2f 100755 --- a/scripts/rebuild-rhel-kernel-rpm +++ b/scripts/rebuild-rhel-kernel-rpm @@ -227,7 +227,7 @@ copy_best_matching_patch $scst_dir/scst/kernel/rhel/scst_exec_req_fifo scst_exec } copy_best_matching_patch $scst_dir/iscsi-scst/kernel/patches/rhel/put_page_callback put_page_callback.patch || { - echo "No matching scst_exec_req_fifo patch found for kernel version $kver"; + echo "No matching put_page_callback patch found for kernel version $kver"; exit 1; } @@ -365,6 +365,42 @@ diff -u SPECS/kernel.spec{.orig,} make ARCH=$Arch %{oldconfig_target} > /dev/null echo "# $Arch" > configs/$i EOF +elif [ ${kver#2.6.32-504.} != $kver ]; then +# RHEL/CentOS/SL 6.6 +patch -p1 ${rpmbuild_dir}/SPECS/kernel.spec <<'EOF' || exit $? +diff -u SPECS/kernel.spec{.orig,} +--- kernel.spec.orig 2014-12-03 16:20:14.764118318 +0100 ++++ kernel.spec 2014-12-03 16:21:36.606089530 +0100 +@@ -610,6 +610,9 @@ + Source85: config-powerpc64-debug-rhel + Source86: config-s390x-debug-rhel + ++Patch200: scst_exec_req_fifo.patch ++Patch201: put_page_callback.patch ++ + # empty final patch file to facilitate testing of kernel patches + Patch999999: linux-kernel-test.patch + +@@ -932,6 +935,9 @@ + # Dynamically generate kernel .config files from config-* files + make -f %{SOURCE20} VERSION=%{version} configs + ++ApplyPatch scst_exec_req_fifo.patch ++ApplyPatch put_page_callback.patch ++ + ApplyOptionalPatch linux-kernel-test.patch + + # Any further pre-build tree manipulations happen here. +@@ -958,6 +964,8 @@ + for i in *.config + do + mv $i .config ++ echo "CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION=y" >> .config ++ sed -i.tmp -e 's/^CONFIG_SCSI_QLA_FC=.*/CONFIG_SCSI_QLA_FC=n/' .config + Arch=`head -1 .config | cut -b 3-` + make ARCH=$Arch %{oldconfig_target} > /dev/null + echo "# $Arch" > configs/$i +EOF elif [ ${kver#3.10.0-12[13]} != $kver ]; then # RHEL/CentOS/SL 7.0 patch -p1 ${rpmbuild_dir}/SPECS/kernel.spec <<'EOF' || exit $? diff --git a/scripts/specialize-patch b/scripts/specialize-patch index ede8b0a19..dd0c842f2 100755 --- a/scripts/specialize-patch +++ b/scripts/specialize-patch @@ -251,7 +251,7 @@ function evaluate(stmnt, pattern, arg, op, result) { sub(pattern, op[1] == 0 ? op[2] : op[1], stmnt) } - pattern="\\((-*[0-9]+)\\)" + pattern="\\([[:blank:]]*(-*[0-9]+)[[:blank:]]*\\)" while (match(stmnt, pattern, op) != 0) { sub(pattern, op[1], stmnt) @@ -545,11 +545,17 @@ BEGIN { reset_hunk_state_variables() match($0, "^@@ -([0-9]*),([0-9]*) \\+([0-9]*),([0-9]*) @@(.*)$", h) } - else if (delete_next_blank_line && match($0, "^+$")) + else if (delete_next_blank_line && $0 == "+") { discard = 1 delete_next_blank_line = 0 } + else if (lines >= 2 && !match(line[lines-2], ":$") && + line[lines-1] == "+\x9return;" && $0 == "+}") + { + line[lines-1] = $0 + lines_less_added++ + } else { delete_next_blank_line = 0