Add remaining Linux kernel 3.0 patches and port nightly build scripts to 3.0 too.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3783 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2011-07-27 14:05:47 +00:00
parent 4f828ba8a3
commit dbc55781d7
11 changed files with 136 additions and 52 deletions

View File

@@ -0,0 +1,5 @@
ccflags-y += -Idrivers/scsi/qla2xxx
qla2x00tgt-y := qla2x00t.o
obj-$(CONFIG_SCST_QLA_TGT_ADDON) += qla2x00tgt.o

View File

@@ -23,6 +23,8 @@
# Function definitions #
########################
source $(dirname $0)/kernel-version
function usage {
echo "Usage: $0 [-d] [-h] [-m] [-n] [-p <dir>] [-s] [-u] <kernel version>"
echo "where: "
@@ -45,8 +47,8 @@ function add_patch {
exit 1
fi
sed -e "s:^--- [^ ]*:--- orig/linux-${kernel_version}/$2:" \
-e "s:^+++ [^ ]*:+++ linux-${kernel_version}/$2:" \
sed -e "s:^--- [^ ]*:--- orig/linux-${kver}/$2:" \
-e "s:^+++ [^ ]*:+++ linux-${kver}/$2:" \
< "$1"
}
@@ -67,9 +69,9 @@ function add_file {
# -- skip *.mod.c.
if [ "$1" = "${1%.mod.c}" -a "$1" ]; then
cat <<EOF
diff -uprN orig/linux-${kernel_version}/$2 linux-${kernel_version}/$2
--- orig/linux-${kernel_version}/$2
+++ linux-${kernel_version}/$2
diff -uprN orig/linux-${kver}/$2 linux-${kver}/$2
--- orig/linux-${kver}/$2
+++ linux-${kver}/$2
@@ -0,0 +1,$(wc -l "$1" | { read a b; echo $a; }) @@
EOF
# Insert a '+'-sign at the start of each line.
@@ -93,9 +95,9 @@ function add_empty_file {
local a b
cat <<EOF
diff -uprN orig/linux-${kernel_version}/$1 linux-${kernel_version}/$1
--- orig/linux-${kernel_version}/$1
+++ linux-${kernel_version}/$1
diff -uprN orig/linux-${kver}/$1 linux-${kver}/$1
--- orig/linux-${kver}/$1
+++ linux-${kver}/$1
@@ -0,0 +1,1 @@
+
EOF
@@ -107,7 +109,7 @@ function specialize_patch {
if [ "${enable_specialize}" = "true" ]; then
"$(dirname $0)/specialize-patch" \
${specialize_patch_options} \
-v kernel_version="${kernel_version}" \
-v kernel_version="${kver}" \
-v SCSI_EXEC_REQ_FIFO_DEFINED="${scsi_exec_req_fifo_defined}" \
-v SCST_IO_CONTEXT="${scst_io_context}" \
| if [ "${generating_upstream_patch}" = "true" ]; then
@@ -120,7 +122,7 @@ function specialize_patch {
fi
}
# Read a patch from stdin, specialize it for kernel version ${kernel_version}
# Read a patch from stdin, specialize it for kernel version ${kver}
# and write the output either to stdout or to the file $1 (if not empty),
# depending on the value of the variable ${multiple_patches}.
function process_patch {
@@ -207,16 +209,11 @@ if [ $# != 1 ]; then
fi
# Strip patch level from the kernel version number.
if [ "${1#[0-9]*.[0-9]*.[0-9]*.[0-9]*}" != "$1" ]; then
kernel_version="${1%.[0-9]*}"
patch_level="${1#${kernel_version}.}"
else
kernel_version="$1"
fi
kver="$(kernel_version "$1")"
# Make sure that for kernel 2.6.33 and later the line
# "#define CONFIG_SCST_PROC" is removed from scst/include/scst.h.
if grep -qw scst_sysfs scst/kernel/in-tree/Makefile.scst-${kernel_version} \
if grep -qw scst_sysfs scst/kernel/in-tree/Makefile.scst-${kver} \
|| [ "${generating_upstream_patch}" = "true" ];
then
specialize_patch_options="${specialize_patch_options} -v config_scst_proc_undefined=1"
@@ -243,7 +240,7 @@ fi
# Patch Generation #
####################
for f in fcst/linux-patches/series-${kernel_version}*
for f in fcst/linux-patches/series-${kver}*
do
if [ -e "$f" ]; then
fcst_patch_series="$f"
@@ -255,8 +252,8 @@ done
scsi_exec_req_fifo_defined=0
scst_io_context=0
for p in scst/kernel/*-${kernel_version}.patch \
iscsi-scst/kernel/patches/*-${kernel_version}.patch
for p in scst/kernel/*-${kver}.patch \
iscsi-scst/kernel/patches/*-${kver}.patch
do
# Exclude the put_page_callback patch when command-line option -u has been
# specified since the current approach is not considered acceptable for
@@ -271,7 +268,7 @@ do
scst_io_context=1
fi
diffname="${p#scst/kernel/}"
diffname="${p%-${kernel_version}.patch}.diff"
diffname="${p%-${kver}.patch}.diff"
process_patch < "$p" "${diffname}"
fi
done
@@ -305,10 +302,10 @@ done
# Directory drivers/
(
add_patch "scst/kernel/in-tree/Kconfig.drivers.Linux-${kernel_version}.patch" \
add_patch "scst/kernel/in-tree/Kconfig.drivers.Linux-${kver}.patch" \
"drivers/Kconfig"
add_patch "scst/kernel/in-tree/Makefile.drivers.Linux-${kernel_version}.patch"\
add_patch "scst/kernel/in-tree/Makefile.drivers.Linux-${kver}.patch"\
"drivers/Makefile"
) \
| process_patch "scst_01_drivers_kbuild.diff"
@@ -320,7 +317,7 @@ add_patch "scst/kernel/in-tree/Makefile.drivers.Linux-${kernel_version}.patch"\
tmpdir="/tmp/scst-$$"
mkdir -p "${tmpdir}"
tmp_Kconfig="${tmpdir}/Kconfig.scst-${kernel_version}"
tmp_Kconfig="${tmpdir}/Kconfig.scst-${kver}"
cat "scst/kernel/in-tree/Kconfig.scst" | \
if [ -e "${fcst_patch_series}" ]; then
cat
@@ -329,8 +326,8 @@ else
fi >"${tmp_Kconfig}"
add_file "${tmp_Kconfig}" "drivers/scst/Kconfig"
tmp_Makefile="${tmpdir}/Makefile.scst-${kernel_version}"
cat "scst/kernel/in-tree/Makefile.scst-${kernel_version}" | \
tmp_Makefile="${tmpdir}/Makefile.scst-${kver}"
cat "scst/kernel/in-tree/Makefile.scst-${kver}" | \
if [ "${generating_upstream_patch}" = "true" ]; then
grep -v 'scst_proc'
else
@@ -371,7 +368,7 @@ done
# Directory drivers/scst/dev_handlers/
add_file "scst/kernel/in-tree/Makefile.dev_handlers-${kernel_version}" \
add_file "scst/kernel/in-tree/Makefile.dev_handlers-${kver}" \
"drivers/scst/dev_handlers/Makefile" \
| process_patch "scst_11_dev_handlers_makefile.diff"
@@ -460,7 +457,7 @@ if [ "${qla2x00t}" = "true" ]; then
add_file "qla2x00t/qla2x_tgt_def.h" \
"drivers/scsi/qla2xxx/qla2x_tgt_def.h"
add_file "qla2x00t/qla2x00-target/Makefile_in-tree-${kernel_version}" \
add_file "qla2x00t/qla2x00-target/Makefile_in-tree-${kver}" \
"drivers/scst/qla2xxx-target/Makefile"
add_file "qla2x00t/qla2x00-target/Kconfig" \
@@ -558,7 +555,7 @@ fi
add_file "scst_local/in-tree/Kconfig" "drivers/scst/scst_local/Kconfig"
add_file "scst_local/in-tree/Makefile-${kernel_version}" "drivers/scst/scst_local/Makefile"
add_file "scst_local/in-tree/Makefile-${kver}" "drivers/scst/scst_local/Makefile"
add_file "scst_local/scst_local.c" "drivers/scst/scst_local/scst_local.c"
) \
@@ -569,8 +566,8 @@ fi
# Directory drivers/scsi/ibmvstgt
{
( cd ibmvstgt && ./generate-in-tree-patches "${kernel_version}" )
if [ -e "ibmvstgt/in-tree-patches/${kernel_version}" ]; then
( cd ibmvstgt && ./generate-in-tree-patches "${kver}" )
if [ -e "ibmvstgt/in-tree-patches/${kver}" ]; then
if [ "${multiple_patches}" = "true" ]; then
cat <<EOF
[SCSI] ibmvstgt: Port from tgt to SCST
@@ -662,7 +659,7 @@ EOF
include/scsi/libsrp.h \
include/scsi/srp.h
do
patch="ibmvstgt/in-tree-patches/${kernel_version}/$(basename $f).patch"
patch="ibmvstgt/in-tree-patches/${kver}/$(basename $f).patch"
if [ -e "${patch}" ]; then
add_patch "${patch}" $f
fi
@@ -673,8 +670,8 @@ EOF
| process_patch "scst_18_ibmvstgt.diff"
{
( cd ibmvstgt && ./generate-in-tree-patches "${kernel_version}" )
if [ -e "ibmvstgt/in-tree-patches/${kernel_version}" ]; then
( cd ibmvstgt && ./generate-in-tree-patches "${kver}" )
if [ -e "ibmvstgt/in-tree-patches/${kver}" ]; then
if [ "${multiple_patches}" = "true" ]; then
cat <<EOF
[SCSI] tgt: Removal
@@ -741,7 +738,7 @@ EOF
include/scsi/scsi_tgt.h \
include/scsi/scsi_tgt_if.h
do
add_patch "ibmvstgt/in-tree-patches/${kernel_version}/$(basename $f).patch" $f
add_patch "ibmvstgt/in-tree-patches/${kver}/$(basename $f).patch" $f
done
fi
} \

21
scripts/kernel-version Normal file
View File

@@ -0,0 +1,21 @@
# -*- mode: shell-script -*-
# Shell functions for parsing the Linux kernel version.
# Kernel version number.
function kernel_version {
if [ "${1#2.}" != "$1" ]; then
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/p'
else
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\).*$/\1/p'
fi
}
# Last component of the kernel version, or the empty string if $1 does
# not contain a patchlevel.
function patchlevel {
if [ "${1#2.}" != "$1" ]; then
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\.[0-9]*\)[.-]\(.*\)$/\2/p'
else
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\)[.-]\(.*\)$/\2/p'
fi
}

View File

@@ -54,6 +54,8 @@
# Function definitions #
########################
source $(dirname $0)/kernel-version
function usage {
echo "Usage: $0 [-c <dir>] [-d <dir>] [-f] [-h] [-j <jobs>] [-p <patchdir>] [-q] <kver1> <kver2> ..."
echo " -c - cache directory for Linux kernel tarballs."
@@ -65,17 +67,6 @@ function usage {
echo " <kver1> <kver2> ... - kernel versions to test."
}
# First three components of the kernel version number.
function kernel_version {
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/p'
}
# Last component of the kernel version, or the empty string if $1 has only
# three components.
function patchlevel {
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\.[0-9]*\)[.-]\(.*\)$/\2/p'
}
# Create a linux-$1 tree in the current directory, where $1 is a kernel
# version number with either three or four components.
function extract_kernel_tree {
@@ -284,16 +275,18 @@ function download_file {
function download_kernel {
local kver="$(kernel_version $1)"
local plevel="$(patchlevel $1)"
local series="$1"
series="${series:0:3}"
mkdir -p "${kernel_sources}" || return $?
test -w "${kernel_sources}" || return $?
(
cd "${kernel_sources}" || return $?
download_file "${kernel_mirror}/linux-$(kernel_version $1).tar.bz2" \
download_file "${kernel_mirror}/v$series/linux-$kver.tar.bz2" \
|| return $?
if [ "${plevel}" != "" ]; then
download_file "${kernel_mirror}/patch-$1.bz2" \
|| download_file "${kernel_longterm}/v$(kernel_version $1)/patch-$1.bz2" \
|| download_file "${kernel_longterm}/v$series/longterm/v$kver/patch-$1.bz2" \
|| return $?
fi
)
@@ -547,8 +540,8 @@ fi
# Where to store persistenly downloaded kernel tarballs and kernel patches.
kernel_sources="$HOME/software/downloads"
# URL for downloading kernel tarballs and kernel patches.
kernel_mirror="ftp://ftp.eu.kernel.org/pub/linux/kernel/v2.6"
kernel_longterm="http://www.kernel.org/pub/linux/kernel/v2.6/longterm"
kernel_mirror="ftp://ftp.eu.kernel.org/pub/linux/kernel"
kernel_longterm="http://www.kernel.org/pub/linux/kernel"
kernel_versions=""
# Directory in which the regression test output files will be stored. Must be
# an absolute path.

View File

@@ -31,7 +31,8 @@
# the KERNEL_VERSION() macro.
function version_code(kver, array) {
match(kver, "([0-9]+).([0-9]+).([0-9]+)", array)
if (!match(kver, "([0-9]+).([0-9]+).([0-9]+)", array))
match(kver, "([0-9]+).([0-9]+)", array)
return 65536*array[1] + 256*array[2] + array[3]
}
@@ -396,7 +397,7 @@ BEGIN {
exit 1
}
LINUX_VERSION_CODE = version_code(kernel_version)
if (LINUX_VERSION_CODE < 2*65536 || LINUX_VERSION_CODE > 3*65536)
if (LINUX_VERSION_CODE < 2*65536 || LINUX_VERSION_CODE > 4*65536)
{
printf "Error: kernel version (%s) is out of range.\n", kernel_version
exit 1

View File

@@ -0,0 +1,13 @@
diff --git a/drivers/Kconfig b/drivers/Kconfig
index a2b902f..92e3d67 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -22,6 +22,8 @@ source "drivers/ide/Kconfig"
source "drivers/scsi/Kconfig"
+source "drivers/scst/Kconfig"
+
source "drivers/ata/Kconfig"
source "drivers/md/Kconfig"

View File

@@ -0,0 +1,14 @@
ccflags-y += -Wno-unused-parameter
obj-m := scst_cdrom.o scst_changer.o scst_disk.o scst_modisk.o scst_tape.o \
scst_vdisk.o scst_raid.o scst_processor.o scst_user.o
obj-$(CONFIG_SCST_DISK) += scst_disk.o
obj-$(CONFIG_SCST_TAPE) += scst_tape.o
obj-$(CONFIG_SCST_CDROM) += scst_cdrom.o
obj-$(CONFIG_SCST_MODISK) += scst_modisk.o
obj-$(CONFIG_SCST_CHANGER) += scst_changer.o
obj-$(CONFIG_SCST_RAID) += scst_raid.o
obj-$(CONFIG_SCST_PROCESSOR) += scst_processor.o
obj-$(CONFIG_SCST_VDISK) += scst_vdisk.o
obj-$(CONFIG_SCST_USER) += scst_user.o

View File

@@ -0,0 +1,11 @@
diff --git a/drivers/Makefile b/drivers/Makefile
index b423bb1..f780114 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -115,5 +115,6 @@ obj-$(CONFIG_VLYNQ) += vlynq/
obj-$(CONFIG_STAGING) += staging/
obj-y += platform/
obj-y += ieee802154/
+obj-$(CONFIG_SCST) += scst/
#common clk code
obj-y += clk/

View File

@@ -0,0 +1,13 @@
ccflags-y += -Wno-unused-parameter
scst-y += scst_main.o
scst-y += scst_pres.o
scst-y += scst_targ.o
scst-y += scst_lib.o
scst-y += scst_sysfs.o
scst-y += scst_mem.o
scst-y += scst_tg.o
scst-y += scst_debug.o
obj-$(CONFIG_SCST) += scst.o dev_handlers/ fcst/ iscsi-scst/ qla2xxx-target/ \
srpt/ scst_local/

View File

@@ -0,0 +1,2 @@
obj-$(CONFIG_SCST_LOCAL) += scst_local.o

View File

@@ -0,0 +1,14 @@
diff --git a/Makefile b/Makefile
index d018956..3c3b936 100644
--- a/Makefile
+++ b/Makefile
@@ -357,7 +357,8 @@ CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
# Use LINUXINCLUDE when you must reference the include/ directory.
# Needed to be compatible with the O= option
-LINUXINCLUDE := -I$(srctree)/arch/$(hdr-arch)/include \
+LINUXINCLUDE := $(PRE_CFLAGS) \
+ -I$(srctree)/arch/$(hdr-arch)/include \
-Iarch/$(hdr-arch)/include/generated -Iinclude \
$(if $(KBUILD_SRC), -I$(srctree)/include) \
-include include/generated/autoconf.h