mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-25 07:51:28 +00:00
Merged revisions 5667-5670,5672-5686,5698,5700-5722,5724-5737 via svnmerge from
svn+ssh://yanb123@svn.code.sf.net/p/scst/svn/trunk
........
r5667 | bvassche | 2014-07-08 18:11:58 +0300 (Tue, 08 Jul 2014) | 1 line
nightly build: Update kernel versions
........
r5668 | vlnb | 2014-07-10 04:00:29 +0300 (Thu, 10 Jul 2014) | 3 lines
Make SCST interface compatibility more robust
........
r5669 | bvassche | 2014-07-10 09:17:57 +0300 (Thu, 10 Jul 2014) | 1 line
scst/Makefile: Create /var/lib/scst/vdev_mode_pages while installing SCST
........
r5670 | bvassche | 2014-07-10 09:18:58 +0300 (Thu, 10 Jul 2014) | 1 line
scst.spec.in: Create /var/lib/scst/pr and /var/lib/scst/vdev_mode_pages when installing the SCST RPM
........
r5672 | bvassche | 2014-07-10 15:29:59 +0300 (Thu, 10 Jul 2014) | 2 lines
scripts/rebuild-rhel-kernel-rpm: Move code for downloading a RHEL (clone) RPM into a separate file
........
r5673 | bvassche | 2014-07-11 09:48:49 +0300 (Fri, 11 Jul 2014) | 1 line
scripts/generate-kernel-patch: Also generate scst-itf-ver.h
........
r5674 | bvassche | 2014-07-11 10:54:19 +0300 (Fri, 11 Jul 2014) | 1 line
scripts/generate-kernel-patch: Remove trailing whitespace
........
r5675 | vlnb | 2014-07-12 03:53:46 +0300 (Sat, 12 Jul 2014) | 3 lines
BLOCKIO microoptimization: use per-device biosets
........
r5676 | bvassche | 2014-07-13 10:15:05 +0300 (Sun, 13 Jul 2014) | 1 line
nightly build: Update kernel versions
........
r5677 | vlnb | 2014-07-16 06:27:20 +0300 (Wed, 16 Jul 2014) | 3 lines
Install scst_itf_ver.h as well
........
r5678 | bvassche | 2014-07-16 08:35:40 +0300 (Wed, 16 Jul 2014) | 1 line
scst-devel rpm: Include /usr/include/scst/scst_itf_ver.h
........
r5679 | bvassche | 2014-07-16 11:29:16 +0300 (Wed, 16 Jul 2014) | 6 lines
ib_srpt: Fix Mellanox OFED build
Use the proper include directory when building against Mellanox OFED.
Do not require to remove /lib/modules/$(KVER)/kernel/drivers/infiniband
before building ib_srpt.
........
r5680 | bvassche | 2014-07-18 12:27:41 +0300 (Fri, 18 Jul 2014) | 1 line
srpt/Makefile: Remove a superfluous assignment statement
........
r5681 | bvassche | 2014-07-18 12:28:22 +0300 (Fri, 18 Jul 2014) | 1 line
srpt/Makefile: SLES + Mellanox OFED build fix
........
r5682 | bvassche | 2014-07-18 12:30:25 +0300 (Fri, 18 Jul 2014) | 1 line
srpt/README: Fix SLES patch instructions
........
r5683 | vlnb | 2014-07-19 06:54:33 +0300 (Sat, 19 Jul 2014) | 11 lines
iscsi-scst: Handle data buffers with non-zero offset correctly
Start at the proper offset in the receive buffer if sg[0].offset != 0.
Return the proper data to the initiator if sg[0].offset != 0.
This patch reworks trunk r5281, "iscsi-scst: fix offset
calculation", February 13, 2014.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5684 | vlnb | 2014-07-19 07:08:30 +0300 (Sat, 19 Jul 2014) | 10 lines
scst: Clean up scst_process_active_cmd()
Since inside scst_process_active_cmd() cmd->state can only change after
cmd has been added back to the command list it is safe to perform the
cmd->state check without holding the command list lock. Hence move the
perform the cmd->state check without holding the command list lock.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5685 | vlnb | 2014-07-19 07:11:39 +0300 (Sat, 19 Jul 2014) | 7 lines
scst: Introduce scst_set_thr_cpu_mask()
This patch does not change any functionality.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5686 | vlnb | 2014-07-19 07:13:24 +0300 (Sat, 19 Jul 2014) | 8 lines
scst_vdisk: Micro-optimize the zero-copy check
Only evaluate the SCSI command type if virt_dev->zero_copy has been
set instead of always checking the SCSI command type.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5698 | bvassche | 2014-07-20 11:37:58 +0300 (Sun, 20 Jul 2014) | 1 line
nightly build: Update kernel versions
........
r5700 | vlnb | 2014-07-22 02:04:18 +0300 (Tue, 22 Jul 2014) | 3 lines
Web updates
........
r5701 | vlnb | 2014-07-22 03:22:06 +0300 (Tue, 22 Jul 2014) | 8 lines
scst: Make scst_cmd_threads.threads_list locking more fine-grained
Introduce a new synchronization object, namely scst_cmd_threads.thr_lock,
to protect scst_cmd_threads.threads_list.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5702 | vlnb | 2014-07-23 05:00:06 +0300 (Wed, 23 Jul 2014) | 7 lines
Prevent possible collisions between saved PR and mode pages backup files
From now on '.' is illegal character in SCST device names
Reported-by Ken Raeburn <raeburn@permabit.com>
........
r5703 | vlnb | 2014-07-23 05:49:50 +0300 (Wed, 23 Jul 2014) | 5 lines
Review of host_status handling (pass-through mode)
Inspired by Dave Butler <tears.the@gmail.com> and Bart Van Assche <bvanassche@acm.org>
........
r5704 | vlnb | 2014-07-26 03:04:51 +0300 (Sat, 26 Jul 2014) | 3 lines
Internal REQUEST SENSE: NO SENSE is also valid sense
........
r5705 | vlnb | 2014-07-29 02:11:14 +0300 (Tue, 29 Jul 2014) | 3 lines
Print initiator and target in the abort messages
........
r5706 | vlnb | 2014-07-30 05:27:10 +0300 (Wed, 30 Jul 2014) | 3 lines
Minor logging improvements
........
r5707 | vlnb | 2014-07-30 05:52:26 +0300 (Wed, 30 Jul 2014) | 3 lines
Follow up for r5704: NO SENSE is also valid sense
........
r5708 | vlnb | 2014-07-30 05:53:07 +0300 (Wed, 30 Jul 2014) | 3 lines
Minor fix
........
r5709 | bvassche | 2014-08-06 20:40:30 +0300 (Wed, 06 Aug 2014) | 1 line
nightly build: Update kernel versions
........
r5710 | bvassche | 2014-08-07 10:20:08 +0300 (Thu, 07 Aug 2014) | 1 line
RHEL 7: Add scst_exec_req_fifo and put_page_callback patches
........
r5711 | bvassche | 2014-08-07 11:12:22 +0300 (Thu, 07 Aug 2014) | 1 line
Rename the two RHEL 7 scst_exec_req_fifo patches
........
r5712 | bvassche | 2014-08-07 11:38:19 +0300 (Thu, 07 Aug 2014) | 1 line
scripts/rebuild-rhel-kernel-rpm: Add RHEL 7 support
........
r5713 | bvassche | 2014-08-08 13:37:17 +0300 (Fri, 08 Aug 2014) | 1 line
nightly build: Update kernel versions
........
r5714 | bvassche | 2014-08-09 14:02:19 +0300 (Sat, 09 Aug 2014) | 1 line
scripts/rebuild-rhel-kernel-rpm: Install more prerequisites
........
r5715 | bvassche | 2014-08-15 10:49:07 +0300 (Fri, 15 Aug 2014) | 1 line
nightly build: Update kernel versions
........
r5716 | vlnb | 2014-08-16 02:44:33 +0300 (Sat, 16 Aug 2014) | 3 lines
Fix blockio bioset for older kernels, which need explicit bio destructors
........
r5717 | vlnb | 2014-08-20 00:52:31 +0300 (Wed, 20 Aug 2014) | 3 lines
Update for kernels 3.16
........
r5718 | vlnb | 2014-08-20 05:24:08 +0300 (Wed, 20 Aug 2014) | 12 lines
Fix Coverity warning of q2t_ctio_to_cmd() dead code
Coverity warns that 'handle == Q2T_SKIP_HANDLE' can never occur, because
code preceding the test has masked out a handle bit that would be
required for the test to succeed.
Fix that by extending Q2T_SKIP_HANDLE to incorporate
CTIO_INTERMEDIATE_HANDLE_MARK as well.
Reported-by: Steven J. Magnani <steve@digidescorp.com>
........
r5719 | bvassche | 2014-08-20 09:55:04 +0300 (Wed, 20 Aug 2014) | 1 line
nightly build: Add kernel 3.16 nightly build infrastructure
........
r5720 | bvassche | 2014-08-20 09:57:04 +0300 (Wed, 20 Aug 2014) | 1 line
nightly build: Add kernel version 3.16.1
........
r5721 | vlnb | 2014-08-21 08:17:47 +0300 (Thu, 21 Aug 2014) | 5 lines
Fix incorrect address computation during receive PDUs preparations
Found and fix suggested by Кирилл Тюшев <kirill.tyushev8@gmail.com>
........
r5722 | vlnb | 2014-08-21 08:18:43 +0300 (Thu, 21 Aug 2014) | 3 lines
Integration of the QLogic git's qla2x00t into the SCST tree
........
r5724 | bvassche | 2014-08-22 10:19:55 +0300 (Fri, 22 Aug 2014) | 9 lines
Fix a kernel 3.16 checkpatch complaint about trailing semicolons
Avoid that the checkpatch tool included in Linux kernel v3.16 reports the
following warning:
macros should not use a trailing semicolon
This patch does not change any functionality.
........
r5725 | bvassche | 2014-08-25 14:36:33 +0300 (Mon, 25 Aug 2014) | 1 line
ib_srpt: Kernel v3.17 build fix
........
r5726 | bvassche | 2014-08-25 14:41:55 +0300 (Mon, 25 Aug 2014) | 1 line
ib_srpt: Log QPN next to session name
........
r5727 | bvassche | 2014-08-25 14:46:43 +0300 (Mon, 25 Aug 2014) | 6 lines
ib_srpt: Speed up kernel driver unloading after a cable pull
When unloading the ib_srpt kernel module, instead of waiting until
all connected queue pairs have left the TimeWait state, destroy
these queue pairs immediately.
........
r5728 | bvassche | 2014-08-25 15:50:19 +0300 (Mon, 25 Aug 2014) | 8 lines
ib_srpt: Make the completion vector configurable
Allow a set of completion vectors to be associated with each InfiniBand
HCA port and allocate the completion vector for each session in a
round-robin fashion from the per-port set. This helps to spread the
InfiniBand interrupt workload over multiple CPU's, at least if different
InfiniBand MSI-X vectors are associated with different CPU's.
........
r5729 | vlnb | 2014-08-26 06:21:07 +0300 (Tue, 26 Aug 2014) | 7 lines
scst_vdisk: Make vdisk_sup_vpd() easier to extend
This patch doesn't change any functionality.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5730 | vlnb | 2014-08-26 06:44:23 +0300 (Tue, 26 Aug 2014) | 12 lines
scst_vdisk: Make EUI-64 and NAA IDs configurable
Make the SCSI device identification page (83h) EUI-64 and NAA
IDs configurable. If neither the eui64_id nor the naa_id sysfs
attribute has been set, export the first eight bytes of the
t10_dev_id as an EUI-64 ID. If the NAA ID but not the EUI-64 ID
has been set, report the NAA ID only. If both IDs have been set,
report both.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5731 | bvassche | 2014-08-26 12:56:54 +0300 (Tue, 26 Aug 2014) | 1 line
scstadmin: Avoid that the Perl interpreter prints a warning message about using an undefined variable on Fedora systems
........
r5732 | vlnb | 2014-08-27 05:41:40 +0300 (Wed, 27 Aug 2014) | 9 lines
iscsi-scst: Build fix for IPV6=n
Ensure that iscsi-scst builds properly against a kernel with CONFIG_IPV6=n.
Reported by Igor Novgorodov <igor@novg.net> on June 7, 2014.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5733 | vlnb | 2014-08-27 05:42:35 +0300 (Wed, 27 Aug 2014) | 9 lines
scst_pres: Make a few error messages more clear
Make it possible to figure out what went wrong from inspecting the
system log only by mentioning the incorrect filename in the system
log.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5734 | vlnb | 2014-08-27 05:43:50 +0300 (Wed, 27 Aug 2014) | 8 lines
scst: Remove set_cpus_allowed() invocations
Since scst.h contains a backport of the definition of set_cpus_allowed_ptr(),
the set_cpus_allowed() invocations are superfluous. Hence remove these.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5735 | vlnb | 2014-08-27 05:55:28 +0300 (Wed, 27 Aug 2014) | 8 lines
iscsi-scst: Micro-optimize cmnd_prepare_recv_pdu()
Instead of adding sg[idx].offset to addr and immediately subtracting
sg[idx].offset again, leave out both arithmetic operations.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5736 | vlnb | 2014-08-27 06:00:44 +0300 (Wed, 27 Aug 2014) | 5 lines
scst/include/scst.h: Document on_abort_cmd() further
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
r5737 | bvassche | 2014-08-27 09:33:02 +0300 (Wed, 27 Aug 2014) | 1 line
scst_vdisk: Build fix for kernel 3.1.x
........
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5738 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -373,18 +373,32 @@ rm -rf "${tmpdir}"
|
||||
|
||||
for s in ${separate_patches}
|
||||
do
|
||||
fileset=$s
|
||||
for f in $(set | grep "^$s=" | sed -e "s/^$s='\(.*\)'\$/\1/" -e "s/^$s=\(.*\)\$/\1/")
|
||||
do
|
||||
if [ "${f#scst/include}" != "${f}" ]; then
|
||||
add_file "${f}" "include/scst/${f#scst/include/}"
|
||||
elif [ "${f#doc}" != "${f}" ]; then
|
||||
add_file "${f}" "Documentation/scst/${f#doc/}"
|
||||
else
|
||||
add_file "${f}" "drivers/scst/${f#scst/src/}"
|
||||
{
|
||||
fileset=$s
|
||||
for f in $(set | grep "^$s=" | sed -e "s/^$s='\(.*\)'\$/\1/" -e "s/^$s=\(.*\)\$/\1/")
|
||||
do
|
||||
if [ "${f#scst/include}" != "${f}" ]; then
|
||||
add_file "${f}" "include/scst/${f#scst/include/}"
|
||||
elif [ "${f#doc}" != "${f}" ]; then
|
||||
add_file "${f}" "Documentation/scst/${f#doc/}"
|
||||
else
|
||||
add_file "${f}" "drivers/scst/${f#scst/src/}"
|
||||
fi
|
||||
done
|
||||
if [ "$s" = "scst_03_public_headers" ]; then
|
||||
tmp_itf_ver="$(mktemp /tmp/scst-itf-ver.h.XXXXXXXXXX)"
|
||||
cat <<"EOF" >$tmp_itf_ver
|
||||
/* Autogenerated, don't edit */
|
||||
|
||||
#define SCST_INTF_VER "SCST_INTF_VER"
|
||||
#define SCST_CONST_INTF_VER "SCST_CONST_INTF_VER"
|
||||
#define DEV_USER_INTF_VER "DEV_USER_INTF_VER"
|
||||
EOF
|
||||
add_file "$tmp_itf_ver" "include/scst/scst_itf_ver.h"
|
||||
rm -f "$tmp_itf_ver"
|
||||
fi
|
||||
done \
|
||||
| process_patch "${s}.diff"
|
||||
} |
|
||||
process_patch "${s}.diff"
|
||||
done
|
||||
|
||||
{
|
||||
|
||||
@@ -36,63 +36,50 @@
|
||||
#
|
||||
############################################################################
|
||||
|
||||
scst_dir="$(dirname "$(dirname "$0")")"
|
||||
if [ ${scst_dir:0:1} != "/" ]; then
|
||||
scst_dir="$PWD/${scst_dir}"
|
||||
scriptdir="$(dirname "$0")"
|
||||
if [ "${scriptdir:0:1}" != "/" ]; then
|
||||
scriptdir="$PWD/${scriptdir}"
|
||||
fi
|
||||
source "${scriptdir}/rhel-rpm-functions"
|
||||
scst_dir="$(dirname "$scriptdir")"
|
||||
downloaddir=$HOME/software/downloads
|
||||
rpmbuild_dir=$HOME/rpmbuild
|
||||
if [ "$1" = "" ]; then
|
||||
if echo "$(uname -r)" | grep -q uek; then
|
||||
|
||||
if echo "$(uname -r)" | grep -q uek; then
|
||||
kernel="kernel-uek-$(uname -r)"
|
||||
else
|
||||
kernel="kernel-$(uname -r)"
|
||||
fi
|
||||
else
|
||||
kernel="$1"
|
||||
kernel="kernel-$(uname -r)"
|
||||
fi
|
||||
|
||||
releasever="$(sed -n -e 's/^.* release \([0-9.]*\).*$/\1/p' /etc/redhat-release)"
|
||||
distro="$(sed -n -e 's/^\(.*\) release .*$/\1/p' /etc/redhat-release)"
|
||||
|
||||
install_prerequisites=true
|
||||
|
||||
usage() {
|
||||
echo "$(basename "$0") [-d <distro>] [-h] [-i] [-k <kver>] [-r <rel>]"
|
||||
}
|
||||
|
||||
type /usr/bin/getopt >/dev/null || exit 1
|
||||
options="$(/usr/bin/getopt d:hik:r: "$@")" || { usage; exit 1; }
|
||||
set -- $options
|
||||
while [ "$1" != "${1#-}" ]; do
|
||||
case "$1" in
|
||||
'-d') distro="$2"; shift; shift;;
|
||||
'-i') install_prerequisites="false"; shift;;
|
||||
'-k') kernel="$2"; shift; shift;;
|
||||
'-r') releasever="$2"; shift; shift;;
|
||||
'--') shift; break;;
|
||||
*) usage; exit 1;;
|
||||
esac
|
||||
done
|
||||
|
||||
arch="$(uname -m)"
|
||||
kernel="${kernel%.${arch}}"
|
||||
kernel_src_rpm="${kernel}.src.rpm"
|
||||
kver="${kernel#kernel-}"
|
||||
distro="$(sed -n -e 's/^\(.*\) release .*$/\1/p' /etc/issue)"
|
||||
if [ -n "$2" ]; then
|
||||
releasever="$2"
|
||||
else
|
||||
releasever="$(sed -n -e 's/^.* release \([0-9.]*\).*$/\1/p' /etc/issue)"
|
||||
fi
|
||||
releasevermajor="$(echo $releasever | cut -f1 -d.)"
|
||||
releaseverminor="$(echo $releasever | cut -f2 -d.)"
|
||||
case "$distro" in
|
||||
"CentOS"*)
|
||||
case $releasever in
|
||||
5.*|6.[01])
|
||||
srpm_url=("http://vault.centos.org/${releasever}/os/SRPMS" "http://vault.centos.org/${releasever}/updates/SRPMS");;
|
||||
*)
|
||||
srpm_url=("http://vault.centos.org/${releasever}/os/Source/SPackages" "http://vault.centos.org/${releasever}/updates/Source/SPackages");;
|
||||
esac
|
||||
;;
|
||||
"Red Hat Enterprise Linux"*)
|
||||
srpm_url=("http://ftp.redhat.com/pub/redhat/linux/enterprise/${releasevermajor}Server/en/os/SRPMS")
|
||||
;;
|
||||
"Oracle Linux Server")
|
||||
srpm_url=("http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/${releaseverminor}/base/x86_64/getPackageSource" "http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/latest/x86_64/getPackageSource" "http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/UEK/latest/x86_64/getPackageSource")
|
||||
;;
|
||||
"Scientific Linux")
|
||||
if [ "$releasevermajor" = 6 ]; then
|
||||
srpm_url=("http://ftp.scientificlinux.org/linux/scientific/$releasever/SRPMS/vendor")
|
||||
else
|
||||
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
|
||||
;;
|
||||
esac
|
||||
|
||||
srpm_urls="$(get_srpm_urls "$distro" "$releasever" "$arch")" || exit $?
|
||||
|
||||
function log {
|
||||
echo
|
||||
@@ -100,6 +87,25 @@ function log {
|
||||
echo
|
||||
}
|
||||
|
||||
copy_best_matching_patch() {
|
||||
local f v
|
||||
|
||||
v="${kver}"
|
||||
while [ "${v%[0-9a-z]}" != "$v" ]; do
|
||||
f="${1}-${v}.patch"
|
||||
if [ -e "$f" ]; then
|
||||
copy_patch "$f" "$2"
|
||||
return 0
|
||||
fi
|
||||
while [ "${v%[0-9a-z]}" != "$v" ]; do
|
||||
v="${v%[0-9a-z]}"
|
||||
done
|
||||
v="${v%.}"
|
||||
v="${v%-}"
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
function copy_patch {
|
||||
local p="$1"
|
||||
while [ ! -e "$p" ]
|
||||
@@ -137,7 +143,33 @@ fi
|
||||
|
||||
log "Installing prerequisites"
|
||||
|
||||
sudo yum install -y -q asciidoc binutils-devel elfutils-libelf-devel hmaccalc ncurses-devel newt-devel patchutils 'perl(ExtUtils::Embed)' python-devel redhat-rpm-config rpmdevtools rng-tools rpm-build unifdef xmlto yum-utils zlib-devel
|
||||
if $install_prerequisites; then
|
||||
for p in \
|
||||
asciidoc \
|
||||
audit-libs-devel \
|
||||
binutils-devel \
|
||||
elfutils-devel \
|
||||
elfutils-libelf-devel \
|
||||
hmaccalc \
|
||||
ncurses-devel \
|
||||
newt-devel \
|
||||
patchutils \
|
||||
numactl-devel \
|
||||
pciutils-devel \
|
||||
'perl(ExtUtils::Embed)' \
|
||||
pesign \
|
||||
python-devel \
|
||||
redhat-rpm-config \
|
||||
rng-tools \
|
||||
rpm-build \
|
||||
rpmdevtools \
|
||||
unifdef \
|
||||
wget \
|
||||
xmlto \
|
||||
yum-utils \
|
||||
zlib-devel \
|
||||
; do sudo yum install -y -q "$p"; done
|
||||
fi
|
||||
|
||||
rc=$?; if [ $rc != 0 ]; then exit $rc; fi
|
||||
|
||||
@@ -150,7 +182,7 @@ log "Installing, unpacking and preparing kernel source files"
|
||||
mkdir -p ${downloaddir}
|
||||
if [ ! -e ${downloaddir}/${kernel_src_rpm} ]; then
|
||||
cd ${downloaddir}
|
||||
for dir in ${srpm_url[@]}
|
||||
for dir in ${srpm_urls}
|
||||
do
|
||||
url="$dir/${kernel_src_rpm}"
|
||||
echo "Trying $url ..."
|
||||
@@ -166,7 +198,9 @@ fi
|
||||
|
||||
log "Installing kernel build prerequisites"
|
||||
|
||||
sudo yum-builddep -q -y ${downloaddir}/${kernel_src_rpm}
|
||||
if $install_prerequisites; then
|
||||
sudo yum-builddep -q -y ${downloaddir}/${kernel_src_rpm}
|
||||
fi
|
||||
|
||||
log "Installing kernel sources in ${rpmbuild_dir}"
|
||||
|
||||
@@ -185,11 +219,16 @@ cd SPECS
|
||||
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
|
||||
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
|
||||
copy_best_matching_patch $scst_dir/scst/kernel/rhel/scst_exec_req_fifo scst_exec_req_fifo.patch ||
|
||||
{
|
||||
echo "No matching scst_exec_req_fifo patch found for kernel version $kver";
|
||||
exit 1;
|
||||
}
|
||||
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";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
log "Adding SCST patches in kernel.spec"
|
||||
|
||||
@@ -325,7 +364,7 @@ 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
|
||||
elif [ ${kver#3.10.0-12[13]} != $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
|
||||
|
||||
98
scripts/rhel-rpm-functions
Normal file
98
scripts/rhel-rpm-functions
Normal file
@@ -0,0 +1,98 @@
|
||||
# -*- mode: shell-script -*-
|
||||
# Shell functions for downloading and extracting a RHEL or RHEL clone RPM
|
||||
|
||||
# Arguments:
|
||||
# $1: Linux distribution name
|
||||
# $2: Linux distribution version (major.minor)
|
||||
# $3: architecture
|
||||
function get_srpm_urls() {
|
||||
local arch distro releasever releasevermajor releaseverminor
|
||||
|
||||
distro="$1"
|
||||
releasever="$2"
|
||||
arch="$3"
|
||||
IFS=.
|
||||
set -- "$2"
|
||||
unset IFS
|
||||
releasevermajor="$1"
|
||||
releaseverminor="$2"
|
||||
|
||||
case "$distro" in
|
||||
"CentOS"*)
|
||||
case $releasever in
|
||||
5.*|6.[01])
|
||||
echo "http://vault.centos.org/${releasever}/os/SRPMS http://vault.centos.org/${releasever}/updates/SRPMS";;
|
||||
[67].*)
|
||||
echo "http://vault.centos.org/${releasever}/os/Source/SPackages http://vault.centos.org/${releasever}/updates/Source/SPackages";;
|
||||
esac
|
||||
;;
|
||||
"Red Hat Enterprise Linux"*)
|
||||
case $releasever in
|
||||
[56].*)
|
||||
echo "http://ftp.redhat.com/pub/redhat/linux/enterprise/${releasevermajor}Server/en/os/SRPMS http://ftp.redhat.com/redhat/rhel/rc/7/Server/source/tree/Packages";;
|
||||
esac
|
||||
;;
|
||||
"Oracle Linux Server")
|
||||
echo "http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/${releaseverminor}/base/${arch}/getPackageSource http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/latest/${arch}/getPackageSource http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/UEK/latest/${arch}/getPackageSource"
|
||||
;;
|
||||
"Scientific Linux")
|
||||
case $releasever in
|
||||
5.*)
|
||||
echo "http://ftp.scientificlinux.org/linux/scientific/$releasevermajor$releaseverminor/SRPMS/vendor";;
|
||||
6.*)
|
||||
echo "http://ftp.scientificlinux.org/linux/scientific/$releasever/SRPMS/vendor";;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "Unknown type of distribution: $distro" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Arguments:
|
||||
# $1: Linux distribution name
|
||||
# $2: Linux distribution version (major.minor)
|
||||
# $3: architecture
|
||||
function get_rpm_urls() {
|
||||
local arch distro releasever releasevermajor releaseverminor
|
||||
|
||||
distro="$1"
|
||||
releasever="$2"
|
||||
arch="$3"
|
||||
IFS=.
|
||||
set -- "$2"
|
||||
unset IFS
|
||||
releasevermajor="$1"
|
||||
releaseverminor="$2"
|
||||
|
||||
case "$distro" in
|
||||
"CentOS"*)
|
||||
case $releasever in
|
||||
5.*)
|
||||
echo "http://vault.centos.org/${releasever}/os/${arch}/CentOS http://vault.centos.org/${releasever}/updates/${arch}/RPMS";;
|
||||
6.[01])
|
||||
echo "http://vault.centos.org/${releasever}/os/${arch}/Packages http://vault.centos.org/${releasever}/updates/${arch}/Packages";;
|
||||
[67].*)
|
||||
echo "http://vault.centos.org/${releasever}/os/${arch}/Packages http://vault.centos.org/${releasever}/updates/${arch}/Packages";;
|
||||
esac
|
||||
;;
|
||||
"Red Hat Enterprise Linux"*)
|
||||
echo "";;
|
||||
"Oracle Linux Server")
|
||||
echo "http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/${releaseverminor}/base/${arch}/getPackageSource http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/latest/${arch}/getPackageSource http://public-yum.oracle.com/repo/OracleLinux/OL${releasevermajor}/UEK/latest/${arch}/getPackageSource"
|
||||
;;
|
||||
"Scientific Linux")
|
||||
case $releasever in
|
||||
5.*)
|
||||
echo "http://ftp.scientificlinux.org/linux/scientific/$releasevermajor$releaseverminor/SRPMS/vendor";;
|
||||
6.*)
|
||||
echo "http://ftp.scientificlinux.org/linux/scientific/$releasever/SRPMS/vendor";;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "Unknown distribution type: $distro" >&2
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
Reference in New Issue
Block a user