WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] iscsi boot xen0 initrd

To: "Xen Virtual Machine Monitor" <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] iscsi boot xen0 initrd
From: "James Harper" <JamesH@xxxxxxxxxxxxxxxx>
Date: Sat, 9 Oct 2004 23:38:39 +1000
Delivery-date: Sat, 09 Oct 2004 14:45:16 +0100
Envelope-to: steven.hand@xxxxxxxxxxxx
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
Thread-index: AcSuBUjqULaJUFfNQJOmgDLHwbXn1Q==
Thread-topic: iscsi boot xen0 initrd
In case it helps anyone, here's a script I use to boot xen0 over iscsi
with an initrd using linux-iscsi and iscsi-init (both on sourceforge).
Some (or most) of it might be debian (sarge) specific though. The script
goes in /etc/mkinitrd/scripts and puts the bits and pieces in place. It
has to prepend stuff to /script in the resultant initrd so it does a few
funny things. Add your Ethernet module to /etc/mkinitrd/modules too. It
also takes care of the bridging by setting up the bridge before loading
iscsi-init which brings up the interface via dhcp or manually.

#!/bin/sh

MOD=`find /lib/modules/$VERSION -name 'iscsi_sfnet.*o'`
mkdir -p $INITRDDIR/`dirname $MOD`
cp $MOD $INITRDDIR/$MOD

MOD=`find /lib/modules/$VERSION -name 'crc32c.*o'`
mkdir -p $INITRDDIR/`dirname $MOD`
cp $MOD $INITRDDIR/$MOD

MOD=`find /lib/modules/$VERSION -name 'libcrc32c.*o'`
mkdir -p $INITRDDIR/`dirname $MOD`
cp $MOD $INITRDDIR/$MOD

MOD=`find /lib/modules/$VERSION -name 'iscsi_init.*o'`
mkdir -p $INITRDDIR/`dirname $MOD`
cp $MOD $INITRDDIR/$MOD

depmod -a -b $INITRDDIR $VERSION

mv $INITRDDIR/script $INITRDDIR/script.post-iscsi
chmod 777 $INITRDDIR/script.post-iscsi

if [ `echo $VERSION | grep '\-xen0$'` ]
then
  cp `which brctl` $INITRDDIR/sbin
  cp /usr/lib/libsysfs.so.1 $INITRDDIR/lib
  cat <<EOF >>$INITRDDIR/script
/sbin/ifconfig eth0 up
/sbin/brctl addbr br0
/sbin/brctl setfd br0 0
/sbin/brctl addif br0 eth0
EOF
fi

cat <<EOF >>$INITRDDIR/script
mount -nt tmpfs tmpfs /dev
modprobe -k iscsi_sfnet
modprobe -k iscsi_init
umount /dev
EOF
cat $INITRDDIR/script.post-iscsi >>$INITRDDIR/script
rm $INITRDDIR/script.post-iscsi
chmod 777 $INITRDDIR/script



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] iscsi boot xen0 initrd, James Harper <=