aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2010-12-22 10:18:05 +0000
committerCarlo Landmeter <clandmeter@gmail.com>2010-12-22 10:18:05 +0000
commit559de61b4b92c534a13b71f0dd50631e4f8f47c7 (patch)
tree4366ac01bc5ab65b6210ddfac61bbe62413c99fb
parente529b59aaf07b81fd60ba5ad649f6fdd5a03ffe7 (diff)
downloadalpine_aports-559de61b4b92c534a13b71f0dd50631e4f8f47c7.tar.bz2
alpine_aports-559de61b4b92c534a13b71f0dd50631e4f8f47c7.tar.xz
alpine_aports-559de61b4b92c534a13b71f0dd50631e4f8f47c7.zip
testing/iscsi-scst: fixed init script and added default config
-rw-r--r--testing/iscsi-scst/APKBUILD14
-rw-r--r--testing/iscsi-scst/iscsi-scst.confd1
-rw-r--r--testing/iscsi-scst/iscsi-scst.initd65
-rw-r--r--testing/iscsi-scst/scst.conf7
4 files changed, 73 insertions, 14 deletions
diff --git a/testing/iscsi-scst/APKBUILD b/testing/iscsi-scst/APKBUILD
index f6f6c85b1b..0d562dc662 100644
--- a/testing/iscsi-scst/APKBUILD
+++ b/testing/iscsi-scst/APKBUILD
@@ -3,7 +3,7 @@
3 3
4pkgname=iscsi-scst 4pkgname=iscsi-scst
5pkgver=2.0.0 5pkgver=2.0.0
6pkgrel=0 6pkgrel=1
7pkgdesc="ISCSI target for SCST - userspace tools" 7pkgdesc="ISCSI target for SCST - userspace tools"
8url="http://iscsi-scst.sourceforge.net/" 8url="http://iscsi-scst.sourceforge.net/"
9arch="x86_64" 9arch="x86_64"
@@ -15,7 +15,9 @@ subpackages=
15_svn="3161" 15_svn="3161"
16source="http://alpine.nethq.org/distfiles/$pkgname-$pkgver-svn-$_svn.tar.gz 16source="http://alpine.nethq.org/distfiles/$pkgname-$pkgver-svn-$_svn.tar.gz
17 http://alpine.nethq.org/distfiles/scst-$pkgver-svn-$_svn.tar.gz 17 http://alpine.nethq.org/distfiles/scst-$pkgver-svn-$_svn.tar.gz
18 iscsi-scst.initd 18 $pkgname.initd
19 $pkgname.confd
20 scst.conf
19 " 21 "
20 22
21_builddir="$srcdir"/$pkgname 23_builddir="$srcdir"/$pkgname
@@ -33,10 +35,14 @@ package() {
33 cd "$_builddir" 35 cd "$_builddir"
34 # make install is broken 36 # make install is broken
35 install -D usr/iscsi-scstd "$pkgdir"/usr/sbin/iscsi-scstd 37 install -D usr/iscsi-scstd "$pkgdir"/usr/sbin/iscsi-scstd
36 install -D usr/iscsi-scst-adm "$pkgdir"/iscsi-scst-adm 38 install -D usr/iscsi-scst-adm "$pkgdir"/usr/sbin/iscsi-scst-adm
37 install -D -m 755 "$srcdir"/iscsi-scst.initd "$pkgdir"/etc/init.d/iscsi-scst 39 install -D -m 755 "$srcdir"/iscsi-scst.initd "$pkgdir"/etc/init.d/iscsi-scst
40 install -D -m 644 "$srcdir"/iscsi-scst.confd "$pkgdir"/etc/conf.d/iscsi-scst
41 install -D -m 644 "$srcdir"/scst.conf "$pkgdir"/etc/scst.conf
38} 42}
39 43
40md5sums="0980e7f0cc57d3a09cc57ba4b127ef12 iscsi-scst-2.0.0-svn-3161.tar.gz 44md5sums="0980e7f0cc57d3a09cc57ba4b127ef12 iscsi-scst-2.0.0-svn-3161.tar.gz
4173c1ec37231918e5183e78f1ec8f2302 scst-2.0.0-svn-3161.tar.gz 4573c1ec37231918e5183e78f1ec8f2302 scst-2.0.0-svn-3161.tar.gz
4205efba84051393bf22ff1f2c718afbe9 iscsi-scst.initd" 46ce6abcb6365f4b8609c3e963d5243b22 iscsi-scst.initd
476d8b6e27d47748f7805fdb318b62bb3b iscsi-scst.confd
48e8eda9872b3da3a55605c7fa17cb6c68 scst.conf"
diff --git a/testing/iscsi-scst/iscsi-scst.confd b/testing/iscsi-scst/iscsi-scst.confd
new file mode 100644
index 0000000000..1a13034dd2
--- /dev/null
+++ b/testing/iscsi-scst/iscsi-scst.confd
@@ -0,0 +1 @@
MEM_SIZE=""
diff --git a/testing/iscsi-scst/iscsi-scst.initd b/testing/iscsi-scst/iscsi-scst.initd
index 3563bafa7e..b63a3e57d8 100644
--- a/testing/iscsi-scst/iscsi-scst.initd
+++ b/testing/iscsi-scst/iscsi-scst.initd
@@ -4,20 +4,65 @@
4# 4#
5 5
6depend() { 6depend() {
7 need net 7 need net
8 after firewall 8 after firewall
9}
10
11configure_memsize() {
12 if [ ! -z "$MEM_SIZE" ]; then
13 if [ -e /proc/sys/net/core/wmem_max ]; then
14 echo ${MEM_SIZE} > /proc/sys/net/core/wmem_max
15 fi
16
17 if [ -e /proc/sys/net/core/rmem_max ]; then
18 echo ${MEM_SIZE} > /proc/sys/net/core/rmem_max
19 fi
20
21 if [ -e /proc/sys/net/core/wmem_default ]; then
22 echo ${MEM_SIZE} > /proc/sys/net/core/wmem_default
23 fi
24
25 if [ -e /proc/sys/net/core/rmem_default ]; then
26 echo ${MEM_SIZE} > /proc/sys/net/core/rmem_default
27 fi
28
29 if [ -e /proc/sys/net/ipv4/tcp_mem ]; then
30 echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_mem
31 fi
32
33 if [ -e /proc/sys/net/ipv4/tcp_rmem ]; then
34 echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_rmem
35 fi
36
37 if [ -e /proc/sys/net/ipv4/tcp_wmem ]; then
38 echo "${MEM_SIZE} ${MEM_SIZE} ${MEM_SIZE}" > /proc/sys/net/ipv4/tcp_wmem
39 fi
40 fi
41}
42
43check_dev_handlers() {
44 if lsmod | grep "scst_" >/dev/null; then
45 ewarn "Device handlers found"
46 else
47 ewarn "No SCST device handlers loaded!"
48 ewarn "You can add them in /etc/modules"
49 fi
9} 50}
10 51
11start() { 52start() {
12 modprobe -q crc32c 53 ebegin "Starting iscsi"
13 modprobe -q iscsi-scst 54 check_dev_handlers
14 ebegin "Starting iscsi-scstd" 55 modprobe -q crc32c
15 start-stop-daemon --start --exec /usr/sbin/iscsi-scstd 56 modprobe -q iscsi-scst
16 eend 0 57 start-stop-daemon --start --exec /usr/sbin/iscsi-scstd
58 /usr/sbin/scstadmin -config /etc/scst.conf
59 eend 0
17} 60}
18 61
19stop() { 62stop() {
20 ebegin "Stopping iscsi-scstd" 63 ebegin "Stopping iscsi"
21 start-stop-daemon --stop --exec /usr/sbin/iscsi-scstd 64 start-stop-daemon --stop --exec /usr/sbin/iscsi-scstd
22 eend 0 65 rmmod -w iscsi-scst
66 eend 0
23} 67}
68
diff --git a/testing/iscsi-scst/scst.conf b/testing/iscsi-scst/scst.conf
new file mode 100644
index 0000000000..341a0db9a1
--- /dev/null
+++ b/testing/iscsi-scst/scst.conf
@@ -0,0 +1,7 @@
1TARGET_DRIVER iscsi {
2 enabled 1
3
4 TARGET iqn.2010-12.net.alpinelinux:tgt {
5 }
6}
7