mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
Patch from Bart Van Assche <bart.vanassche@gmail.com>:
By this time I have reworked the update of scripts/generate-kernel-patch'>scripts/generate-kernel-patch. These are the changes that were already present in version 1 of this patch and that have been kept in this patch: - The SCST code has been moved from drivers/scsi/scsi_tgt to drivers/scst. - Moved SCST header files from include/scsi_tgt to include/scst. - Added iscsi-scst in drivers/scst/iscsi-scst. For the time being the generate-kernel-patch does no longer try to add the qla2x00t driver in drivers/scst/qla2x00-target -- I have not yet been able to figure out how to get qla2x00t/qla2x00-target compiled without the initiator code. Just as in version 1 of this patch, the following files in the Subversion repository have been renamed to reflect the above changes: - Renamed scst/kernel/in-tree/Makefile.scsi.Linux-2.6.24.patch'>scst/kernel/in-tree/Makefile.scsi.Linux-2.6.24.patch to scst/kernel/in-tree/Makefile.drivers.Linux-2.6.24.patch'>scst/kernel/in-tree/Makefile.drivers.Linux-2.6.24.patch. - Renamed Kconfig'>scst/kernel/in-tree/Kconfig.scsi.Linux-2.6.24.patch to scst/kernel/in-tree/Kconfig.drivers.Linux-2.6.24.patch'>scst/kernel/in-tree/Kconfig.drivers.Linux-2.6.24.patch. - Renamed scst/kernel/in-tree/Makefile.scsi_tgt'>scst/kernel/in-tree/Makefile.scsi_tgt to scst/kernel/in-tree/Makefile.scst'>scst/kernel/in-tree/Makefile.scst. - Renamed scst/kernel/in-tree/Kconfig.scsi_tgt'>scst/kernel/in-tree/Kconfig.scsi_tgt to scst/kernel/in-tree/Kconfig.scst'>scst/kernel/in-tree/Kconfig.scst. Because of the above changes the include path specified in the following Makefiles had to be changed: - scst/kernel/in-tree/Makefile.dev_handlers'>scst/kernel/in-tree/Makefile.dev_handlers - srpt/src/Makefile.in_kernel'>srpt/src/Makefile.in_kernel Other changes: - I have added menu/endmenu entries in file scst/kernel/in-tree/Kconfig.scst such that the SCST entries become visible when running make xconfig or make menuconfig. - Elaborated the SCST help texts a little bit (in file scst/kernel/in-tree/Kconfig.scst). New in version 2 of this patch: - Moved remaining patches in the generate-kernel-patch script to separate files. - Added support for the 2.6.25 kernel. This patch has been tested as follows: mkdir -p tmp cd tmp rm -rf linux-2.6.25.3 /lib/modules/2.6.25.3-scst tar xjf ~vanasscb/software/downloads/linux-2.6.25.3.tar.bz2 cd linux-2.6.25.3 cp ../.config-2.6.25 . (cd ~vanasscb/software/scst && ~vanasscb/software/scst/scripts/generate-kernel-patch \ 2.6.25) | patch -p1 make oldconfig diff ../.config . make xconfig make menuconfig make -j5 bzImage modules make modules_install install cp -r /lib/firmware/$(uname -r) /lib/firmware/2.6.25.3-scst update-initramfs -k 2.6.25.3-scst -c reboot modprobe iscsi-scst modprobe ib_srpt lsmod | grep -E 'scst|ib_srpt' dmesg Signed-off-by: bart.vanassche@gmail.com git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@373 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -28,31 +28,42 @@
|
||||
# $2: path in kernel tree of file to be patched.
|
||||
function add_patch {
|
||||
if [ ! -e "$1" ]; then
|
||||
echo "Error: could not find $1."
|
||||
echo "Error: could not find $1." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sed -e "s:^--- [^ ]*:--- orig/$2:" -e "s:^+++ [^ ]*:+++ $2:" < "$1"
|
||||
}
|
||||
|
||||
# Generate a patch for a file to be added to the kernel source tree.
|
||||
# Generate a patch for a file to be added to the kernel source tree, and strip
|
||||
# trailing whitespace from C source files while converting the file to patch
|
||||
# format.
|
||||
# $1: path of file to be added.
|
||||
# $2: path in kernel tree where file should be added.
|
||||
function add_file {
|
||||
local a b
|
||||
|
||||
if [ ! -e "$1" ]; then
|
||||
echo "Error: could not find $1."
|
||||
echo "Error: could not find $1." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Skip any files generated by the kernel build process (*.mod.c).
|
||||
if [ "${1%.mod.c}" != "$1" ]; then
|
||||
return 0;
|
||||
fi
|
||||
|
||||
cat <<EOF
|
||||
diff -uprN orig/$2 $2
|
||||
--- orig/$2
|
||||
+++ $2
|
||||
@@ -0,0 +1,$(wc -l "$1" | { read a b; echo $a; }) @@
|
||||
EOF
|
||||
sed "s/^/+/" <"$1"
|
||||
if [ "${2%.[ch]}" != "$2" ]; then
|
||||
sed -e 's/^/+/' -e 's/[ ]*$//g' < "$1"
|
||||
else
|
||||
sed -e 's/^/+/' < "$1"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +81,7 @@ if [ $# != 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
####################
|
||||
# Patch Generation #
|
||||
####################
|
||||
@@ -86,11 +98,11 @@ do
|
||||
echo "Error: kernel version ${kernel_version} is not supported by SCST."
|
||||
echo "(could not find file $p)."
|
||||
exit 1
|
||||
fi
|
||||
fi >&2
|
||||
done
|
||||
|
||||
|
||||
# Kernel patches for other directories than drivers/scsi/scsi_tgt/.
|
||||
# General kernel patches.
|
||||
|
||||
for p in "${kpatch[@]}"
|
||||
do
|
||||
@@ -99,53 +111,102 @@ do
|
||||
echo ''
|
||||
done
|
||||
|
||||
add_patch "scst/kernel/in-tree/Kconfig.scsi.Linux-${kernel_version}.patch" \
|
||||
"linux-${kernel_version}/drivers/scsi/Kconfig"
|
||||
|
||||
add_patch "scst/kernel/in-tree/Makefile.scsi.Linux-${kernel_version}.patch" \
|
||||
"linux-${kernel_version}/drivers/scsi/Makefile"
|
||||
|
||||
|
||||
# Directory include/scsi_tgt/
|
||||
# Directory include/scst/
|
||||
|
||||
for f in scst/include/*h
|
||||
do
|
||||
add_file "${f}" "linux-${kernel_version}/include/scsi_tgt/${f#scst/include/}"
|
||||
add_file "${f}" "linux-${kernel_version}/include/scst/${f#scst/include/}"
|
||||
done
|
||||
|
||||
|
||||
# Directory drivers/scsi/scsi_tgt/
|
||||
|
||||
add_file "scst/kernel/in-tree/Kconfig.scsi_tgt" \
|
||||
"drivers/scsi/scsi_tgt/Kconfig"
|
||||
add_file "scst/kernel/in-tree/Makefile.scsi_tgt" \
|
||||
"drivers/scsi/scsi_tgt/Makefile"
|
||||
|
||||
|
||||
for f in scst/src/*[ch]
|
||||
for f in iscsi-scst/include/*h
|
||||
do
|
||||
add_file ${f} linux-${kernel_version}/drivers/scsi/scsi_tgt/${f#scst/src/}
|
||||
add_file "${f}" "linux-${kernel_version}/include/scst/${f#iscsi-scst/include/}"
|
||||
done
|
||||
|
||||
|
||||
# Directory drivers/
|
||||
|
||||
add_patch "scst/kernel/in-tree/Kconfig.drivers.Linux-${kernel_version}.patch" \
|
||||
"linux-${kernel_version}/drivers/Kconfig"
|
||||
|
||||
add_patch "scst/kernel/in-tree/Makefile.drivers.Linux-${kernel_version}.patch"\
|
||||
"linux-${kernel_version}/drivers/Makefile"
|
||||
|
||||
|
||||
# Directory drivers/scst/
|
||||
|
||||
add_file "scst/kernel/in-tree/Kconfig.scst" \
|
||||
"linux-${kernel_version}/drivers/scst/Kconfig"
|
||||
add_file "scst/kernel/in-tree/Makefile.scst" \
|
||||
"linux-${kernel_version}/drivers/scst/Makefile"
|
||||
|
||||
|
||||
for f in scst/src/*.[ch]
|
||||
do
|
||||
add_file ${f} linux-${kernel_version}/drivers/scst/${f#scst/src/}
|
||||
echo ''
|
||||
echo ''
|
||||
done
|
||||
|
||||
|
||||
# Directory drivers/scsi/scsi_tgt/dev_handlers/
|
||||
# Directory drivers/scst/dev_handlers/
|
||||
|
||||
add_file "scst/kernel/in-tree/Makefile.dev_handlers" \
|
||||
"linux-${kernel_version}/drivers/scsi/scsi_tgt/dev_handlers/Makefile"
|
||||
"linux-${kernel_version}/drivers/scst/dev_handlers/Makefile"
|
||||
|
||||
for f in scst/src/dev_handlers/*.[ch]
|
||||
do
|
||||
add_file ${f} linux-${kernel_version}/drivers/scsi/scsi_tgt/dev_handlers/${f#scst/src/dev_handlers/}
|
||||
add_file ${f} linux-${kernel_version}/drivers/scst/dev_handlers/${f#scst/src/dev_handlers/}
|
||||
echo ''
|
||||
echo ''
|
||||
done
|
||||
|
||||
|
||||
# Directory drivers/scst/iscsi-scst/
|
||||
|
||||
add_file "iscsi-scst/kernel/Makefile.in-kernel" \
|
||||
"linux-${kernel_version}/drivers/scst/iscsi-scst/Makefile"
|
||||
|
||||
add_file "iscsi-scst/kernel/Kconfig" \
|
||||
"linux-${kernel_version}/drivers/scst/iscsi-scst/Kconfig"
|
||||
|
||||
for f in iscsi-scst/kernel/*.[ch]
|
||||
do
|
||||
add_file "${f}" \
|
||||
"linux-${kernel_version}/drivers/scst/iscsi-scst/${f#iscsi-scst/kernel/}"
|
||||
echo ''
|
||||
echo ''
|
||||
done
|
||||
|
||||
|
||||
# Directory drivers/scst/qla2x00-target/
|
||||
|
||||
if false; then
|
||||
|
||||
add_file "qla2x00t/qla2x00-target/Makefile.in-kernel" \
|
||||
"linux-${kernel_version}/drivers/scst/qla2x00-target/Makefile"
|
||||
|
||||
add_file "qla2x00t/qla2x00-target/Kconfig" \
|
||||
"linux-${kernel_version}/drivers/scst/qla2x00-target/Kconfig"
|
||||
|
||||
add_file "qla2x00t/qla2x_tgt_def.h" \
|
||||
"linux-${kernel_version}/drivers/scst/qla2x00-target/qla2x_tgt_def.h"
|
||||
|
||||
for f in qla2x00t/qla2x00-target/*.[ch]
|
||||
do
|
||||
add_file "${f}" \
|
||||
"linux-${kernel_version}/drivers/scst/qla2x00-target/${f#qla2x00t/qla2x00-target/}"
|
||||
echo ''
|
||||
echo ''
|
||||
done
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# Directory drivers/infiniband/ulp/srpt/
|
||||
|
||||
add_patch "srpt/src/Kconfig.infiniband.Linux-${kernel_version}.patch" \
|
||||
add_patch "srpt/src/Kconfig.infiniband.Linux-${kernel_version}.patch" \
|
||||
"linux-${kernel_version}/drivers/infiniband/Kconfig"
|
||||
|
||||
add_patch "srpt/src/Makefile.infiniband.Linux-${kernel_version}.patch" \
|
||||
@@ -155,7 +216,7 @@ add_file "srpt/src/Kconfig" "drivers/infiniband/ulp/srpt/Kconfig"
|
||||
|
||||
add_file "srpt/src/Makefile.in_kernel" "drivers/infiniband/ulp/srpt/Makefile"
|
||||
|
||||
for f in srpt/src/*[ch]
|
||||
for f in srpt/src/*.[ch]
|
||||
do
|
||||
add_file ${f} linux-${kernel_version}/drivers/infiniband/ulp/srpt/${f#srpt/src/}
|
||||
echo ''
|
||||
|
||||
Reference in New Issue
Block a user