Bug#635161: open-iscsi: add a udeb

2011-09-15 Thread Ritesh Raj Sarraf
Hello Colin and Floris,


On 07/23/2011 07:07 PM, Colin Watson wrote:
> On Sat, Jul 23, 2011 at 01:20:33PM +0200, Floris Bos wrote:
>> On Saturday, July 23, 2011 12:37:29 PM Colin Watson wrote:
>>> I'd like to merge Ubuntu's support for iSCSI during d-i back into
>>> Debian.  Here's a patch for open-iscsi to add a udeb, which is the first
>>> step in making this work.
>>>
>>> Once this has landed, I'll merge the partman-iscsi work I've done into
>>> the d-i repository.
>> I was wondering why the upstream iscsistart is not included in the udeb.
> I didn't use it in the d-i integration code I wrote because at the level
> I was working at it was easier to just use iscsiadm directly, but I
> don't object to it being added.  I assume this is trivial enough that
> there's no need for me to update my patch.
>

I have included the iscsistart binary too. We can collectively decide
later if we want the iscsid daemon start right in initrd or later.
With iscsistart, we get a single path login in initrd which is good
enough till we reach init and start the daemon, which then logs in for
the remaining parts if any.

iscsid running right from start also is not that bad. Just that, we will
still need to do a verify/login in real init.

>> That way it would be possible to simply call "iscsistart -b" if an iBFT 
>> table 
>> is present to auto-configure the iSCSI settings, without having to prompt 
>> the 
>> user.
> Sure - the code I wrote for Ubuntu doesn't support using an iBFT table,
> so it makes sense to add that support.
>

Please CC us on the partman bug report for iscsi. We should get this
ready for Wheezy.


-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System




signature.asc
Description: OpenPGP digital signature


Bug#635161: open-iscsi: add a udeb

2011-07-23 Thread Ritesh Raj Sarraf
On 07/23/2011 04:07 PM, Colin Watson wrote:
> I'd like to merge Ubuntu's support for iSCSI during d-i back into
> Debian.  Here's a patch for open-iscsi to add a udeb, which is the first
> step in making this work.

Thank you Colin. This is something I was really looking to add some day.
I'll review and add it soon.

-- 
Ritesh Raj Sarraf | http://people.debian.org/~rrs
Debian - The Universal Operating System




signature.asc
Description: OpenPGP digital signature


Bug#635161: open-iscsi: add a udeb

2011-07-23 Thread Colin Watson
On Sat, Jul 23, 2011 at 01:20:33PM +0200, Floris Bos wrote:
> On Saturday, July 23, 2011 12:37:29 PM Colin Watson wrote:
> > I'd like to merge Ubuntu's support for iSCSI during d-i back into
> > Debian.  Here's a patch for open-iscsi to add a udeb, which is the first
> > step in making this work.
> > 
> > Once this has landed, I'll merge the partman-iscsi work I've done into
> > the d-i repository.
> 
> I was wondering why the upstream iscsistart is not included in the udeb.

I didn't use it in the d-i integration code I wrote because at the level
I was working at it was easier to just use iscsiadm directly, but I
don't object to it being added.  I assume this is trivial enough that
there's no need for me to update my patch.

> That way it would be possible to simply call "iscsistart -b" if an iBFT table 
> is present to auto-configure the iSCSI settings, without having to prompt the 
> user.

Sure - the code I wrote for Ubuntu doesn't support using an iBFT table,
so it makes sense to add that support.

Thanks,

-- 
Colin Watson   [cjwat...@ubuntu.com]



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#635161: open-iscsi: add a udeb

2011-07-23 Thread Floris Bos
Hi,

On Saturday, July 23, 2011 12:37:29 PM Colin Watson wrote:
> I'd like to merge Ubuntu's support for iSCSI during d-i back into
> Debian.  Here's a patch for open-iscsi to add a udeb, which is the first
> step in making this work.
> 
> Once this has landed, I'll merge the partman-iscsi work I've done into
> the d-i repository.

I was wondering why the upstream iscsistart is not included in the udeb.

That way it would be possible to simply call "iscsistart -b" if an iBFT table 
is present to auto-configure the iSCSI settings, without having to prompt the 
user.



Related bugs: 

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=495042#15 (debian-installer: 
add iscsi root installation)


-- 
Yours sincerely,

Floris Bos



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#635161: open-iscsi: add a udeb

2011-07-23 Thread Colin Watson
Package: open-iscsi
Version: 2.0.871.3-6
Severity: wishlist
Tags: patch d-i
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu ubuntu-patch oneiric

Hi,

I'd like to merge Ubuntu's support for iSCSI during d-i back into
Debian.  Here's a patch for open-iscsi to add a udeb, which is the first
step in making this work.

Once this has landed, I'll merge the partman-iscsi work I've done into
the d-i repository.

