* Tue Jun 20 2006 Jeremy Katz <katzj@redhat.com> - 6.0.5.595-1
- ensure that we respect %{optflags} - cleaned up initscript to make use of standard functions, return right values and start by default - build iscsistart as a static binary for use in initrds
This commit is contained in:
parent
b65dc49765
commit
ae8f3d08fe
37
iscsi-initiator-utils-cflags.patch
Normal file
37
iscsi-initiator-utils-cflags.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
--- open-iscsi-6.0.5.595/utils/Makefile.cflags 2006-06-20 21:36:08.000000000 -0400
|
||||||
|
+++ open-iscsi-6.0.5.595/utils/Makefile 2006-06-20 21:36:58.000000000 -0400
|
||||||
|
@@ -1,12 +1,13 @@
|
||||||
|
# This Makefile will work only with GNU make.
|
||||||
|
|
||||||
|
-CFLAGS += -O2 -fno-inline -Wall -Wstrict-prototypes -g
|
||||||
|
+OPTFLAGS ?= -O2 -g
|
||||||
|
+CFLAGS += $(OPTFLAGS) -fno-inline -Wall -Wstrict-prototypes
|
||||||
|
PROGRAMS = iscsi-iname
|
||||||
|
|
||||||
|
all: $(PROGRAMS)
|
||||||
|
|
||||||
|
iscsi-iname: md5.o iscsi-iname.o
|
||||||
|
- $(CC) $^ $(DBM_LIB) -o $@
|
||||||
|
+ $(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o $(PROGRAMS)
|
||||||
|
--- open-iscsi-6.0.5.595/usr/Makefile.cflags 2006-06-20 21:35:55.000000000 -0400
|
||||||
|
+++ open-iscsi-6.0.5.595/usr/Makefile 2006-06-20 21:36:25.000000000 -0400
|
||||||
|
@@ -45,13 +45,13 @@
|
||||||
|
all: $(PROGRAMS)
|
||||||
|
|
||||||
|
iscsid: $(COMMON_SRCS) $(IPC_OBJ) $(INITIATOR_SRCS) iscsid.o
|
||||||
|
- $(CC) $^ $(DBM_LIB) -o $@
|
||||||
|
+ $(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@
|
||||||
|
|
||||||
|
iscsiadm: $(COMMON_SRCS) strings.o discovery.o iscsiadm.o
|
||||||
|
- $(CC) $^ $(DBM_LIB) -o $@
|
||||||
|
+ $(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@
|
||||||
|
|
||||||
|
iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) iscsistart.o
|
||||||
|
- $(CC) $^ -o $@
|
||||||
|
+ $(CC) $(CFLAGS) $^ -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o $(PROGRAMS)
|
@ -1,12 +1,15 @@
|
|||||||
Summary: iSCSI daemon and utility programs
|
Summary: iSCSI daemon and utility programs
|
||||||
Name: iscsi-initiator-utils
|
Name: iscsi-initiator-utils
|
||||||
Version: 6.0.5.595
|
Version: 6.0.5.595
|
||||||
Release: 0
|
Release: 1
|
||||||
Source0: http://people.redhat.com/mchristi/iscsi/FC6/open-iscsi/rpm/open-iscsi-%{version}.tar.bz2
|
Source0: http://people.redhat.com/mchristi/iscsi/FC6/open-iscsi/rpm/open-iscsi-%{version}.tar.bz2
|
||||||
|
Source1: iscsi.init
|
||||||
Patch0: open-iscsi-5.0.5.595-update-initscripts-and-docs.patch
|
Patch0: open-iscsi-5.0.5.595-update-initscripts-and-docs.patch
|
||||||
Patch1: open-iscsi-5.0.5.595-add-iscsi-iname.patch
|
Patch1: open-iscsi-5.0.5.595-add-iscsi-iname.patch
|
||||||
Patch2: open-iscsi-5.0.5.595-rm-reopen-max.patch
|
Patch2: open-iscsi-5.0.5.595-rm-reopen-max.patch
|
||||||
Patch3: open-iscsi-5.0.5.595-fc-version.patch
|
Patch3: open-iscsi-5.0.5.595-fc-version.patch
|
||||||
|
Patch4: iscsi-initiator-utils-cflags.patch
|
||||||
|
Patch5: iscsistart-static.patch
|
||||||
|
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
License: GPL
|
License: GPL
|
||||||
@ -23,21 +26,19 @@ for distributed disk access using SCSI commands sent over Internet
|
|||||||
Protocol networks.
|
Protocol networks.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version} -c
|
%setup -q -n open-iscsi-%{version}
|
||||||
cd open-iscsi-%{version}
|
|
||||||
%patch0 -p1 -b .update-initscripts-and-docs
|
%patch0 -p1 -b .update-initscripts-and-docs
|
||||||
%patch1 -p1 -b .add-iscsi-iname
|
%patch1 -p1 -b .add-iscsi-iname
|
||||||
%patch2 -p1 -b .rm-reopen-max
|
%patch2 -p1 -b .rm-reopen-max
|
||||||
%patch3 -p1 -b .fc-version
|
%patch3 -p1 -b .fc-version
|
||||||
|
%patch4 -p1 -b .cflags
|
||||||
|
%patch5 -p1 -b .static
|
||||||
|
|
||||||
%build
|
%build
|
||||||
cd open-iscsi-%{version}
|
make OPTFLAGS="%{optflags}" -C usr
|
||||||
make -C usr
|
make OPTFLAGS="%{optflags}" -C utils
|
||||||
make -C utils
|
|
||||||
|
|
||||||
%install
|
%install
|
||||||
cd open-iscsi-%{version}
|
|
||||||
|
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
mkdir -p $RPM_BUILD_ROOT/sbin
|
mkdir -p $RPM_BUILD_ROOT/sbin
|
||||||
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8
|
mkdir -p ${RPM_BUILD_ROOT}%{_mandir}/man8
|
||||||
@ -46,9 +47,11 @@ mkdir -p $RPM_BUILD_ROOT/var/db/iscsi/
|
|||||||
install -s -m 755 usr/iscsid usr/iscsiadm utils/iscsi-iname usr/iscsistart $RPM_BUILD_ROOT/sbin
|
install -s -m 755 usr/iscsid usr/iscsiadm utils/iscsi-iname usr/iscsistart $RPM_BUILD_ROOT/sbin
|
||||||
install -m 644 doc/iscsiadm.8 $RPM_BUILD_ROOT/%{_mandir}/man8
|
install -m 644 doc/iscsiadm.8 $RPM_BUILD_ROOT/%{_mandir}/man8
|
||||||
install -m 644 doc/iscsid.8 $RPM_BUILD_ROOT/%{_mandir}/man8
|
install -m 644 doc/iscsid.8 $RPM_BUILD_ROOT/%{_mandir}/man8
|
||||||
install -m 755 etc/initd/initd.redhat $RPM_BUILD_ROOT/etc/rc.d/init.d/iscsi
|
#install -m 755 etc/initd/initd.redhat $RPM_BUILD_ROOT/etc/rc.d/init.d/iscsi
|
||||||
install -m 644 etc/iscsid.conf $RPM_BUILD_ROOT/etc
|
install -m 644 etc/iscsid.conf $RPM_BUILD_ROOT/etc
|
||||||
|
|
||||||
|
install -m 755 %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/iscsi
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
@ -56,7 +59,6 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
if [ ! -f /etc/initiatorname.iscsi ]; then
|
if [ ! -f /etc/initiatorname.iscsi ]; then
|
||||||
echo "InitiatorName=`/sbin/iscsi-iname`" > /etc/initiatorname.iscsi
|
echo "InitiatorName=`/sbin/iscsi-iname`" > /etc/initiatorname.iscsi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/sbin/chkconfig --add iscsi
|
/sbin/chkconfig --add iscsi
|
||||||
|
|
||||||
%preun
|
%preun
|
||||||
@ -66,14 +68,20 @@ fi
|
|||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
%doc README
|
||||||
%config /etc/rc.d/init.d/iscsi
|
%config /etc/rc.d/init.d/iscsi
|
||||||
%attr(600,root,root) %config(noreplace) /etc/iscsid.conf
|
%attr(0600,root,root) %config(noreplace) /etc/iscsid.conf
|
||||||
%doc open-iscsi-%{version}/README
|
|
||||||
%dir /var/db/iscsi
|
%dir /var/db/iscsi
|
||||||
/sbin/*
|
/sbin/*
|
||||||
%{_mandir}/*/*
|
%{_mandir}/*/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Jun 20 2006 Jeremy Katz <katzj@redhat.com> - 6.0.5.595-1
|
||||||
|
- ensure that we respect %%{optflags}
|
||||||
|
- cleaned up initscript to make use of standard functions, return right
|
||||||
|
values and start by default
|
||||||
|
- build iscsistart as a static binary for use in initrds
|
||||||
|
|
||||||
* Tue May 30 2006 Mike Christie <mchristi@redhat.com>
|
* Tue May 30 2006 Mike Christie <mchristi@redhat.com>
|
||||||
- rebase package to svn rev 595 to fix several bugs
|
- rebase package to svn rev 595 to fix several bugs
|
||||||
NOTE!!!!!!!! This is not compatible with the older open-iscsi modules
|
NOTE!!!!!!!! This is not compatible with the older open-iscsi modules
|
||||||
|
86
iscsi.init
Executable file
86
iscsi.init
Executable file
@ -0,0 +1,86 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# chkconfig: 345 13 89
|
||||||
|
# description: Starts and stops the iSCSI initiator
|
||||||
|
#
|
||||||
|
# processname: iscsid
|
||||||
|
# pidfile: /var/run/iscsid.pid
|
||||||
|
# config: /etc/iscsid.conf
|
||||||
|
|
||||||
|
# Source function library.
|
||||||
|
. /etc/init.d/functions
|
||||||
|
|
||||||
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
|
|
||||||
|
RETVAL=0
|
||||||
|
|
||||||
|
start()
|
||||||
|
{
|
||||||
|
echo -n $"Starting iSCSI initiator service: "
|
||||||
|
modprobe -q iscsi_tcp
|
||||||
|
daemon iscsid
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
[ $RETVAL -eq 0 ] || return
|
||||||
|
|
||||||
|
touch /var/lock/subsys/iscsi
|
||||||
|
|
||||||
|
echo -n $"Setting up iSCSI targets: "
|
||||||
|
TARGETS=`iscsiadm -m node 2> /dev/null | sed 's@\[\(.*\)\] .*@\1@g'`
|
||||||
|
for rec in $TARGETS; do
|
||||||
|
STARTUP=`iscsiadm -m node -r $rec | grep "node.startup" | cut -d' ' -f3`
|
||||||
|
if [ $STARTUP = "automatic" ]; then
|
||||||
|
iscsiadm -m node -r $rec -l
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
success
|
||||||
|
echo
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
stop()
|
||||||
|
{
|
||||||
|
echo -n $"Stopping iSCSI initiator service: "
|
||||||
|
sync
|
||||||
|
TARGETS=`iscsiadm -m session | grep "\[*\]" | sed 's@\[\(.*\)\] .*@\1@g'`
|
||||||
|
for rec in $TARGETS; do
|
||||||
|
iscsiadm -m node -r $rec -u
|
||||||
|
done
|
||||||
|
|
||||||
|
killproc iscsid
|
||||||
|
echo
|
||||||
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/iscsi
|
||||||
|
|
||||||
|
modprobe -r iscsi_tcp 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
restart()
|
||||||
|
{
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
stop
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
status iscsid
|
||||||
|
RETVAL=$?
|
||||||
|
;;
|
||||||
|
condrestart)
|
||||||
|
[ -f /var/lock/subsys/iscsi ] && restart
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|restart|status|condrestart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $RETVAL
|
11
iscsistart-static.patch
Normal file
11
iscsistart-static.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- open-iscsi-6.0.5.595/usr/Makefile.static 2006-06-20 23:21:15.000000000 -0400
|
||||||
|
+++ open-iscsi-6.0.5.595/usr/Makefile 2006-06-20 23:22:59.000000000 -0400
|
||||||
|
@@ -51,7 +51,7 @@
|
||||||
|
$(CC) $(CFLAGS) $^ $(DBM_LIB) -o $@
|
||||||
|
|
||||||
|
iscsistart: $(IPC_OBJ) $(ISCSI_LIB_SRCS) $(INITIATOR_SRCS) iscsistart.o
|
||||||
|
- $(CC) $(CFLAGS) $^ -o $@
|
||||||
|
+ $(CC) -static $(CFLAGS) $^ -o $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f *.o $(PROGRAMS)
|
Loading…
Reference in New Issue
Block a user