SHA256
1
0
forked from pool/open-iscsi
OBS User unknown 2008-07-25 14:58:50 +00:00 committed by Git OBS Bridge
parent 0a0d6ef9fe
commit 56aa034300
21 changed files with 351 additions and 29278 deletions

120
mkinitrd-boot.sh Normal file
View File

@ -0,0 +1,120 @@
#!/bin/bash
#%stage: device
#%depends: network
#%programs: /sbin/iscsid /sbin/iscsiadm /sbin/fwparam_ibft usleep
#%modules: iscsi_tcp crc32c scsi_transport_iscsi
#%if: "$root_iscsi" -o "$TargetAddress"
#
##### iSCSI initialization
##
## This script initializes iSCSI (SCSI over IP).
## To be able to use this script, the network has to be setup.
## When everything worked as expected, the iSCSI devices will show
## up as real SCSI devices.
##
## Command line parameters
## -----------------------
##
## TargetAddress the address of the iscsi server
## TargetPort the port of the iscsi server (defaults to 3260)
## TargetName the iscsi target name (connect to all if empty)
## iSCSI_ignoreNodes if set all stored nodes will be ignored (only
## iBFT and commandline nodes get parsed)
##
### iSCSI_warning_InitiatorName <new InitiatorName> <Origin>
# shows a warning about iSCSI InitiatorName differences
# Origin should be something like "commandline" or "iBFT"
iSCSI_warning_InitiatorName() {
echo "iSCSI: WARNING"
echo "iSCSI: ======================="
echo "iSCSI: "
echo "iSCSI: InitiatorName given on $2 and internally stored Initiator are different."
echo "iSCSI: New: $tmp_InitiatorName"
echo "iSCSI: Stored: $InitiatorName"
echo "iSCSI: "
echo "iSCSI: using the $2 version"
}
if [ "$iSCSI_ignoreNodes" ]; then
# make us forget we have to initialize stored nodes
echo "iSCSI: removing node information..."
iscsi_sessions=
rm -rf /etc/iscsi/nodes
mkdir /etc/iscsi/nodes
fi
# get the command line InitiatorName
tmp_InitiatorName="$(get_param InitiatorName)"
# reads the InitiatorName variable
. /etc/iscsi/initiatorname.iscsi
# Check of iBFT settings
if [ -x /sbin/fwparam_ibft ] ; then
eval $(/sbin/fwparam_ibft -b 2> /dev/null )
# only use the iBFT InitiatorName if the commandline argument is not "default"
if [ "$iSCSI_INITIATOR_NAME" -a "$tmp_InitiatorName" != "default" ] ; then
iSCSI_warning_InitiatorName "$iSCSI_INITIATOR_NAME" "iBFT"
InitiatorName=$iSCSI_INITIATOR_NAME
fi
TargetNameiBFT=$iSCSI_TARGET_NAME
TargetAddressiBFT=$iSCSI_TARGET_IPADDR
TargetPortiBFT=$iSCSI_TARGET_PORT
fi
if [ "$tmp_InitiatorName" != "$InitiatorName" -a "$tmp_InitiatorName" != "default" -a "$tmp_InitiatorName" ]; then
iSCSI_warning_InitiatorName "$tmp_InitiatorName" "cmdline"
InitiatorName=$tmp_InitiatorName
fi
# store the detected InitiatorName permanently
echo "InitiatorName=$InitiatorName" > /etc/iscsi/initiatorname.iscsi
unset iSCSI_warning_InitiatorName
# ... hier wuerde viel s390-init zeug kommen
iscsi_mark_root_nodes()
{
local iscsi_tgts
if [ -z "$iscsitarget" ] ; then
iscsi_tgts=$(/sbin/iscsiadm -m node | sed -n "s/.*$iscsiserver:$iscsiport,.* \(iqn.*\)/\1/p")
else
iscsi_tgts="$iscsitarget"
fi
for tgt in $iscsi_tgts ; do
/sbin/iscsiadm -m node -p $iscsiserver:$iscsiport -T $tgt -o update -n node.conn[0].startup -v automatic
done
}
load_modules
echo "Starting iSCSI daemon"
/sbin/iscsid
usleep 5000000
# loop through all stored iscsi sessions, the command line and iBFT settings
for session in iscsi_sessions "" iBFT; do
# get the current config
iscsiserver=$(eval echo \$TargetAddress$session)
iscsiport=$(eval echo \$TargetPort$session)
iscsitarget=$(eval echo \$TargetName$session)
# try to detect and connect to the iscsi server
if [ "$iscsiserver" -a "$iscsiport" ] ; then
echo -n "Starting discovery on ${iscsiserver},${iscsiport}: "
if /sbin/iscsiadm -m discovery -t st -p ${iscsiserver}:${iscsiport} 2> /dev/null ; then
echo "ok."
else
echo "failed."
fi
iscsi_mark_root_nodes
fi
done
/sbin/iscsiadm -m node -L automatic
unset iscsi_mark_root_nodes

73
mkinitrd-setup.sh Normal file
View File

