Bug#495042: debian-installer: add iscsi root installation

2011-07-12 Thread Floris Bos
Hi,

Bumping an old feature request.

On Thursday, August 14, 2008 09:42:31 AM you wrote:
 Add iscsi root installation feature to debian installer. 

I was wondering if there were any plans to add this?


Did experiment a bit with it myself, and it's not that much work to simply 
detect the iSCSI settings set in the BIOS/boot firmware, and connect to the 
iSCSI target automatically, like CentOS and Windows do.

See the attached (unpolished) patches as a starting point of a way this can be 
done.


In short what is necessary is:

- check for the presence of an iBFT table in memory. This can be done by 
loading the iscsi_ibft kernel module and checking /sys.
  Since it only scans a memory region and does not do any more agressive 
probing, it's safe to load by default.

- if found, it means iSCSI is configured on the computer and the other iscsi 
kernel modules should be loaded. As well as an udeb with the open-scsi 
usermode tools that are responsible for setting up the connection. Calling 
iscsistart -b is enough to automatically connect to the target using the 
information found in the iBFT and attach the disks.

- make sure open-iscsi is added to the packages to be installed, and that a 
initramfs with iscsi support is created, so that the system will start after 
reboot.


-- 
Yours sincerely,

Floris Bos
diff -ur hw-detect-1.87.orig/debian/disk-detect.templates hw-detect-1.87/debian/disk-detect.templates
--- hw-detect-1.87.orig/debian/disk-detect.templates	2011-06-23 21:57:17.0 +0200
+++ hw-detect-1.87/debian/disk-detect.templates	2011-07-13 01:10:41.0 +0200
@@ -42,3 +42,13 @@
 Description: for internal use; can be preseeded
  Check for the presence of multipath devices?
 
+Template: disk-detect/iscsi_connect
+Type: text
+# :sl2:
+_Description: Connecting to iSCSI target
+
+Template: disk-detect/iscsi_error
+Type: error 
+# :sl2:
+_Description: Error connecting to iSCSI target (using the login information found in the iBFT)
+ 
diff -ur hw-detect-1.87.orig/disk-detect.sh hw-detect-1.87/disk-detect.sh
--- hw-detect-1.87.orig/disk-detect.sh	2011-06-23 21:57:17.0 +0200
+++ hw-detect-1.87/disk-detect.sh	2011-07-13 01:24:09.0 +0200
@@ -120,10 +120,31 @@
 	fi
 }
 
+iscsi_probe() {
+
+	log Looking for iSCSI iBFT table...   
+	modprobe iscsi_ibft || true 
+
+	if [ -e /sys/firmware/ibft/target0 ]; then
+		anna-install open-iscsi-udeb
+		modprobe iscsi_tcp
+		db_progress START 0 1 disk-detect/iscsi_connect
+		iscsistart -b || db_input high disk-detect/iscsi_error 
+		db_progress STOP	
+		apt-install open-iscsi || true
+	else
+		log No iSCSI iBFT table found, not loading iSCSI package
+	fi
+
+	return 0
+}
+
 if ! hw-detect disk-detect/detect_progress_title; then
 	log hw-detect exited nonzero
 fi
 
+iscsi_probe
+
 while ! disk_found; do
 	CHOICES=
 	for mod in $(list_disk_modules | sort); do
diff -ur kernel-wedge-2.77.orig/modules/scsi-modules kernel-wedge-2.77/modules/scsi-modules
--- kernel-wedge-2.77.orig/modules/scsi-modules	2011-03-12 19:38:58.0 +0100
+++ kernel-wedge-2.77/modules/scsi-modules	2011-07-11 20:03:03.0 +0200
@@ -26,3 +26,5 @@
 aic94xx ?
 stex ?
 xen-blkfront ?
+iscsi_tcp ?
+iscsi_ibft ?
diff -urN open-iscsi-2.0.871.3.orig/debian/control open-iscsi-2.0.871.3/debian/control
--- open-iscsi-2.0.871.3.orig/debian/control	2011-05-02 20:52:46.0 +0200
+++ open-iscsi-2.0.871.3/debian/control	2011-07-11 19:31:03.0 +0200
@@ -28,6 +28,15 @@
  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: Open-iSCSI initiator
+ .
+ For use by debian-installer.
+
 #Package: linux-iscsi-modules-source
 #Architecture: all
 #Depends: ${shlibs:Depends}, ${misc:Depends}, module-assistant, debhelper (= 4.0.0), bzip2
diff -urN open-iscsi-2.0.871.3.orig/debian/extra/initramfs.hook open-iscsi-2.0.871.3/debian/extra/initramfs.hook
--- open-iscsi-2.0.871.3.orig/debian/extra/initramfs.hook	2011-05-02 20:52:46.0 +0200
+++ open-iscsi-2.0.871.3/debian/extra/initramfs.hook	2011-07-13 01:02:57.0 +0200
@@ -26,6 +26,6 @@
 cp /etc/iscsi/initiatorname.iscsi $DESTDIR/etc
 cp /etc/iscsi/iscsi.initramfs $DESTDIR/etc
 
-for x in crc32c libcrc32c iscsi_tcp libiscsi scsi_transport_iscsi; do
+for x in crc32c libcrc32c iscsi_tcp iscsi_ibft libiscsi scsi_transport_iscsi; do
 	manual_add_modules ${x}
 done
diff -urN open-iscsi-2.0.871.3.orig/debian/open-iscsi-udeb.dirs open-iscsi-2.0.871.3/debian/open-iscsi-udeb.dirs
--- open-iscsi-2.0.871.3.orig/debian/open-iscsi-udeb.dirs	1970-01-01 01:00:00.0 +0100
+++ open-iscsi-2.0.871.3/debian/open-iscsi-udeb.dirs	2011-07-11 23:20:22.0 +0200
@@ -0,0 +1,5 @@
+usr/bin
+usr/sbin
+var/lib/open-iscsi
+usr/lib/finish-install.d
+etc/iscsi
diff -urN 

Bug#495042: debian-installer: add iscsi root installation

2008-08-14 Thread Ritesh Raj Sarraf
Package: libdebian-installer4
Version: 0.58
Severity: wishlist
File: debian-installer

Add iscsi root installation feature to debian installer. Later, once FCoE 
initiators are available, we might need one for that too. So there could be 
much common code for it. As an add-on, add multipathed installation too.

There could be two approached to it.
1) Pass arguments to the installer at boot. - Like SLES
2) Add an option in Storage Window - Like Red Hat


Ritesh


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.26-1-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libdebian-installer4 depends on:
ii  libc6 2.7-13 GNU C Library: Shared libraries

libdebian-installer4 recommends no packages.

libdebian-installer4 suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]