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
This commit is contained in:
Bart Van Assche
2014-12-03 17:14:42 +00:00
parent 1871ca8abc
commit 3680f57572
3 changed files with 53 additions and 7 deletions

View File

@@ -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

View File

@@ -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 $?

View File

@@ -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