diff --git a/iscsi-scst/kernel/conn.c b/iscsi-scst/kernel/conn.c index b07249022..6f02c9c98 100644 --- a/iscsi-scst/kernel/conn.c +++ b/iscsi-scst/kernel/conn.c @@ -178,7 +178,8 @@ static ssize_t iscsi_get_initiator_ip(struct iscsi_conn *conn, "[%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x]", NIP6(inet6_sk(sk)->daddr)); #else -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) pos = scnprintf(buf, size, "[%p6]", &inet6_sk(sk)->daddr); #else pos = scnprintf(buf, size, "[%p6]", &sk->sk_v6_daddr); diff --git a/scripts/rebuild-rhel-kernel-rpm b/scripts/rebuild-rhel-kernel-rpm index b881fe4db..88c93d16d 100755 --- a/scripts/rebuild-rhel-kernel-rpm +++ b/scripts/rebuild-rhel-kernel-rpm @@ -85,6 +85,9 @@ case "$distro" in srpm_url=("http://ftp.scientificlinux.org/linux/scientific/$releasevermajor$releaseverminor/SRPMS/vendor") fi ;; + "Fedora") + srpm_url="http://ftp.redhat.com/redhat/rhel/rc/7/Server/source/tree/Packages" + ;; *) echo "Unknown type of distribution: $distro" exit 1 @@ -183,7 +186,10 @@ log "Copying SCST patches to the SOURCES directory" cd ${rpmbuild_dir}/SOURCES copy_patch $scst_dir/scst/kernel/rhel/scst_exec_req_fifo-${kver}.patch scst_exec_req_fifo.patch -copy_patch $scst_dir/iscsi-scst/kernel/patches/rhel/put_page_callback-${kver}.patch put_page_callback.patch +f="$scst_dir/iscsi-scst/kernel/patches/rhel/put_page_callback-${kver}.patch" +if [ -e "$f" ]; then + copy_patch "$f" put_page_callback.patch +fi log "Adding SCST patches in kernel.spec" @@ -319,6 +325,49 @@ diff -u SPECS/kernel.spec{.orig,} make ARCH=$Arch %{oldconfig_target} > /dev/null echo "# $Arch" > configs/$i EOF +elif [ ${kver#3.10.0-121} != $kver ]; then +# RHEL/CentOS/SL 7.0 +patch -p1 ${rpmbuild_dir}/SPECS/kernel.spec <<'EOF' || exit $? +--- kernel.spec.orig 2014-05-23 10:09:17.707202148 +0200 ++++ kernel.spec 2014-05-23 10:15:50.883937952 +0200 +@@ -4,6 +4,7 @@ + Summary: The Linux kernel + + # % define buildid .local ++%define buildid .scst + + # For a stable, released kernel, released_kernel should be 1. For rawhide + # and/or a kernel built from an rc or git snapshot, released_kernel should +@@ -367,6 +368,9 @@ + Source2000: cpupower.service + Source2001: cpupower.config + ++Patch200: scst_exec_req_fifo.patch ++#Patch201: put_page_callback.patch ++ + # empty final patch to facilitate testing of kernel patches + Patch999999: linux-kernel-test.patch + +@@ -668,6 +672,9 @@ + # Drop some necessary files from the source dir into the buildroot + cp $RPM_SOURCE_DIR/kernel-%{version}-*.config . + ++ApplyPatch scst_exec_req_fifo.patch ++#ApplyPatch put_page_callback.patch ++ + ApplyOptionalPatch linux-kernel-test.patch + + # Any further pre-build tree manipulations happen here. +@@ -700,6 +707,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 %{?cross_opts} ARCH=$Arch listnewconfig | grep -E '^CONFIG_' >.newoptions || true + %if %{listnewconfig_fail} +EOF else log "Unrecognized kernel version ${kver}" fi @@ -327,7 +376,7 @@ log "Rebuilding kernel" cd ${rpmbuild_dir}/SPECS { - rpmbuild -bb --target=${arch} --with baseonly --with firmware --without kabichk kernel*.spec + rpmbuild -bb --target=${arch} --nodeps --with baseonly --with firmware --without kabichk kernel*.spec rc=$? if [ $rc != 0 ]; then exit $rc diff --git a/scst/kernel/rhel/scst_exec_req_fifo-3.10.0-121.el7.patch b/scst/kernel/rhel/scst_exec_req_fifo-3.10.0-121.el7.patch new file mode 120000 index 000000000..6a3acd053 --- /dev/null +++ b/scst/kernel/rhel/scst_exec_req_fifo-3.10.0-121.el7.patch @@ -0,0 +1 @@ +../scst_exec_req_fifo-3.10.patch \ No newline at end of file diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index afc92707a..ef3a7c111 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -9749,7 +9749,8 @@ void scst_vfs_unlink_and_put(struct nameidata *nd) #else void scst_vfs_unlink_and_put(struct path *path) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) vfs_unlink(path->dentry->d_parent->d_inode, path->dentry); #else vfs_unlink(path->dentry->d_parent->d_inode, path->dentry, NULL); diff --git a/srpt/src/ib_srpt.h b/srpt/src/ib_srpt.h index 135091311..6596c0634 100644 --- a/srpt/src/ib_srpt.h +++ b/srpt/src/ib_srpt.h @@ -51,7 +51,7 @@ #if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 5 #define vlan_dev_vlan_id(dev) (panic("RHEL 5 misses vlan_dev_vlan_id()"),0) #endif -#if defined(RHEL_MAJOR) +#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 <= 6 #define __ethtool_get_settings(dev, cmd) (panic("RHEL misses __ethtool_get_settings()"),0) #endif #include