-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mikhail Chernonog <[email protected]>
- Loading branch information
Showing
5 changed files
with
81 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Feature: iscsi-boot | ||
|
||
Feature adds you to perform a diskless system boot using pxe and iSCSI. | ||
|
||
## Parameters | ||
- **ISCSI_TARGET_NAME** -- Target name iSCSI, required parameter | ||
- **ISCSI_TARGET_IP** -- Target IP address iSCSI, required parameter | ||
- **ISCSI_TARGET_PORT** -- Target port iSCSI | ||
- **ISCSI_TARGET_LUN** -- Target group tag iSCSI | ||
- **ISCSI_INITIATOR** -- Initiator name iSCSI | ||
- **ISCSI_USERNAME** -- Username for initiator authentication by the target(s) | ||
- **ISCSI_PASSWORD** -- Password for initiator authentication by the target(s) | ||
- **ISCSI_IN_USERNAME** -- Username for target(s) authentication by the initiator | ||
- **ISCSI_IN_PASSWORD** -- Password for target(s) authentication by the initiator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ISCSI_MODULES = iscsi-ibft \ | ||
iscsi-tcp \ | ||
iscsi-boot-sysfs \ | ||
iscsi-target-mod \ | ||
target-core-mod \ | ||
libiscsi \ | ||
libiscsi-tcp \ | ||
scsi-transport-iscsi \ | ||
sd_mod \ | ||
sr_mod | ||
|
||
ISCSI_DATADIR = $(FEATURESDIR)/iscsi/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
register_parameter string ISCSI_TARGET_NAME | ||
register_parameter string ISCSI_TARGET_IP | ||
register_parameter number ISCSI_TARGET_PORT | ||
register_parameter number ISCSI_TARGET_LUN | ||
register_parameter string ISCSI_INITIATOR | ||
register_parameter string ISCSI_USERNAME | ||
register_parameter string ISCSI_PASSWORD | ||
register_parameter string ISCSI_IN_USERNAME | ||
register_parameter string ISCSI_IN_PASSWORD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
### BEGIN INIT INFO | ||
# Provides: iscsi | ||
# Required-Start: cmdline modules network-up | ||
# Should-Start: | ||
# Required-Stop: | ||
# Should-Stop: | ||
# Default-Start: 3 4 5 | ||
# Default-Stop: | ||
### END INIT INFO | ||
|
||
[ -z "${1-}" ] || [ "$1" = start ] || exit 0 | ||
|
||
if [ -z "$ISCSI_TARGET_NAME" ] || [ -z "$ISCSI_TARGET_IP" ]; then | ||
exit 0 | ||
fi | ||
|
||
if [ -z "$ISCSI_INITIATOR" ]; then | ||
if [ ! -f /etc/iscsi/initiatorname.iscsi ]; then | ||
mkdir -p /etc/iscsi | ||
iscsi-gen-initiatorname | ||
fi | ||
. /etc/iscsi/initiatorname.iscsi | ||
ISCSI_INITIATOR="$InitiatorName" | ||
fi | ||
|
||
if [ -z "$ISCSI_TARGET_PORT" ]; then | ||
ISCSI_TARGET_PORT=3260 | ||
fi | ||
|
||
if [ -z "$ISCSI_TARGET_GROUP" ]; then | ||
ISCSI_TARGET_GROUP=1 | ||
fi | ||
|
||
iscsistart -i "$ISCSI_INITIATOR" -t "$ISCSI_TARGET_NAME" \ | ||
-g "$ISCSI_TARGET_GROUP" -a "$ISCSI_TARGET_IP" \ | ||
-p "$ISCSI_TARGET_PORT" \ | ||
"${ISCSI_USERNAME:+-u "$ISCSI_USERNAME"}" \ | ||
"${ISCSI_PASSWORD:+-w "$ISCSI_PASSWORD"}" \ | ||
"${ISCSI_IN_USERNAME:+-U "$ISCSI_IN_USERNAME"}" \ | ||
"${ISCSI_IN_PASSWORD:+-W "$ISCSI_IN_PASSWORD"}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
MODULES_LOAD += $(ISCSI_MODULES) | ||
|
||
PUT_PROGS += iscsistart iscsi-gen-initiatorname iscsi-iname | ||
PUT_FILES += $(wildcard /etc/iscsi/initiatorname.iscsi) | ||
PUT_FEATURE_DIRS += $(ISCSI_DATADIR) |