From 416ab8a37f1b07dc9f6c0fb3ff1a8ff2036510b5 Mon Sep 17 00:00:00 2001 From: Sebastian Schmelzer Date: Thu, 2 Sep 2010 17:50:49 +0200 Subject: change dir structure --- .../init-hooks/20-nw-bridge-config/bridge.sh | 30 +++++++++++ .../init-hooks/60-have-servconfig/vm-dhcpd.sh | 60 ++++++++++++++++++++++ .../init-hooks/80-after-plugins/adapt-tmpfs.sh | 24 +++++++++ 3 files changed, 114 insertions(+) create mode 100755 src/os-plugins/plugins/vmware/init-hooks/20-nw-bridge-config/bridge.sh create mode 100755 src/os-plugins/plugins/vmware/init-hooks/60-have-servconfig/vm-dhcpd.sh create mode 100644 src/os-plugins/plugins/vmware/init-hooks/80-after-plugins/adapt-tmpfs.sh (limited to 'src/os-plugins/plugins/vmware/init-hooks') diff --git a/src/os-plugins/plugins/vmware/init-hooks/20-nw-bridge-config/bridge.sh b/src/os-plugins/plugins/vmware/init-hooks/20-nw-bridge-config/bridge.sh new file mode 100755 index 00000000..3ae7e946 --- /dev/null +++ b/src/os-plugins/plugins/vmware/init-hooks/20-nw-bridge-config/bridge.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# Copyright (c) 2009..2010 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org +# +# Init hook to create a bridge on the active network interface +# (should be kept identical to the files of virtualbox and qemukvm plugins) +############################################################################# + +local bridge=br0 +local brnwif=${nwif} +local nwifmac=${macaddr} + +# bridge 0 already defined or some other problem +brctl addbr ${bridge} || exit 0 +brctl stp ${bridge} 0 +brctl setfd ${bridge} 0.000000000001 +ip link set addr ${nwifmac} ${bridge} +ip link set dev ${nwif} up +brctl addif ${bridge} ${nwif} + +# fixme: sending back the variable to init does not work properly at the +# moment +nwif=${bridge} diff --git a/src/os-plugins/plugins/vmware/init-hooks/60-have-servconfig/vm-dhcpd.sh b/src/os-plugins/plugins/vmware/init-hooks/60-have-servconfig/vm-dhcpd.sh new file mode 100755 index 00000000..b4f02389 --- /dev/null +++ b/src/os-plugins/plugins/vmware/init-hooks/60-have-servconfig/vm-dhcpd.sh @@ -0,0 +1,60 @@ +#!/bin/sh +# Copyright (c) 2010 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org +# +# Init hook to create a bridge on the active network interface +# (should be kept identical in vmware, virtualbox and qemukvm plugins) +############################################################################# + +. /etc/openslx.conf + +CONFDIR=/mnt/${OPENSLX_DEFAULT_CONFDIR} +testmkd ${CONFDIR} + +# configuring dhcpd stub for virtual networks +cat > ${CONFDIR}/udhcpd.conf << EOF +# general udhcpd configuration file for virtual machines written by +# $0 during OpenSLX stage3 configuration + +# start and end of the IP lease block +start CNETWORK.20 +end CNETWORK.100 + +# interface that udhcpd will use +interface NWIF + +# how long an offered address is reserved (leased) in seconds +offer_time 6000 + +# location of the leases file +lease_file LEASEFILE + +# location of the pid file +pidfile PIDFILE + +option dns ${domain_name_servers} +option subnet 255.255.255.0 +option router CNETWORK.1 +option wins CNETWORK.10 +option domain virtual.site ${domain_name} + +# additional options known to udhcpd +#subnet #timezone +#router #timesvr +#namesvr #dns +#logsvr #cookiesvr +#lprsvr #bootsize +#domain #swapsvr +#rootpath #ipttl +#mtu #broadcast +#wins #lease +#ntpsrv #tftp +#bootfile +EOF diff --git a/src/os-plugins/plugins/vmware/init-hooks/80-after-plugins/adapt-tmpfs.sh b/src/os-plugins/plugins/vmware/init-hooks/80-after-plugins/adapt-tmpfs.sh new file mode 100644 index 00000000..a28a8c6f --- /dev/null +++ b/src/os-plugins/plugins/vmware/init-hooks/80-after-plugins/adapt-tmpfs.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# Copyright (c) 2010 - OpenSLX GmbH +# +# This program is free software distributed under the GPL version 2. +# See http://openslx.org/COPYING +# +# If you have any feedback please consult http://openslx.org/feedback and +# send your feedback to feedback@openslx.org +# +# General information about OpenSLX can be found at http://openslx.org +# +# Init hook to adapt the tmpfs size for VMware/Player +# (should be kept identical to the files of virtualbox plugin) +############################################################################# + +# adapt tmpfs size (overbook) +case $(grep tmpfs /proc/mounts) in + */tmp*) + mount -o remount,size=160% /mnt/tmp + ;; + */uniontmp*) + mount -o remount,size=160% /mnt/uniontmp + ;; +esac -- cgit v1.2.3-55-g7522