summaryrefslogtreecommitdiffstats
path: root/initramfs/initrd-stuff/etc/functions
diff options
context:
space:
mode:
authorMichael Janczyk2006-09-27 17:43:17 +0200
committerMichael Janczyk2006-09-27 17:43:17 +0200
commited033ffcf7846ee50ba2786fde43d2dbb70b6ffd (patch)
tree172fbc8cea44a44900e8dcb57eca20d1e1d5cafb /initramfs/initrd-stuff/etc/functions
parentRenaming of management-framework to ldap-site-mngmt, minor addition to (diff)
downloadcore-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/etc/functions')
-rw-r--r--initramfs/initrd-stuff/etc/functions33
1 files changed, 31 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 ...