diff --git a/debian/control b/debian/control
index 6453627..7497615 100644
--- a/debian/control
+++ b/debian/control
@@ -28,6 +28,17 @@ Description: High performance, transport independent iSCSI 
implementation
  The userspace component consists of a daemon, iscsid and a management
  utility, iscsiadm
 
+Package: open-iscsi-udeb
+Architecture: any
+Section: debian-installer
+XC-Package-Type: udeb
+Depends: ${shlibs:Depends}, ${misc:Depends}, scsi-modules, libnss-files-udeb
+Description: Configure iSCSI
+ Open-iSCSI is a high-performance, transport independent, multi-platform
+ implementation of RFC3720 iSCSI.
+ .
+ This is the minimal package (udeb) used by debian-installer.
+
 #Package: linux-iscsi-modules-source
 #Architecture: all
 #Depends: ${shlibs:Depends}, ${misc:Depends}, module-assistant, debhelper (>= 
4.0.0), bzip2
diff --git a/debian/open-iscsi-udeb.dirs b/debian/open-iscsi-udeb.dirs
new file mode 100644
index 000..d128065
--- /dev/null
+++ b/debian/open-iscsi-udeb.dirs
@@ -0,0 +1,4 @@
+bin
+usr/lib/finish-install.d
+sbin
+etc/iscsi
diff --git a/debian/open-iscsi-udeb.finish-install 
b/debian/open-iscsi-udeb.finish-install
new file mode 100644
index 000..a9c1e17
--- /dev/null
+++ b/debian/open-iscsi-udeb.finish-install
@@ -0,0 +1,15 @@
+#! /bin/sh
+
+set -e
+
+got_iscsi=
+for f in /etc/iscsi/*; do
+   [ -e "$f" ] || continue
+   got_iscsi=1
+   break
+done
+
+if [ "$got_iscsi" ]; then
+   # Copy the configuration to the target...
+   cp -a /etc/iscsi /target/etc/
+fi
diff --git a/debian/open-iscsi-udeb.start b/debian/open-iscsi-udeb.start
new file mode 100644
index 000..90ad38d
--- /dev/null
+++ b/debian/open-iscsi-udeb.start
@@ -0,0 +1,18 @@
+#! /bin/sh
+
+# This is basically a version of the init script without dependencies on lsb
+# and without all the sanity checks. The installer is a clean environment, so
+# we don't need all of that.
+
+# Generate a unique InitiatorName and save it
+INAME=`iscsi-iname -p iqn.1993-08.org.debian:01`
+echo "## DO NOT EDIT OR REMOVE THIS FILE!" > /etc/iscsi/initiatorname.iscsi
+echo "## If you remove this file, the iSCSI daemon will not start." >> 
/etc/iscsi/initiatorname.iscsi
+echo "## If you change the InitiatorName, existing access control lists" >> 
/etc/iscsi/initiatorname.iscsi
+echo "## may reject this initiator.  The InitiatorName must be unique">> 
/etc/iscsi/initiatorname.iscsi
+echo "## for each iSCSI initiator.  Do NOT duplicate iSCSI InitiatorNames." >> 
/etc/iscsi/initiatorname.iscsi
+printf "InitiatorName=$INAME\n"  >> /etc/iscsi/initiatorname.iscsi
+chmod 600 /etc/iscsi/initiatorname.iscsi
+
+modprobe -q iscsi_tcp 2>/dev/null >&2
+/sbin/iscsid
diff --git a/debian/rules b/debian/rules
index 21a4711..60c0fa1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -85,6 +85,15 @@ install-arch:
install -m 600 etc/iscsid.conf $(CURDIR)/debian/open-iscsi/etc/iscsi
install -m 644 debian/open-iscsi.default 
$(CURDIR)/debian/open-iscsi/etc/default/open-iscsi
 
+   # udeb stuff
+   install -m 755 usr/iscsiadm $(CURDIR)/debian/open-iscsi-udeb/bin
+   install -m 755 utils/iscsi-iname $(CURDIR)/debian/open-iscsi-udeb/sbin
+   install -m 755 utils/iscsi_discovery 
$(CURDIR)/debian/open-iscsi-udeb/sbin
+   install -m 755 usr/iscsid $(CURDIR)/debian/open-iscsi-udeb/sbin
+   install -m 644 etc/iscsid.conf 
$(CURDIR)/debian/open-iscsi-udeb/etc/iscsi
+   install -m 644 debian/open-iscsi-udeb.start 
$(CURDIR)/debian/open-iscsi-udeb/sbin/iscsi-start
+   install -m 755 debian/open-iscsi-udeb.finish-install 
$(CURDIR)/debian/open-iscsi-udeb/usr/lib/finish-install.d/10open-iscsi
+
# initramfs stuff
install -m 755 debian/extra/initramfs.hook \

$(CURDIR)/debian/open-iscsi/usr/share/initramfs-tools/hooks/iscsi

-- 
Colin Watson   [cjwat...@ubuntu.com]



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org