diff options
author | Michael Janczyk | 2006-09-27 17:43:17 +0200 |
---|---|---|
committer | Michael Janczyk | 2006-09-27 17:43:17 +0200 |
commit | ed033ffcf7846ee50ba2786fde43d2dbb70b6ffd (patch) | |
tree | 172fbc8cea44a44900e8dcb57eca20d1e1d5cafb /initramfs/initrd-stuff | |
parent | Renaming of management-framework to ldap-site-mngmt, minor addition to (diff) | |
download | core-ed033ffcf7846ee50ba2786fde43d2dbb70b6ffd.tar.gz core-ed033ffcf7846ee50ba2786fde43d2dbb70b6ffd.tar.xz core-ed033ffcf7846ee50ba2786fde43d2dbb70b6ffd.zip |
added xen network bridge configuration ./mkdxs... -m "netloop"
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@396 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'initramfs/initrd-stuff')
-rw-r--r-- | initramfs/initrd-stuff/etc/functions | 33 | ||||
-rwxr-xr-x | initramfs/initrd-stuff/init | 7 |
2 files changed, 38 insertions, 2 deletions
diff --git a/initramfs/initrd-stuff/etc/functions b/initramfs/initrd-stuff/etc/functions index f52a9f41..4a441550 100644 --- a/initramfs/initrd-stuff/etc/functions +++ b/initramfs/initrd-stuff/etc/functions @@ -2,8 +2,9 @@ # (included by init, hwautocfg, servconfig, ... within OpenSLX initial # ramfs) # -# Dirk von Suchodoletz <dvs@OpenSLX.com>, 03-09-2006 +# Dirk von Suchodoletz <dvs@OpenSLX.com>, 26-09-2006 # Felix Endres, 30-04-2006 +# <mj0@uni-freiburg.de> (xenbr), 27-09-2006 # Tobias Maier # # (c) 2006 - RZ Universitaet Freiburg @@ -194,6 +195,33 @@ local n=0 echo $n } ####################################################################### +# configure Xen bridge xenbr0 +xenbr_config () { +modprobe netloop +local vifnum="0" +local bridge="xenbr${vifnum}" +local netdev="eth${vifnum}" +local pdev="p${netdev}" +local vdev="veth${vifnum}" +local vif0="vif0.${vifnum}" +local mac=$(ip link show ${netdev} | sed -n '/^.*link\/ether/p' \ + | sed -e 's/.*ether \(..:..:..:..:..:..\).*/\1/') + +brctl addbr ${bridge} +brctl stp ${bridge} off +brctl setfd ${bridge} 0 +brctl addif ${bridge} ${vif0} +ip link set ${netdev} name ${pdev} +ip link set ${vdev} name ${netdev} +ip link set ${pdev} down arp off +ip link set ${pdev} addr fe:ff:ff:ff:ff:ff +ip link set ${netdev} addr ${mac} arp on +ip link set ${bridge} up +ip link set ${vif0} up +ip link set ${pdev} up +brctl addif ${bridge} ${pdev} +} +####################################################################### # configure IP address statically - first argument the ip address, # second the netmask, then gateway and broadcast address and last # interface. All arguments have to be given. @@ -403,7 +431,8 @@ if [ -n "$FILESRC" ] ; then tftpserver=$(uri_token $FILESRC server) tftpgetunpack $tftp $cfgfile $tftpserver else - cfgdir="client-conf" + # fixme: We need to know the prefix somehow + cfgdir="/tftpboot/client-conf" local tftpserver=$serverip # try to get configuration files successively; start with distro client # and try last distro default ... diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index 3aea9784..022b45f4 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -3,6 +3,7 @@ # clients version 4 # # Dirk von Suchodoletz <dirk@goe.net>, 07-09-2006 +# <mj0@uni-freiburg.de> (xenbr), 27-09-2006 # # (c) 2006 - RZ Universitaet Freiburg # (c) 2006 - OpenSLX.ORG project @@ -177,6 +178,8 @@ nfsroot=\"${NFSROOT}\"\n" >> /etc/machine-setup # be distinguished from other (dhcp) clients vci=*) VCI=${opts#vci=};; + xenbr) + XENBR=1;; esac done # check if at least one type of IP configuration is availabe @@ -224,6 +227,10 @@ for mod in ${NWMODULES}; do done # set up loopback networking (ipsetup - function defined in /etc/functions) ipsetup 127.0.0.1 255.0.0.0 0.0.0.0 127.255.255.255 lo + +# Xen bridge config +[ -n "$XENBR" ] && xenbr_config + # analyze ip information from the kernel command line and put parts # of it into several variables if [ -n "$IPINFO" ] ; then |