vmware esx server – compile linux kernel / scsi controller/driver problem

直接在 vmware esx server 上重裝一台 gentoo linux 的 steps

在這個地方要勾 BusLogic , 在 make menuconfig 要選 BusLogic (簡直是廢話…)

9501eebd2a93f31b580498868083c8ba

開機後 dmesg | grep scsi 的結果是

scsi: ***** BusLogic SCSI Driver Version 2.1.16 of 18 July 2002 *****
scsi: Copyright 1995-1998 by Leonard N. Zubkoff <[email protected]>
scsi0: Configuring BusLogic Model BT-958 PCI Wide Ultra SCSI Host Adapter
scsi0:   Firmware Version: 5.07B, I/O Address: 0x1060, IRQ Channel: 17/Level
scsi0:   PCI Bus: 0, Device: 16, Address: 0xF4800000, Host Adapter SCSI ID: 7
scsi0:   Parity Checking: Enabled, Extended Translation: Enabled
scsi0:   Synchronous Negotiation: Ultra, Wide Negotiation: Enabled
scsi0:   Disconnect/Reconnect: Enabled, Tagged Queuing: Enabled
scsi0:   Scatter/Gather Limit: 128 of 128 segments, Mailboxes: 211
scsi0:   Driver Queue Depth: 211, Host Adapter Queue Depth: 192
scsi0:   Tagged Queue Depth: Automatic, Untagged Queue Depth: 3
scsi0: *** BusLogic BT-958 Initialized Successfully ***
scsi0 : BusLogic BT-958
scsi 0:0:0:0: Direct-Access     VMware   Virtual disk     1.0  PQ: 0 ANSI: 2
sd 0:0:0:0: Attached scsi generic sg0 type 0

sysctl / Linux tunning /etc/sysctl.conf

net.ipv4.ip_local_port_range = 1024 65536
net.core.rmem_max=16777216
net.core.wmem_max=16777216
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_wmem=4096 65536 16777216
net.ipv4.tcp_fin_timeout = 3
net.ipv4.tcp_tw_recycle = 1
net.core.netdev_max_backlog = 30000
net.ipv4.tcp_no_metrics_save=1
net.core.somaxconn = 262144
net.ipv4.tcp_syncookies = 0
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 2



解決 error while loading shared libraries 的方法

執行程式時, 若遇到

./update_item: error while loading shared libraries: libsqlrclientwrapper-0.40.so.1: cannot open shared object file: No such file or directory

像這樣的錯誤訊息 , 表示程式中所需的 so 檔(share library) 沒找到 , 要修改 /etc/ld.so.conf 加上這個目錄 , 改完要下 ldconfig –v 讓路徑生效

可以用 ldd 看該程式所使用到的 shared library 有那些, 及 lib 路徑

—–

以下是 gentoo 的標準解法 , 其他版本的 linux 則不太相同!!

cat /etc/ld.so.conf   這個檔是由 env-update 產生的 , 所以再繼續看一下 /etc/env.d 下 , 究竟有啥

# ld.so.conf autogenerated by env-update; make all changes to
# contents of /etc/env.d directory
/usr/local/lib
/usr/i686-pc-linux-gnu/lib
/usr/lib/gcc/i686-pc-linux-gnu/4.1.2
/usr/lib/gcc/i686-pc-linux-gnu/4.1.1
/usr/local/firstworks/lib

參考資料, 這是 compile sqlrelay 列出來的 information

See any operating system documentation about shared libraries for

more information, such as the ld(1) and ld.so(8) manual pages.

———————————————————————-

/bin/sh ../../libtool –mode=finish /usr/local/firstworks/lib

PATH=”$PATH:/sbin” ldconfig -n /usr/local/firstworks/lib

———————————————————————-

Libraries have been installed in:

/usr/local/firstworks/lib

If you ever happen to want to link against installed libraries

in a given directory, LIBDIR, you must either use libtool, and

specify the full pathname of the library, or use the `-LLIBDIR’

flag during linking and do at least one of the following:

– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable

during execution

– add LIBDIR to the `LD_RUN_PATH’ environment variable

during linking

– use the `-Wl,–rpath -Wl,LIBDIR’ linker flag

– have your system administrator add LIBDIR to `/etc/ld.so.conf’

在 /etc/env.d 下建立一個 90sqlrelay

內容是

LDPATH="/usr/local/firstworks/lib"

再run : env-update , 就看到 /etc/ld.so.conf 多了正確的 lib path 了

 

// ———————–
[12/6/13 下午4:37:54] RUTEN AA: 到 /usr/lib 找出原生的 .so 檔,應該會是 libsqlrclientwrapper-0.40.so.xxx.xxx
[12/6/13 下午4:38:13] RUTEN AA: ln -s libsqlrclientwrapper-0.40.so.xxx.xxx 到 loss 的 libsqlrclientwrapper-0.40.so.1.0.0
[12/6/13 下午4:38:17] RUTEN AA: 再 ldconfig
[12/6/13 下午4:40:53] RUTEN AA: 可以用 ldconfig -p 看是不是已經把 libsqlrclientwrapper-0.40.so.1 給 load 進來了

 

install oracle instant client basic on gentoo linux step by step

emerge -av dev-db/oracle-instantclient-basic dev-db/oracle-instantclient-sqlplus

!!! dev-db/oracle-instantclient-basic-11.1.0.7.0 has fetch restriction turned on.
!!! This probably means that this ebuild's files must be downloaded
!!! manually.  See the comments in the ebuild for more information.

 * Please go to:
 *   http://www.oracle.com/technology/tech/oci/instantclient/index.html
 * select your platform and download the
 * Basic client package with SDK, which are:
 *   instantclient-basic-linux32-11.1.0.7.zip
 *   instantclient-sdk-linux32-11.1.0.7.zip
 * Then after downloading put them in:
 *   /usr/portage/distfiles



http://www.oracle.com/technology/tech/oci/instantclient/index.html

factory ~ # cd /usr/portage/distfiles
factory distfiles # ls -l *zip
-rw-rw-r-- 1 apache portage 34556803 Aug  6 17:17 instantclient-basic-linux32-10.2.0.3-20061115.zip
-rw-rw-r-- 1 apache portage   602897 Aug  6 17:17 instantclient-sdk-linux32-10.2.0.3-20061115.zip

emerge -av dev-db/oracle-instantclient-basic
#

USE="apache2 berkdb bzip2 calendar cjk cli crypt ctype curl gd gdbm hash iconv json mysql mysqli nls oci8-instant-client pcre reflection session simplexml sockets spl ssl tokenizer truetype unicode xml xmlreader xmlwriter zlib" emerge -av php