@ -0,0 +1,73 @@
#!/bin/bash
#
#%stage: device
#
check_iscsi_root() {
local devname=$1
local sysfs_path
sysfs_path=$(/sbin/udevadm info -q path -n $rootdev 2> /dev/null)
if [ -z "$sysfs_path" ] || [ ! -d /sys$sysfs_path ] ; then
return;
fi
pushd /sys$sysfs_path > /dev/null
if [ ! -d device ] ; then
cd ..
fi
if [ ! -d device ] ; then
# no device link; return
popd > /dev/null
return;
fi
cd -P device
cd ../..
if [ -d connection* ]; then
cd -P connection*
cid=${PWD#*connection}
sid=${cid%%:*}
if [ -d /sys/class/iscsi_session/session$sid ]; then
cd -P /sys/class/iscsi_session/session$sid
echo $(basename $PWD)
fi
fi
popd > /dev/null
}
for bd in $blockdev; do
update_blockdev $bd
sid=$(check_iscsi_root $bd)
if [ "$sid" ]; then
root_iscsi=1
iscsi_sessions="$iscsi_sessions ${sid#session}"
fi
done
save_var root_iscsi
save_var iscsi_sessions
if [ "${root_iscsi}" ]; then
for session in $iscsi_sessions; do
eval TargetName${session}=$(cat /sys/class/iscsi_session/session${session}/targetname)
eval TargetAddress${session}=$(cat /sys/class/iscsi_connection/connection${session}:0/address)
eval TargetPort${session}=$(cat /sys/class/iscsi_connection/connection${session}:0/port)
save_var TargetName${session}
save_var TargetAddress${session}
save_var TargetPort${session}
# copy the iscsi configuration
cp -rp /etc/iscsi etc/
mkdir -p $tmp_mnt/var/run
mkdir -p $tmp_mnt/var/lock/iscsi
if [ -z "$interface" ] ; then
interface="default"
fi
done
fi
save_var TargetPort 3260 # in case the port was not defined via command line we assign a default port

21
mkinitrd-stop.sh Normal file
View File

@ -0,0 +1,21 @@
#!/bin/bash
#
#%stage: setup
#%provides: killprogs
#
#%if: "$iscsi_root"
#%dontshow
#
##### kill iscsi
##
## Because we will run and use the iSCSI daemon from the new root
## the old one has to be killed. During that time no iSCSI
## exceptions should occur!
##
## Command line parameters
## -----------------------
##
# kill iscsid, will be restarted from the real root
iscsi_pid=$(pidof iscsid)
[ "$iscsi_pid" ] && kill -KILL $iscsi_pid

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:60c6082f6129958f6c444ef22bb5bca5738e12a8699af7d2237f383a9aafbb4f
size 171378

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:881b0ea5209f1617cad0a1126c93e33c837075ebed01fa0219d36dd368c475c0
size 237601

View File

@ -1,12 +0,0 @@
Index: usr/iscsiadm.c
===================================================================
--- usr/iscsiadm.c (revision 865)
+++ usr/iscsiadm.c (revision 866)
@@ -852,7 +852,6 @@
printf("\n");
t = get_transport_by_sid(curr->sid);
- rc = iface_get_by_bind_info(db, &curr->iface, &iface);
printf("\t\t**********\n");
printf("\t\tInterface:\n");

View File

@ -1,317 +0,0 @@
commit 318863586af9278c82bd8543b8891002ce76d485
Author: Hannes Reinecke <hare@suse.de>
Date: Mon Mar 10 11:21:49 2008 +0100
Add compability program fwparam_ibft
We still need the fwparam_ibft program as the fw discovery won't
give us details about the network settings.
Signed-off-by: Hannes Reinecke <hare@suse.de>
diff --git a/usr/Makefile b/usr/Makefile
index 0e54cf6..42a8788 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -42,19 +42,19 @@ COMMON_SRCS = $(ISCSI_LIB_SRCS)
# core initiator files
INITIATOR_SRCS = initiator.o scsi.o actor.o mgmt_ipc.o isns.o transport.o
# fw boot files
-FW_BOOT_SRCS = $(wildcard ../utils/fwparam_ibft/*.o)
+FWPARAM_LIB = ../utils/fwparam_ibft/libfwparam.a
all: $(PROGRAMS)
iscsid: $(COMMON_SRCS) $(IPC_OBJ) $(INITIATOR_SRCS) iscsid.o
$(CC) $(CFLAGS) $^ -o $@
-iscsiadm: $(COMMON_SRCS) $(FW_BOOT_SRCS) strings.o discovery.o iscsiadm.o
- $(CC) $(CFLAGS) $^ -o $@
+iscsiadm: $(COMMON_SRCS) strings.o discovery.o iscsiadm.o
+ $(CC) $(CFLAGS) $^ -o $@ $(FWPARAM_LIB)
-iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) $(FW_BOOT_SRCS) \
+iscsistart: $(COMMON_SRCS) $(IPC_OBJ) $(INITIATOR_SRCS) \
iscsistart.o statics.o
- $(CC) $(CFLAGS) -static $^ -o $@
+ $(CC) $(CFLAGS) -static $^ -o $@ $(FWPARAM_LIB)
clean:
rm -f *.o $(PROGRAMS) .depend
diff --git a/utils/fwparam_ibft/Makefile b/utils/fwparam_ibft/Makefile
index 6d7d00a..1414f06 100644
--- a/utils/fwparam_ibft/Makefile
+++ b/utils/fwparam_ibft/Makefile
@@ -21,6 +21,9 @@
# "Prasanna Mumbai" <mumbai.prasanna@gmail.com>
#
+PROG = fwparam_ibft
+MAIN = fwparam_main.o
+LIB = libfwparam.a
OBJS := fwparam_ibft.o fw_entry.o
OBJS += prom_lex.o prom_parse.tab.o fwparam_ppc.o
CLEANFILES = $(OBJS) $(GENFILES) *.output *~
@@ -39,7 +42,10 @@ OPTFLAGS ?= -O2 -g -fPIC
WARNFLAGS ?= -Wall -Wstrict-prototypes
CFLAGS += $(OPTFLAGS) $(WARNFLAGS) -I../../include
-all: $(OBJS)
+all: $(LIB) $(PROG)
+
+$(LIB): $(OBJS)
+ $(AR) rcv $(LIB) $(OBJS)
clean:
rm -f *.o $(CLEANFILES) .depend
@@ -54,6 +60,9 @@ $(GENFILES): Makefile
$(OBJS): prom_parse.tab.h prom_parse.h fwparam_ibft.h
+$(PROG): $(MAIN) $(LIB)
+ gcc $(CFLAGS) -o $@ $< libfwparam.a
+
depend:
gcc $(CFLAGS) -M `ls *.c` > .depend
diff --git a/utils/fwparam_ibft/fwparam_ibft.c b/utils/fwparam_ibft/fwparam_ibft.c
index dcc63c3..4397f94 100644
--- a/utils/fwparam_ibft/fwparam_ibft.c
+++ b/utils/fwparam_ibft/fwparam_ibft.c
@@ -319,7 +319,7 @@ dump_ibft(void *ibft_loc, struct boot_context *context)
struct ibft_initiator *initiator = NULL;
struct ibft_nic *nic0 = NULL, *nic1 = NULL;
struct ibft_tgt *tgt0 = NULL, *tgt1 = NULL;
- char ipbuf[32];
+ char buf[32];
control = ibft_loc + sizeof(*ibft_hdr);
CHECK_HDR(control, control);
@@ -359,6 +359,28 @@ dump_ibft(void *ibft_loc, struct boot_context *context)
CHECK_HDR(tgt1, target);
}
+ if (!context) {
+ snprintf(buf, sizeof(buf), "iSCSI_INITIATOR_");
+
+ if (initiator && (initiator->hdr.flags &
+ INIT_FLAG_FW_SEL_BOOT))
+ dump_initiator_prefix(ibft_loc, initiator, buf);
+
+ if (nic0 && (nic0->hdr.flags & INIT_FLAG_FW_SEL_BOOT))
+ dump_nic_prefix(ibft_loc, nic0, buf);
+ else if (nic1 && (nic1->hdr.flags & INIT_FLAG_FW_SEL_BOOT))
+ dump_nic_prefix(ibft_loc, nic1, buf);
+
+ snprintf(buf, sizeof(buf), "iSCSI_TARGET_");
+
+ if (tgt0 && (tgt0->hdr.flags & INIT_FLAG_FW_SEL_BOOT))
+ dump_tgt_prefix(ibft_loc, tgt0, buf);
+ else if (tgt1 && (tgt1->hdr.flags & INIT_FLAG_FW_SEL_BOOT))
+ dump_tgt_prefix(ibft_loc, tgt1, buf);
+
+ return 0;
+ }
+
strncpy(context->initiatorname,
(char *)ibft_loc+initiator->initiator_name_off,
initiator->initiator_name_len + 1);
@@ -367,10 +389,10 @@ dump_ibft(void *ibft_loc, struct boot_context *context)
strncpy((char *)context->targetname,
(char *)(ibft_loc+tgt0->tgt_name_off),
tgt0->tgt_name_len);
- format_ipaddr(ipbuf, sizeof(ipbuf),
+ format_ipaddr(buf, sizeof(buf),
tgt0->ip_addr);
- strncpy((char *)context->target_ipaddr, ipbuf,
- sizeof(ipbuf));
+ strncpy((char *)context->target_ipaddr, buf,
+ sizeof(buf));
context->target_port = tgt0->port;
strncpy(context->chap_name,
(char *)(ibft_loc + tgt0->chap_name_off),
@@ -389,10 +411,10 @@ dump_ibft(void *ibft_loc, struct boot_context *context)
strncpy((char *)context->targetname,
(char *)(ibft_loc+tgt1->tgt_name_off),
tgt1->tgt_name_len);
- format_ipaddr(ipbuf, sizeof(ipbuf),
+ format_ipaddr(buf, sizeof(buf),
tgt1->ip_addr);
- strncpy((char *)context->target_ipaddr,ipbuf,
- sizeof(ipbuf));
+ strncpy((char *)context->target_ipaddr,buf,
+ sizeof(buf));
context->target_port = tgt1->port;
strncpy(context->chap_name,
(char *)(ibft_loc + tgt1->chap_name_off),
@@ -411,7 +433,7 @@ dump_ibft(void *ibft_loc, struct boot_co
return 0;
}
-char *search_ibft(unsigned char *start, int length)
+char *search_ibft(unsigned char *start, int start_addr, int length)
{
unsigned char *cur_ptr, *rom_end;
struct ibft_table_hdr *ibft_hdr;
@@ -426,35 +448,51 @@ char *search_ibft(unsigned char *start,
continue;
}
memcpy(&rom_size, cur_ptr + 2, 1);
- /* Don't search past the end of the ROM BIOS block */
- rom_end = cur_ptr + (rom_size * 512) - strlen(iBFTSTR);
- while (cur_ptr < rom_end) {
- if (!memcmp(cur_ptr, iBFTSTR,strlen(iBFTSTR)))
- break;
- cur_ptr++;
- }
- if (cur_ptr == rom_end) {
- cur_ptr += strlen(iBFTSTR);
- continue;
- }
+ if (debug > 1)
+ fprintf(stderr, "Found rom at %x of size %d\n",
+ ((int)(cur_ptr - start) + start_addr),
+ rom_size * 512);
- ibft_hdr = (struct ibft_table_hdr *)cur_ptr;
- /* Make sure it's correct version. */
- if (ibft_hdr->revision != iBFT_REV) {
- cur_ptr = rom_end + strlen(iBFTSTR);
+ if (rom_size == 0) {
+ /* Skip empty rom areas */
+ cur_ptr += 512;
continue;
}
- /* Make sure that length is valid. */
- if ((cur_ptr + ibft_hdr->length) <= (start + length)) {
- /* Let verify the checksum */
- for (i = 0, check_sum = 0; i < ibft_hdr->length; i++)
- check_sum += cur_ptr[i];
+ /* Don't search past the end of rom area */
+ rom_end = (cur_ptr + (rom_size * 512)) - strlen(iBFTSTR);
- if (check_sum == 0)
- return (char *)cur_ptr;
+ while (cur_ptr < rom_end) {
+ if (memcmp(cur_ptr, iBFTSTR,strlen(iBFTSTR))) {
+ cur_ptr++;
+ continue;
+ }
+
+ if (debug > 1)
+ fprintf(stderr, "Found iBFT table at %x\n",
+ (int)(cur_ptr - start) + start_addr);
+
+ ibft_hdr = (struct ibft_table_hdr *)cur_ptr;
+
+ /* Make sure it's correct version. */
+ if (ibft_hdr->revision != iBFT_REV) {
+ cur_ptr = rom_end;
+ continue;
+ }
+
+ /* Make sure that length is valid. */
+ if ((cur_ptr + ibft_hdr->length) <= (start + length)) {
+ /* Let verify the checksum */
+ for (i = 0, check_sum = 0; i < ibft_hdr->length; i++)
+ check_sum += cur_ptr[i];
+
+ if (check_sum == 0)
+ return (char *)cur_ptr;
+ }
+ cur_ptr = rom_end;
}
+ cur_ptr += strlen(iBFTSTR);
}
return NULL;
}
@@ -505,7 +543,7 @@ fwparam_ibft(struct boot_context *contex
goto done;
}
- ibft_loc = search_ibft((unsigned char *)filebuf, end_search);
+ ibft_loc = search_ibft((unsigned char *)filebuf, start, end_search);
if (ibft_loc)
ret = dump_ibft(ibft_loc, context);
else {
diff --git a/utils/fwparam_ibft/fwparam_main.c b/utils/fwparam_ibft/fwparam_main.c
new file mode 100644
index 0000000..3a91b52
--- /dev/null
+++ b/utils/fwparam_ibft/fwparam_main.c
@@ -0,0 +1,73 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ * USA.
+ *
+ * Copyright (C) IBM Corporation, 2006
+ *
+ * Authors: Patrick Mansfield <patmans@us.ibm.com>
+ * Mike Anderson <andmike@us.ibm.com>
+ * Hannes Reinecke <hare@suse.de>
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#include "fwparam_ibft.h"
+#include "fw_context.h"
+
+extern int debug;
+
+int
+main (int argc, char **argv)
+{
+ int option, ret;
+ char *progname, *filebuf = NULL;
+
+ progname = argv[0];
+
+ while (1) {
+ option = getopt(argc, argv, "f:vhb");
+ if (option == -1)
+ break;
+ switch (option) {
+ case 'b':
+ /* Ignored for compability */
+ break;
+ case 'f':
+ filebuf = optarg;
+ break;
+ case 'v':
+ debug++;
+ break;
+ default:
+ fprintf(stderr, "Unknown or bad option '%c'\n", option);
+ case 'h':
+ printf("Usage: %s OPTIONS\n"
+ "-b print only fw boot selected sections\n"
+ "-f file_to_search (default /dev/mem)\n"
+ "-v verbose\n",
+ progname);
+ exit(1);
+ }
+ }
+
+ ret = fwparam_ibft(NULL, filebuf);
+
+ exit(ret);
+}

View File

@ -1,29 +0,0 @@
commit 1a44165c0757fb3aefd0fae0cb1554756b38c2a6
Author: Hannes Reinecke <hare@suse.de>
Date: Mon Mar 10 10:56:15 2008 +0100
Format LUNs correctly
We are printing two characters at a time, so we should skip the same
amount of characters for each round.
Signed-off-by: Hannes Reinecke <hare@suse.de>
diff --git a/utils/fwparam_ibft/fwparam_ibft.c b/utils/fwparam_ibft/fwparam_ibft.c
index d6b8b7f..dcc63c3 100644
--- a/utils/fwparam_ibft/fwparam_ibft.c
+++ b/utils/fwparam_ibft/fwparam_ibft.c
@@ -81,8 +81,11 @@ format_lun(char *buf, size_t size, uint8_t *lun)
{
int i;
- for (i = 0; i < 8; i++)
- snprintf(buf++, size--, "%x", lun[i]);
+ for (i = 0; i < 8; i++) {
+ snprintf(buf, size, "%02x", lun[i]);
+ buf += 2;
+ size -= 2;
+ }
}
void

View File

@ -1,69 +0,0 @@
diff --git a/kernel/iscsi_tcp.c b/kernel/iscsi_tcp.c
diff --git a/kernel/iscsi_tcp.h b/kernel/iscsi_tcp.h
diff --git a/kernel/libiscsi.c b/kernel/libiscsi.c
diff --git a/kernel/libiscsi.h b/kernel/libiscsi.h
diff --git a/kernel/scsi_transport_iscsi.c b/kernel/scsi_transport_iscsi.c
diff --git a/kernel/scsi_transport_iscsi.h b/kernel/scsi_transport_iscsi.h
diff --git a/usr/discovery.c b/usr/discovery.c
diff --git a/usr/idbm.c b/usr/idbm.c
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
diff --git a/utils/fwparam_ibft/fwparam_ibft.c b/utils/fwparam_ibft/fwparam_ibft.c
index 02f8ac8..4557016 100644
--- a/utils/fwparam_ibft/fwparam_ibft.c
+++ b/utils/fwparam_ibft/fwparam_ibft.c
@@ -39,6 +39,8 @@ int debug;
int dev_count;
char filename[FILENAMESZ];
+char ID_ROMEXT[]={0x55, 0xaa, 0}; /* extended rom magic */
+
const char nulls[16]; /* defaults to zero */
int
@@ -408,22 +410,38 @@ dump_ibft(void *ibft_loc, struct boot_context *context)
char *search_ibft(unsigned char *start, int length)
{
- unsigned char *cur_ptr;
+ unsigned char *cur_ptr, *rom_end;
struct ibft_table_hdr *ibft_hdr;
- unsigned char check_sum;
+ unsigned char check_sum, rom_size;
uint32_t i;
cur_ptr = (unsigned char *)start;
- for (cur_ptr = (unsigned char *)start;
- cur_ptr < (start + length);
- cur_ptr++) {
- if (memcmp(cur_ptr, iBFTSTR,strlen(iBFTSTR)))
+ while (cur_ptr < (start + length)) {
+ if (memcmp(cur_ptr, ID_ROMEXT, strlen(ID_ROMEXT)) != 0) {
+ /* Skip this block */
+ cur_ptr += 512;
continue;
+ }
+ memcpy(&rom_size, cur_ptr + 2, 1);
+ /* Don't search past the end of the ROM BIOS block */
+ rom_end = cur_ptr + (rom_size * 512) - strlen(iBFTSTR);
+ while (cur_ptr < rom_end) {
+ if (!memcmp(cur_ptr, iBFTSTR,strlen(iBFTSTR)))
+ break;
+ cur_ptr++;
+ }
+
+ if (cur_ptr == rom_end) {
+ cur_ptr += strlen(iBFTSTR);
+ continue;
+ }
ibft_hdr = (struct ibft_table_hdr *)cur_ptr;
/* Make sure it's correct version. */
- if (ibft_hdr->revision != iBFT_REV)
+ if (ibft_hdr->revision != iBFT_REV) {
+ cur_ptr = rom_end + strlen(iBFTSTR);
continue;
+ }
/* Make sure that length is valid. */
if ((cur_ptr + ibft_hdr->length) <= (start + length)) {
diff --git a/utils/fwparam_ibft/fwparam_ibft.h b/utils/fwparam_ibft/fwparam_ibft.h

File diff suppressed because it is too large Load Diff

View File

@ -1,110 +0,0 @@
commit 18cbe8c5f68e5e545d02f773da03f52deadfd45b
Author: Hannes Reinecke <hare@suse.de>
Date: Wed Mar 12 10:36:30 2008 +0100
Fill in initiator values for iBFT context
The iBFT context already contains the fields for the initiator,
so we can as well fill them with something sensible.
Signed-off-by: Hannes Reinecke <hare@suse.de>
diff --git a/include/fw_context.h b/include/fw_context.h
index 47ac6ae..f6999e3 100644
--- a/include/fw_context.h
+++ b/include/fw_context.h
@@ -33,8 +33,9 @@ struct boot_context {
char chap_password_in[16];
char iface[42];
char mac[18];
- char ipaddr[18];
- char mask[18];
+ char ipaddr[32];
+ char mask[19];
+ char gwaddr[32];
char lun[17];
char vlan[15];
char isid[10];
diff --git a/utils/fwparam_ibft/fwparam_ibft.c b/utils/fwparam_ibft/fwparam_ibft.c
index 4397f94..3801028 100644
--- a/utils/fwparam_ibft/fwparam_ibft.c
+++ b/utils/fwparam_ibft/fwparam_ibft.c
@@ -150,6 +150,32 @@ format_ipaddr(char *buf, size_t size, uint8_t *ip)
}
+void
+format_netmask(char *buf, size_t size, uint8_t mask)
+{
+ uint32_t tmp;
+
+ tmp = 0xffffffff << (32 - mask);
+ sprintf(buf,"%d.%d.%d.%d",
+ (tmp >> 24) & 0xff,
+ (tmp >> 16) & 0xff,
+ (tmp >> 8) & 0xff,
+ tmp & 0xff);
+}
+
+void
+format_mac(char *buf, size_t size, uint8_t *mac)
+{
+ int i;
+
+ for (i = 0; i < 5; i++) {
+ sprintf(buf, "%02x:", mac[i]);
+ buf += 3;
+ }
+ sprintf(buf, "%02x", mac[i]);
+}
+
+
/*
* Dump the 16 byte ipaddr, as IPV6 or IPV4.
*/
@@ -385,6 +411,45 @@ dump_ibft(void *ibft_loc, struct boot_context *context)
(char *)ibft_loc+initiator->initiator_name_off,
initiator->initiator_name_len + 1);
+ if (nic0 && (nic0->hdr.flags & INIT_FLAG_FW_SEL_BOOT)) {
+ format_ipaddr(buf, sizeof(buf),
+ nic0->ip_addr);
+ strcpy((char *)context->ipaddr, buf);
+
+ format_ipaddr(buf, sizeof(buf),
+ nic0->gateway);
+ strcpy((char *)context->gwaddr, buf);
+
+ format_mac(buf, sizeof(buf),
+ nic0->mac);
+ strcpy((char *)context->mac, buf);
+
+ format_netmask(buf, sizeof(buf),
+ nic0->subnet_mask_prefix);
+ strcpy((char *)context->mask, buf);
+ }
+
+ if (nic1 && (nic1->hdr.flags & INIT_FLAG_FW_SEL_BOOT)) {
+ format_ipaddr(buf, sizeof(buf),
+ nic1->ip_addr);
+ strncpy((char *)context->ipaddr, buf,
+ sizeof(buf));
+ format_ipaddr(buf, sizeof(buf),
+ nic1->gateway);
+ strncpy((char *)context->gwaddr, buf,
+ sizeof(buf));
+
+ format_mac(buf, sizeof(buf),
+ nic1->mac);
+ strncpy((char *)context->mac, buf,
+ sizeof(buf));
+
+ format_netmask(buf, sizeof(buf),
+ nic1->subnet_mask_prefix);
+ strncpy((char *)context->mask, buf,
+ sizeof(buf));
+ }
+
if (tgt0 && (tgt0->hdr.flags & INIT_FLAG_FW_SEL_BOOT)) {
strncpy((char *)context->targetname,
(char *)(ibft_loc+tgt0->tgt_name_off),

View File

@ -1,105 +0,0 @@
commit 01ce5f6e4f9859aab2b3a7b36ca59e010af1d10a
Author: Hannes Reinecke <hare@suse.de>
Date: Wed Mar 12 10:37:47 2008 +0100
Implement '-i' to print out ifspec line
For the initrd we can easily print out the required
ifspec line, saving us quite some hassle there.
Signed-off-by: Hannes Reinecke <hare@suse.de>
diff --git a/utils/fwparam_ibft/fwparam_main.c b/utils/fwparam_ibft/fwparam_main.c
index 3a91b52..95a1a4d 100644
--- a/utils/fwparam_ibft/fwparam_main.c
+++ b/utils/fwparam_ibft/fwparam_main.c
@@ -27,22 +27,56 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
+#include <sys/types.h>
+#include <dirent.h>
#include "fwparam_ibft.h"
#include "fw_context.h"
extern int debug;
+int get_ifnum_from_mac(char *mac)
+{
+ int ifnum = -1, fd;
+ DIR *d;
+ struct dirent *dent;
+ char buf[20], attr[64];
+
+ d = opendir("/sys/class/net");
+ while ((dent = readdir(d))) {
+ if (dent->d_name[0] == '.')
+ continue;
+
+ sprintf(attr,"/sys/class/net/%s/address", dent->d_name);
+ fd = open(attr,O_RDONLY);
+ if (!fd)
+ continue;
+
+ read(fd, buf, 18);
+ close(fd);
+
+ if (strncmp(mac, buf, strlen(mac)))
+ continue;
+
+ if (sscanf(dent->d_name,"eth%d", &ifnum) == 1)
+ break;
+ }
+ closedir(d);
+
+ return ifnum;
+}
+
int
main (int argc, char **argv)
{
- int option, ret;
+ int option, ret, do_ipconfig = 0;
char *progname, *filebuf = NULL;
+ struct boot_context ctxt;
progname = argv[0];
while (1) {
- option = getopt(argc, argv, "f:vhb");
+ option = getopt(argc, argv, "f:ivhb");
if (option == -1)
break;
switch (option) {
@@ -52,6 +86,9 @@ main (int argc, char **argv)
case 'f':
filebuf = optarg;
break;
+ case 'i':
+ do_ipconfig = 1;
+ break;
case 'v':
debug++;
break;
@@ -67,7 +104,18 @@ main (int argc, char **argv)
}
}
- ret = fwparam_ibft(NULL, filebuf);
-
+ if (!do_ipconfig)
+ ret = fwparam_ibft(NULL, filebuf);
+ else {
+ ret = fwparam_ibft(&ctxt, filebuf);
+ if (!ret)
+ /*
+ * Format is:
+ * ipaddr:peeraddr:gwaddr:mask:hostname:iface:none
+ */
+ printf("%s::%s:%s::eth%d:ibft\n",
+ ctxt.ipaddr, ctxt.gwaddr,
+ ctxt.mask, get_ifnum_from_mac(ctxt.mac));
+ }
exit(ret);
}

View File

@ -1,48 +0,0 @@
commit a58c90313743e5e1614aa8a0522d6a441dc79ed3
Author: Hannes Reinecke <hare@suse.de>
Date: Mon Apr 21 11:28:25 2008 +0200
Scan Memory area for iBFT correctly
The iBFT might be constructed in the main memory area, too.
For this we don't have a ROM header, so we have to skip the
checks for this, too.
Signed-off-by: Hannes Reinecke <hare@suse.de>
diff --git a/utils/fwparam_ibft/fwparam_ibft.c b/utils/fwparam_ibft/fwparam_ibft.c
index dc0fc6b..84502bb 100644
--- a/utils/fwparam_ibft/fwparam_ibft.c
+++ b/utils/fwparam_ibft/fwparam_ibft.c
@@ -502,18 +502,24 @@ char *search_ibft(unsigned char *start, int start_addr, int length)
{
unsigned char *cur_ptr, *rom_end;
struct ibft_table_hdr *ibft_hdr;
- unsigned char check_sum, rom_size;
+ unsigned char check_sum;
+ short rom_size = -1;
uint32_t i;
cur_ptr = (unsigned char *)start;
while (cur_ptr < (start + length)) {
- if (memcmp(cur_ptr, ID_ROMEXT, strlen(ID_ROMEXT)) != 0) {
- /* Skip this block */
- cur_ptr += 512;
- continue;
+ if (rom_size < 0) {
+ /* Scan the upper memory area */
+ rom_size = 256;
+ } else {
+ /* Scan extenions in the ROM area */
+ if (memcmp(cur_ptr, ID_ROMEXT, strlen(ID_ROMEXT)) != 0) {
+ /* Skip this block */
+ cur_ptr += 512;
+ continue;
+ }
+ memcpy(&rom_size, cur_ptr + 2, 1);
}
- memcpy(&rom_size, cur_ptr + 2, 1);
-
if (debug > 1)
fprintf(stderr, "Found rom at %x of size %d\n",
((int)(cur_ptr - start) + start_addr),

View File

@ -1,24 +0,0 @@
commit daa06c2b0c0351fda9a667dabed426f976e40226
Author: Hannes Reinecke <hare@suse.de>
Date: Fri Apr 4 13:43:25 2008 +0200
fwparam_ibft: print messages to stderr
When no iBFT was found a message would be printed to stdout,
confusing any parsing scripts.
Signed-off-by: Hannes Reinecke <hare@suse.de>
diff --git a/utils/fwparam_ibft/fwparam_ibft.c b/utils/fwparam_ibft/fwparam_ibft.c
index 3801028..dc0fc6b 100644
--- a/utils/fwparam_ibft/fwparam_ibft.c
+++ b/utils/fwparam_ibft/fwparam_ibft.c
@@ -612,7 +612,7 @@ fwparam_ibft(struct boot_context *context, const char *filepath)
if (ibft_loc)
ret = dump_ibft(ibft_loc, context);
else {
- printf("Could not find iBFT.\n");
+ fprintf(stderr, "Could not find iBFT.\n");
ret = -1;
}
munmap(filebuf, end_search);

View File

@ -0,0 +1,13 @@
diff --git a/etc/initd/initd.suse b/etc/initd/initd.suse
index 23bbac0..d8b91cc 100644
--- a/etc/initd/initd.suse
+++ b/etc/initd/initd.suse
@@ -5,7 +5,7 @@
### BEGIN INIT INFO
# Provides: iscsi
# Required-Start: $network
-# Should-Start:
+# Should-Start: iscsitarget
# Required-Stop:
# Should-Stop:
# Default-Start: 3 5

View File

@ -1,27 +1,18 @@
diff --git a/Makefile b/Makefile
index 8eb812c..167138f 100644
index e405c9c..58bb24d 100644
--- a/Makefile
+++ b/Makefile
@@ -15,7 +15,7 @@ etcdir = /etc
initddir = $(etcdir)/init.d
MANPAGES = doc/iscsid.8 doc/iscsiadm.8 doc/iscsi_discovery.8
-PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname
+PROGRAMS = usr/iscsid usr/iscsiadm utils/iscsi_discovery utils/iscsi-iname utils/fwparam_ibft/fwparam_ibft
INSTALL = install
ETCFILES = etc/iscsid.conf
IFACEFILES = etc/iface.example
@@ -54,7 +54,7 @@ clean:
install_etc install_iface install_doc install_kernel install_iname
install: install_kernel install_programs install_doc install_etc \
- install_initd install_iname install_iface
+ install_initd
+ install_initd install_iface
install_usr: install_programs install_doc install_etc \
install_initd install_iname install_iface
diff --git a/kernel/Makefile b/kernel/Makefile
index bf67fec..268758d 100644
index 3dae671..65a291a 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -32,11 +32,16 @@ V ?= 0
@ -42,7 +33,7 @@ index bf67fec..268758d 100644
$(KBUILD_BASE) modules
# ============ BEGIN code for kernel_check and source patching ================
@@ -58,9 +63,11 @@ cur_patched=cur_patched
@@ -59,9 +64,11 @@ cur_patched=cur_patched
# check to see if code is unpatched
unpatch_code=$(shell test -e $(cur_patched) && echo do_unpatch_code )
@ -55,7 +46,7 @@ index bf67fec..268758d 100644
KERNEL_TARGET=linux_2_6_$(KSUBLEVEL)
kernel_check: $(KERNEL_TARGET)
@@ -114,7 +121,11 @@ has_20to21_patch: $(20to21_patch)
@@ -128,7 +135,11 @@ has_24_patch: $(24_patch)
# ============ END code for kernel_check and source patching =================
@ -68,7 +59,7 @@ index bf67fec..268758d 100644
$(KBUILD_BASE) clean
rm -f Module.symvers
@@ -164,7 +164,9 @@ ko = $(patsubst %.o,%.ko,$(obj-m))
@@ -167,7 +178,9 @@ ko = $(patsubst %.o,%.ko,$(obj-m))
$(ko): all
# now the actual command
@ -78,9 +69,9 @@ index bf67fec..268758d 100644
+install_kernel_obj: $(ko)
$(KBUILD_BASE) modules_install INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) INSTALL_MOD_PATH=$(INSTALL_MOD_PATH)
# vim: ft=make tw=72 sw=4 ts=4:
dpkg_divert:
diff --git a/usr/Makefile b/usr/Makefile
index bf67fec..268758d 100644
index 7794831..840510d 100644
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -7,9 +7,11 @@ OSNAME=$(shell uname -s)

View File

@ -1,205 +0,0 @@
commit 6005e4dab173f021b35da79e763ab0dd40d94a08
Author: Hannes Reinecke <hare@suse.de>
Date: Thu Apr 10 16:37:02 2008 +0200
Tear down device stack before logging out
We have to tear down the entire device stack before logging
out of any iSCSI portal, otherwise the system won't be
able to do a clean umount.
Signed-off-by: Hannes Reinecke <hare@suse.de>
diff --git a/etc/initd/initd.suse b/etc/initd/initd.suse
index d8b91cc..18bd889 100644
--- a/etc/initd/initd.suse
+++ b/etc/initd/initd.suse
@@ -26,6 +26,148 @@ ARGS="-c $CONFIG_FILE -p $PID_FILE"
# Reset status of this service
rc_reset
+dm_major()
+{
+ local maj
+
+ [ -f /proc/devices ] || echo 0
+ maj=$(sed -n 's/\([0-9]*\) device-mapper/\1/p' /proc/devices)
+ echo $maj
+}
+
+umount_lun()
+{
+ local dev=$1
+ local d m t l
+
+ cat /proc/mounts | sed -ne '/^\/dev\/.*/p' | while read d m t o x; do
+ if [ "$m" = "/" ] ; then
+ continue;
+ fi
+ l=$d
+ [ -L "$d" ] && l=$(readlink -f $d)
+
+ if [ "${l##/dev/mapper}" != "$l" ] ; then
+ t=$(dmsetup info -c --noheadings -o minor ${l##/dev/mapper/})
+ l="/dev/dm-$t"
+ fi
+
+ if [ "$l" != "$dev" ] ; then
+ continue;
+ fi
+
+ umount $d
+ break;
+ done
+}
+
+teardown_md()
+{
+ local dev=${1##/dev/}
+ local md_minor
+
+ md_minor=$(cat /proc/mdstat | sed -n "s/\(md[0-9]*\) : .* $dev.*/\1/p")
+
+ if [ "$md_minor" ] ; then
+ teardown_iscsi /dev/${md_minor}
+ mdadm -S /dev/${md_minor}
+ return 0
+ fi
+
+ return 1
+}
+
+teardown_dm()
+{
+ local dev=${1##/dev/}
+ local dm_maj=$(dm_major)
+ local dm_min
+ local retval=1
+ local tblname
+
+ read dev_t < /sys/block/$dev/dev
+
+ dmsetup table | sed -n "s/\(.*\): .* $dev_t .*/\1/p" | while read tblname; do
+ tbluuid=$(dmsetup info -c --noheadings -o uuid $tblname)
+ [ -z "$tbluuid" ] && continue
+ dm_min=$(dmsetup info -c --noheadings -o minor $tblname)
+ if [ ${tbluuid##mpath-} != "$tbluuid" ] ; then
+ teardown_iscsi /dev/dm-$dm_min
+ dmsetup remove $tblname
+ retval=0
+ elif [ ${tbluuid##part} != "$tbluuid" ] ; then
+ teardown_iscsi /dev/dm-$dm_min
+ dmsetup remove $tblname
+ retval=0
+ elif [ ${tbluuid##LVM-} != "$tbluuid" ] ; then
+ # We don't support stacking atop of LVM devices
+ umount_lun /dev/dm-$dm_min
+ dmsetup remove $tblname
+ retval=0
+ fi
+ done
+ return $retval
+}
+
+teardown_block()
+{
+ local dev=${1##/dev}
+ local s
+ local p
+
+ if [ ${dev##/sd} == $dev ] ; then
+ return 1
+ fi
+
+ p="/sys/block${dev%%[0-9]*}"
+
+ if [ ! -d ${p} ] && [ ! -d ${p}/device ] ; then
+ continue;
+ fi
+
+ s=$(cd -P ${p}/device && echo $PWD)
+
+ case "$s" in
+ */session[0-9]*/*)
+ # This is an iSCSI device
+ umount_lun $dev
+ return 0
+ ;;
+ esac
+ return 1
+}
+
+teardown_iscsi()
+{
+ local dev=$1
+
+ teardown_md $dev && return
+
+ teardown_dm $dev && return
+
+ teardown_block $dev && return
+
+ umount_lun $dev
+}
+
+iscsi_umount_all_luns()
+{
+ local d m dev p s
+
+ for target in /sys/class/iscsi_session/session*/device/target* ; do
+ [ -e $target ] || continue;
+ cd -P $target;
+ for lun in *:*:*:*; do
+ cd -P /sys/class/scsi_device/$lun/device
+ for l in block:* ; do
+ [ -e $l ] || continue
+ dev=${l##block:}
+ teardown_iscsi /dev/$dev
+ done
+ done
+ done
+}
+
iscsi_login_all_nodes()
{
echo -n "Setting up iSCSI targets: "
@@ -55,39 +197,6 @@ iscsi_logout_all_nodes()
return ${RETVAL:-0}
}
-iscsi_umount_all_luns()
-{
- local d m dev p s
-
- cat /proc/mounts | sed -ne '/^\/dev\/.*/p' | while read d m t o x; do
- if [ "$m" = "/" ] ; then
- continue;
- fi
- if [ -L "$d" ] ; then
- d=$(readlink -f $d)
- fi
- dev=${d##/dev}
-
- if [ "${dev##/sd}" = "$dev" ] ; then
- continue;
- fi
- p="/sys/block${dev%%[0-9]*}"
-
- if [ ! -d ${p} ] && [ ! -d ${p}/device ] ; then
- continue;
- fi
-
- s=$(cd -P ${p}/device && echo $PWD)
-
- case "$s" in
- */session[0-9]*/*)
- # This is an iSCSI device
- umount "$m"
- ;;
- esac
- done
-}
-
iscsi_list_all_nodes()
{
# Check for active sessions

View File

@ -0,0 +1,72 @@
diff --git a/etc/initd/boot.suse b/etc/initd/boot.suse
index df64e21..e4a54a6 100644
--- a/etc/initd/boot.suse
+++ b/etc/initd/boot.suse
@@ -10,8 +10,10 @@
# Should-Stop:
# Default-Start: B
# Default-Stop:
-# Short-Description: Starts the iSCSI initiator daemon
-#
+# Short-Description: iSCSI initiator daemon root-fs support
+# Description: Starts the iSCSI initiator daemon if the
+# root-filesystem is on an iSCSI device
+#
### END INIT INFO
ISCSIADM=/sbin/iscsiadm
@@ -56,7 +58,7 @@ case "$1" in
rc_status -v
iscsi_mark_root_nodes
;;
- stop)
+ stop|restart|reload)
rc_failed 0
;;
status)
@@ -68,13 +70,8 @@ case "$1" in
rc_status -v
fi
;;
- restart)
- $0 stop
- sleep 1
- $0 start
- ;;
*)
- echo "Usage: $0 {start|stop|status|restart}"
+ echo "Usage: $0 {start|stop|status|restart|reload}"
exit 1
;;
esac
diff --git a/etc/initd/initd.suse b/etc/initd/initd.suse
index d8b91cc..5c42b88 100644
--- a/etc/initd/initd.suse
+++ b/etc/initd/initd.suse
@@ -10,7 +10,9 @@
# Should-Stop:
# Default-Start: 3 5
# Default-Stop:
-# Short-Description: Starts and stops the iSCSI client initiator
+# Short-Description: iSCSI initiator daemon
+# Description: The iSCSI initator is used to create and
+# manage iSCSI connections to a iSCSI Target.
#
### END INIT INFO
@@ -190,13 +192,13 @@ case "$1" in
rc_status -v
fi
;;
- restart)
+ restart|reload)
$0 stop
sleep 1
$0 start
;;
*)
- echo "Usage: $0 {start|stop|status|restart}"
+ echo "Usage: $0 {start|stop|status|restart|reload}"
exit 1
;;
esac

View File

@ -1,13 +0,0 @@
diff --git a/usr/iscsiadm.c b/usr/iscsiadm.c
index 591ae8c..9e3d47c 100644
--- a/usr/iscsiadm.c
+++ b/usr/iscsiadm.c
@@ -1604,7 +1604,7 @@ do_sofware_sendtargets(idbm_t *db, discovery_rec_t *drec,
* ops for them
*/
if (!op)
- op = OP_NEW | OP_DELETE | OP_UPDATE;
+ op = OP_NEW | OP_DELETE;
drec->type = DISCOVERY_TYPE_SENDTARGETS;
rc = discovery_sendtargets(db, drec, &new_rec_list);

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Jul 24 12:04:10 CEST 2008 - hare@suse.de
- Update to 2.0-870-rc1
* Fix login redirection
* Fix NOP timeout handling
* Various small bugfixes
- Include mkinitrd scriptlets.
-------------------------------------------------------------------
Tue Apr 29 09:06:07 CEST 2008 - hare@suse.de

View File

@ -1,5 +1,5 @@
#
# spec file for package open-iscsi (Version 2.0.869)
# spec file for package open-iscsi (Version 2.0.870)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@ -18,27 +18,21 @@ License: GPL v2 or later
Group: Productivity/Networking/Other
PreReq: %fillup_prereq %insserv_prereq
AutoReqProv: on
Version: 2.0.869
Version: 2.0.870
Release: 1
Provides: linux-iscsi
Obsoletes: linux-iscsi
%define iscsi_release 865
Summary: Linux* Open-iSCSI Software Initiator
Source: %{name}-2.0-865.tar.bz2
Source: %{name}-2.0-870-rc1.tar.bz2
Source5: mkinitrd-setup.sh
Source6: mkinitrd-boot.sh
Source7: mkinitrd-stop.sh
Source11: iscsi-gen-initiatorname.sh
Patch1: %{name}-866.diff
Patch2: %{name}-git-update
Patch5: %{name}-format-luns
Patch22: %{name}-fwparam-scan-in-blocks
Patch24: %{name}-update-nodes
Patch30: %{name}-backport-fwparam_ibft
Patch31: %{name}-fix-suse-build
Patch32: %{name}-ibft-fill-initiator-values
Patch33: %{name}-ibft-print-ifspec
Patch37: %{name}-print-ibft-error-to-stderr
Patch38: %{name}-teardown-device-stack
Patch39: %{name}-fwparam_ppc-string-overflow
Patch40: %{name}-ibft-scan-memory-area
Patch1: %{name}-start-target-before-initiator
Patch2: %{name}-suse-build-fixes
Patch3: %{name}-fwparam_ppc-string-overflow
Patch4: %{name}-update-init-script
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -67,21 +61,11 @@ Authors:
open-iscsi@googlegroups.com
%prep
%setup -n %{name}-2.0-865
%patch1
%setup -n %{name}-2.0-870-rc1
%patch1 -p1
%patch2 -p1
%patch5 -p1
%patch22 -p1
%patch24 -p1
%patch30 -p1
%patch31 -p1
%patch32 -p1
%patch33 -p1
%patch37 -p1
%patch38 -p1
%patch39 -p1
%patch40 -p1
cp etc/iface.example .
%patch3 -p1
%patch4 -p1
%build
%{__make} OPTFLAGS="${RPM_OPT_FLAGS}"
@ -90,6 +74,10 @@ cp etc/iface.example .
make DESTDIR=${RPM_BUILD_ROOT} install
make DESTDIR=${RPM_BUILD_ROOT} install_initd_suse
install -D -m 755 %{S:11} ${RPM_BUILD_ROOT}/sbin/iscsi-gen-initiatorname
install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts
install -m 755 %{S:5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-iscsi.sh
install -m 755 %{S:6} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-iscsi.sh
install -m 755 %{S:7} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-killiscsi.sh
(cd ${RPM_BUILD_ROOT}/sbin; ln -sf /etc/init.d/open-iscsi rcopen-iscsi)
(cd ${RPM_BUILD_ROOT}/etc; ln -sf iscsi/iscsid.conf iscsid.conf)
@ -110,17 +98,29 @@ fi
%files
%defattr(-,root,root)
%dir /etc/iscsi
%attr(0600,root,root) %config(noreplace) /etc/iscsi/iscsid.conf
%dir /etc/iscsi/ifaces
/etc/iscsi/ifaces/iface.example
/etc/iscsid.conf
%config /etc/init.d/open-iscsi
%config /etc/init.d/boot.open-iscsi
/sbin/*
%dir /etc/iscsi
%doc iface.example
%dir /lib/mkinitrd
%dir /lib/mkinitrd/scripts
/lib/mkinitrd/scripts/setup-iscsi.sh
/lib/mkinitrd/scripts/boot-iscsi.sh
/lib/mkinitrd/scripts/boot-killiscsi.sh
%doc COPYING README
%doc %{_mandir}/man8/*
%changelog
* Thu Jul 24 2008 hare@suse.de
- Update to 2.0-870-rc1
* Fix login redirection
* Fix NOP timeout handling
* Various small bugfixes
- Include mkinitrd scriptlets.
* Tue Apr 29 2008 hare@suse.de
- Pull in fixes from upstream git repository
* Mon Apr 21 2008 hare@suse.de