[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] iscsi boot xen0 initrd


  • To: "Xen Virtual Machine Monitor" <xen-devel@xxxxxxxxxxxxxxxxxxxxx>
  • From: "James Harper" <JamesH@xxxxxxxxxxxxxxxx>
  • Date: Sat, 9 Oct 2004 23:38:39 +1000
  • Delivery-date: Sat, 09 Oct 2004 14:45:16 +0100
  • List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
  • 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.