SCST Source Build Oracle UEK

Follow this guide here. On my system it looked like this as shown below.

First download the SCST 3.1.x branch as shown below. Note that we need the 3.1.x version which can be used with non-custom kernels for kernels > 2.6.30 which means that we don't need a custom kernel build anymore since this UEK kernel is a 3.x linux kernel.

[root@oracle67 scst]# wget https://sourceforge.net/projects/scst/files/scst/scst-3.1.0.tar.bz2/download

Then bunzip2 and untar it then cd to scst-3.1.0/scst directory.

[root@oracle67 scst]# make 2release

cd src && make 2release

make[1]: Entering directory `/root/scst-3.1.0/scst/src'

sed -i.aa s/"^E\?XTRA_CFLAGS += \-DCONFIG_SCST_EXTRACHECKS"/"#EXTRA_CFLAGS += \-DCONFIG_SCST_EXTRACHECKS"/ Makefile

grep "^#EXTRA_CFLAGS += \-DCONFIG_SCST_EXTRACHECKS" Makefile >/dev/null

sed -i.aa s/"^#\?EXTRA_CFLAGS += \-DCONFIG_SCST_TRACING"/"EXTRA_CFLAGS += \-DCONFIG_SCST_TRACING"/ Makefile

grep "^EXTRA_CFLAGS += \-DCONFIG_SCST_TRACING" Makefile >/dev/null

sed -i.aa s/"^E\?XTRA_CFLAGS += \-DCONFIG_SCST_DEBUG -g -fno-inline -fno-inline-functions"/"#EXTRA_CFLAGS += \-DCONFIG_SCST_DEBUG -g -fno-inline -fno-inline-functions"/ Makefile

grep "^#EXTRA_CFLAGS += \-DCONFIG_SCST_DEBUG -g -fno-inline -fno-inline-functions" Makefile >/dev/null

rm Makefile.aa

cd dev_handlers && make 2release

make[2]: Entering directory `/root/scst-3.1.0/scst/src/dev_handlers'

sed -i.aa s/"^E\?XTRA_CFLAGS += \-DCONFIG_SCST_EXTRACHECKS"/"#EXTRA_CFLAGS += \-DCONFIG_SCST_EXTRACHECKS"/ Makefile

grep "^#EXTRA_CFLAGS += \-DCONFIG_SCST_EXTRACHECKS" Makefile >/dev/null

sed -i.aa s/"^#\?EXTRA_CFLAGS += \-DCONFIG_SCST_TRACING"/"EXTRA_CFLAGS += \-DCONFIG_SCST_TRACING"/ Makefile

grep "^EXTRA_CFLAGS += \-DCONFIG_SCST_TRACING" Makefile >/dev/null

sed -i.aa s/"^E\?XTRA_CFLAGS += \-DCONFIG_SCST_DEBUG -g -fno-inline -fno-inline-functions"/"#EXTRA_CFLAGS += \-DCONFIG_SCST_DEBUG -g -fno-inline -fno-inline-functions"/ Makefile

grep "^#EXTRA_CFLAGS += \-DCONFIG_SCST_DEBUG -g -fno-inline -fno-inline-functions" Makefile >/dev/null

rm Makefile.aa

make[2]: Leaving directory `/root/scst-3.1.0/scst/src/dev_handlers'

make[1]: Leaving directory `/root/scst-3.1.0/scst/src'

[root@oracle67 scst]#

[root@oracle67 scst]# BUILD_2X_MODULE=y make all install

cd src && make all

make[1]: Entering directory `/root/scst-3.1.0/scst/src'

make -C /lib/modules/3.8.13-68.3.4.el6uek.x86_64/build SUBDIRS=/root/scst-3.1.0/scst/src BUILD_DEV=m

make[2]: Entering directory `/usr/src/kernels/3.8.13-68.3.4.el6uek.x86_64'

Building modules, stage 2.

MODPOST 10 modules

make[2]: Leaving directory `/usr/src/kernels/3.8.13-68.3.4.el6uek.x86_64'

make[1]: Leaving directory `/root/scst-3.1.0/scst/src'

cd src && make install

make[1]: Entering directory `/root/scst-3.1.0/scst/src'

make -C /lib/modules/3.8.13-68.3.4.el6uek.x86_64/build SUBDIRS=/root/scst-3.1.0/scst/src BUILD_DEV=m

make[2]: Entering directory `/usr/src/kernels/3.8.13-68.3.4.el6uek.x86_64'

Building modules, stage 2.

MODPOST 10 modules

make[2]: Leaving directory `/usr/src/kernels/3.8.13-68.3.4.el6uek.x86_64'

rm -f /lib/modules/3.8.13-68.3.4.el6uek.x86_64/extra/scsi_tgt.ko

install -d /lib/modules/3.8.13-68.3.4.el6uek.x86_64/extra

install -d /lib/modules/3.8.13-68.3.4.el6uek.x86_64/extra/dev_handlers

install -m 644 dev_handlers/*.ko /lib/modules/3.8.13-68.3.4.el6uek.x86_64/extra/dev_handlers

install -m 644 scst.ko /lib/modules/3.8.13-68.3.4.el6uek.x86_64/extra

install -d /usr/local/include/scst

header_files="backport.h scst.h scst_const.h scst_debug.h \

scst_itf_ver.h scst_sgv.h scst_user.h"; \

for h in ${header_files}; do \

install -m 644 ../include/$h /usr/local/include/scst; \

done

rm -f /usr/local/include/scst/Module.symvers

install -m 644 Module.symvers /usr/local/include/scst

/sbin/depmod -b / -a 3.8.13-68.3.4.el6uek.x86_64

mkdir -p /var/lib/scst/pr

mkdir -p /var/lib/scst/dif_tags

mkdir -p /var/lib/scst/vdev_mode_pages

****************************************************************

*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*

*!! !!*

*!! Now don't forget to rebuild and reinstall all your !!*

*!! target drivers, custom dev handlers and necessary user !!*

*!! space applications. Otherwise, because of the versions !!*

*!! mismatch, you could have many problems and crashes. !!*

*!! See IMPORTANT note in the "Installation" section of !!*

*!! SCST's README file for more info. !!*

*!! !!*

*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*

****************************************************************

make[1]: Leaving directory `/root/scst-3.1.0/scst/src'

[root@oracle67 scst]# ls -l /lib/modules/`uname -r`/extra/scst*.ko

-rw-r--r--. 1 root root 6772424 Aug 3 20:37 /lib/modules/3.8.13-68.3.4.el6uek.x86_64/extra/scst.ko

[root@oracle67 scst]# for j in scst scst_vdisk scst_user ; do modprobe $j ; done

[root@oracle67 scst]#

[root@oracle67 scst]# lsmod | grep scst

scst_user 37776 0

scst_vdisk 99203 0

scst 1788033 2 scst_user,scst_vdisk

dlm 170381 1 scst

libcrc32c 1252 2 scst_vdisk,sctp

crc_t10dif 1547 2 scst,sd_mod

[root@oracle67 scst]#

Make sure you have iscsi-initiator-utils if you are going to have SCST target and client on the same host.

[root@oracle67 scst]# yum install -y iscsi-initiator-utils

Loaded plugins: refresh-packagekit, security

Setting up Install Process

Package iscsi-initiator-utils-6.2.0.873-21.0.1.el6.x86_64 already installed and latest version

Nothing to do

[root@oracle67 scst]#