summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-openstack/recipes-connectivity/open-iscsi/files/initiatorname.iscsi1
-rw-r--r--meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator4
-rw-r--r--meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator-targets.service15
-rw-r--r--meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator.service12
-rwxr-xr-xmeta-openstack/recipes-connectivity/open-iscsi/files/open-iscsi94
-rw-r--r--meta-openstack/recipes-connectivity/open-iscsi/files/user.patch11
-rw-r--r--meta-openstack/recipes-connectivity/open-iscsi/open-iscsi-kernel_2.0-873.bb27
-rw-r--r--meta-openstack/recipes-connectivity/open-iscsi/open-iscsi-user_2.0-871.bb52
8 files changed, 216 insertions, 0 deletions
diff --git a/meta-openstack/recipes-connectivity/open-iscsi/files/initiatorname.iscsi b/meta-openstack/recipes-connectivity/open-iscsi/files/initiatorname.iscsi
new file mode 100644
index 0000000..842c2ab
--- /dev/null
+++ b/meta-openstack/recipes-connectivity/open-iscsi/files/initiatorname.iscsi
@@ -0,0 +1 @@
InitiatorName=HidaV
diff --git a/meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator b/meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator
new file mode 100644
index 0000000..7fa49a2
--- /dev/null
+++ b/meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator
@@ -0,0 +1,4 @@
1# default command line settings for open-iscsi's iscsid
2
3OPTS_ISCSID=""
4OPTS_ISCSIADM=""
diff --git a/meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator-targets.service b/meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator-targets.service
new file mode 100644
index 0000000..564b2d2
--- /dev/null
+++ b/meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator-targets.service
@@ -0,0 +1,15 @@
1[Unit]
2Description=Open-iSCSI initiator (i.e. client) target bindings
3After=iscsi-initiator.service
4Requires=iscsi-initiator.service
5
6[Service]
7Type=oneshot
8EnvironmentFile=/etc/default/iscsi-initiator
9ExecStart=/usr/sbin/iscsiadm -m node --loginall=automatic $OPTS_ISCSIADM
10ExecStop=/usr/sbin/iscsiadm -m node --logoutall=all $OPTS_ISCSIADM
11RemainAfterExit=yes
12
13[Install]
14WantedBy=multi-user.target
15
diff --git a/meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator.service b/meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator.service
new file mode 100644
index 0000000..b139751
--- /dev/null
+++ b/meta-openstack/recipes-connectivity/open-iscsi/files/iscsi-initiator.service
@@ -0,0 +1,12 @@
1[Unit]
2Description=Open-iSCSI initiator (i.e. client) service
3After=syslog.target
4
5[Service]
6EnvironmentFile=/etc/default/iscsi-initiator
7ExecStartPre=/sbin/modprobe iscsi_tcp
8ExecStart=/usr/sbin/iscsid -f $OPTS_ISCSID
9
10[Install]
11WantedBy=multi-user.target
12
diff --git a/meta-openstack/recipes-connectivity/open-iscsi/files/open-iscsi b/meta-openstack/recipes-connectivity/open-iscsi/files/open-iscsi
new file mode 100755
index 0000000..58d8ae1
--- /dev/null
+++ b/meta-openstack/recipes-connectivity/open-iscsi/files/open-iscsi
@@ -0,0 +1,94 @@
1#! /bin/sh
2### BEGIN INIT INFO
3# Provides:
4# Required-Start:
5# Required-Stop:
6# Default-Start:
7# Default-Stop:
8# Short-Description: Starts and stops the iSCSI initiator services and logins to default targets
9### END INIT INFO
10set -x
11PATH=/sbin:/bin:/usr/sbin:/usr/bin
12DAEMON=/usr/sbin/iscsid
13ADM=/usr/sbin/iscsiadm
14PIDFILE=/var/run/iscsid.pid
15
16[ -x "$DAEMON" ] || exit 0
17
18if [ ! -d /sys/class/ ]; then
19 logger -t iscsi-initiator "iSCSI requires a mounted sysfs, not started."
20 exit 1
21fi
22
23nodestartup_re='s/^node\.conn\[0]\.startup[ ]*=[ ]*//p'
24
25RETVAL=0
26
27start() {
28 logger -t iscsi-initiator "Starting iSCSI initiator service" "iscsid"
29 modprobe -q iscsi_tcp 2>/dev/null || :
30 modprobe -q ib_iser 2>/dev/null || :
31 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON
32 RETVAL=$?
33 logger -t iscsi-initiator "Command returned $RETVAL"
34 starttargets
35}
36
37starttargets() {
38 logger -t iscsi-initiator "Setting up iSCSI targets"
39 $ADM -m node --loginall=automatic
40 logger -t iscsi-initiator OK
41}
42
43stoptargets() {
44 logger -t iscsi-initiator "Disconnecting iSCSI targets"
45 sync
46 $ADM -m node --logoutall=all
47 logger -t iscsi-initiator OK
48}
49
50stop() {
51 stoptargets
52 logger -t iscsi-initiator "Stopping iSCSI initiator service"
53 start-stop-daemon --stop --quiet --pidfile $PIDFILE --exec $DAEMON
54 rm -f $PIDFILE
55 status=0
56 modprobe -r ib_iser 2>/dev/null
57 if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
58 status=1
59 fi
60 modprobe -r iscsi_tcp 2>/dev/null
61 if [ "$?" -ne "0" -a "$?" -ne "1" ]; then
62 status=1
63 fi
64 logger -t iscsi-initiator "Command returned $status"
65}
66
67restart() {
68 stop
69 start
70}
71
72restarttargets() {
73 stoptargets
74 starttargets
75}
76
77status() {
78 #XXX FIXME: what to do here?
79 #status iscsid
80 # list active sessions
81 echo Current active iSCSI sessions:
82 $ADM -m session
83}
84
85case "$1" in
86 start|starttargets|stop|stoptargets|restart|restarttargets|status)
87 $1
88 ;;
89 *)
90 echo "Usage: $0 {start|stop|restart|status}"
91 exit 1
92 ;;
93esac
94exit $RETVAL
diff --git a/meta-openstack/recipes-connectivity/open-iscsi/files/user.patch b/meta-openstack/recipes-connectivity/open-iscsi/files/user.patch
new file mode 100644
index 0000000..767c508
--- /dev/null
+++ b/meta-openstack/recipes-connectivity/open-iscsi/files/user.patch
@@ -0,0 +1,11 @@
1diff -Nurd a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
2--- a/usr/iscsi_sysfs.c 2012-08-06 12:32:21.098233792 +0200
3+++ b/usr/iscsi_sysfs.c 2012-08-06 12:33:09.534233952 +0200
4@@ -22,6 +22,7 @@
5 #include <string.h>
6 #include <errno.h>
7 #include <dirent.h>
8+#include <sys/stat.h>
9
10 #include "log.h"
11 #include "initiator.h"
diff --git a/meta-openstack/recipes-connectivity/open-iscsi/open-iscsi-kernel_2.0-873.bb b/meta-openstack/recipes-connectivity/open-iscsi/open-iscsi-kernel_2.0-873.bb
new file mode 100644
index 0000000..8d51460
--- /dev/null
+++ b/meta-openstack/recipes-connectivity/open-iscsi/open-iscsi-kernel_2.0-873.bb
@@ -0,0 +1,27 @@
1DESCRIPTION = "Open-iSCSI project is a high performance, transport independent, multi-platform implementation of RFC3720."
2HOMEPAGE = "http://www.open-iscsi.org/"
3LICENSE = "GPL"
4MACHINE_KERNEL_PR_append = "a"
5PR = "r2"
6
7LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
8
9SRC_URI = " http://www.open-iscsi.org/bits/open-iscsi-${PV}.tar.gz "
10
11
12S = "${WORKDIR}/open-iscsi-${PV}"
13TARGET_CC_ARCH += "${LDFLAGS}"
14
15inherit module
16
17do_compile () {
18 oe_runmake 'KSRC=${STAGING_KERNEL_DIR}' LDFLAGS="" kernel
19}
20
21do_install() {
22 oe_runmake 'KSRC=${STAGING_KERNEL_DIR}' LDFLAGS="" DESTDIR="${D}" install_kernel
23}
24
25
26SRC_URI[md5sum] = "8b8316d7c9469149a6cc6234478347f7"
27SRC_URI[sha256sum] = "7dd9f2f97da417560349a8da44ea4fcfe98bfd5ef284240a2cc4ff8e88ac7cd9"
diff --git a/meta-openstack/recipes-connectivity/open-iscsi/open-iscsi-user_2.0-871.bb b/meta-openstack/recipes-connectivity/open-iscsi/open-iscsi-user_2.0-871.bb
new file mode 100644
index 0000000..593d791
--- /dev/null
+++ b/meta-openstack/recipes-connectivity/open-iscsi/open-iscsi-user_2.0-871.bb
@@ -0,0 +1,52 @@
1DESCRIPTION = "Open-iSCSI project is a high performance, transport independent, multi-platform implementation of RFC3720."
2HOMEPAGE = "http://www.open-iscsi.org/"
3LICENSE = "GPL"
4PR = "r1"
5
6inherit systemd
7
8LIC_FILES_CHKSUM = "file://COPYING;md5=393a5ca445f6965873eca0259a17f833"
9
10SRC_URI = "http://www.open-iscsi.org/bits/open-iscsi-${PV}.tar.gz \
11 file://user.patch \
12 file://open-iscsi \
13 file://initiatorname.iscsi \
14 "
15
16
17S = "${WORKDIR}/open-iscsi-${PV}"
18TARGET_CC_ARCH += "${LDFLAGS}"
19
20
21do_compile () {
22 oe_runmake user
23}
24
25do_install () {
26 oe_runmake DESTDIR="${D}" install_user
27 cp -f "${WORKDIR}/open-iscsi" "${D}/etc/init.d/"
28 install -m 0644 ${WORKDIR}/initiatorname.iscsi ${D}/etc/iscsi/initiatorname.iscsi
29}
30
31
32SRC_URI[md5sum] = "0c403e8c9ad41607571ba0e6e8ff196e"
33SRC_URI[sha256sum] = "bcea8746ae82f2ada7bc05d2aa59bcda1ca0d5197f05f2e16744aae59f0a7dcb"
34
35# systemd support
36PACKAGES =+ "${PN}-systemd"
37SRC_URI_append = " file://iscsi-initiator \
38 file://iscsi-initiator.service \
39 file://iscsi-initiator-targets.service \
40 "
41RDEPENDS_${PN}-systemd += "${PN}"
42FILES_${PN}-systemd += " ${base_libdir}/systemd \
43 ${sysconfdir}/default/iscsi-initiator \
44 "
45SYSTEMD_PACKAGES = "${PN}-systemd"
46SYSTEMD_SERVICE = " iscsi-initiator.service iscsi-initiator-targets.service "
47
48
49do_install_append () {
50 install -d ${D}${sysconfdir}/default/
51 install -m 0644 ${WORKDIR}/iscsi-initiator ${D}${sysconfdir}/default/
52}