diff options
author | Dirk von Suchodoletz | 2008-03-16 23:25:23 +0100 |
---|---|---|
committer | Dirk von Suchodoletz | 2008-03-16 23:25:23 +0100 |
commit | e9a412d928a2077ce2e72c86f7b637257b999fd2 (patch) | |
tree | 54a068e2e1a613f6ec4efe1d093239d525cce1f0 /os-plugins | |
parent | Working on the vmware plugin (see comments within the files ...) (diff) | |
download | core-e9a412d928a2077ce2e72c86f7b637257b999fd2.tar.gz core-e9a412d928a2077ce2e72c86f7b637257b999fd2.tar.xz core-e9a412d928a2077ce2e72c86f7b637257b999fd2.zip |
Fixed some obvious bugs ... (see #154 for discussion too)
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@1638 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rw-r--r-- | os-plugins/plugins/vmware/XX_vmware.sh | 30 | ||||
-rwxr-xr-x | os-plugins/plugins/vmware/files/vmware-startscript | 12 |
2 files changed, 24 insertions, 18 deletions
diff --git a/os-plugins/plugins/vmware/XX_vmware.sh b/os-plugins/plugins/vmware/XX_vmware.sh index 342718d4..47697c4d 100644 --- a/os-plugins/plugins/vmware/XX_vmware.sh +++ b/os-plugins/plugins/vmware/XX_vmware.sh @@ -42,23 +42,30 @@ if [ -e /initramfs/plugin-conf/vmware.conf ]; then # prepare all needed vmware configuration files testmkd /mnt/etc/vmware # write the /etc/vmware/slxvmconfig file - # check for the several variables and write the several files + # check for the several variables and write the several files: + # dhcpd.conf for vmnet* interfaces + # nat.conf for the NAT configuration of vmnet8 + # TODO: vmnet-natd-8.mac not clear if really needed and which mac it + # should contain (seems to be an average one) echo -e "# configuration file for vmware background services written in \ stage3 setup" > /mnt/etc/vmware/slxvmconfig - if [ "bridge" = 1 ] ; then + if [ "$vmware_bridge" = 1 ] ; then echo "vmnet0=true" >> /mnt/etc/vmware/slxvmconfig fi - # write the common dhcpd.conf header - if [ -n "vmnet1" -o -n "vmnet8" ] ; then - local dnslist= + # write the common dhcpd.conf header for vmnet1,8 + if [ -n "$vmware_vmnet1" -o -n "$vmware_vmnet8" ] ; then + # use the dns servers know to the vmware host + # TODO: to be checked!! + local dnslist=$(echo "$domain_name_servers"|sed "s/ /,/g") echo "# /etc/vmware/dhcpd.conf written in stage3 ...\nallow \ unknown-clients;\ndefault-lease-time 1800;\nmax-lease-time 7200;\n\ option domain-name-servers $dnslist;\noption domain-name \"vm.local\";" \ > /mnt/etc/vmware/dhcpd.conf fi - if [ -n "vmnet1" ] ; then - local vmnt=${vmnet1%,*} - vmnet1=${vmnet%,*} + # variable might contain ",NAT" which is to be taken off + if [ -n "$vmware_vmnet1" ] ; then + local vmnt=${vmware_vmnet1%,*} + local vmnet1=${vmware_vmnet%,*} local vmip=${vmnet1%/*} local vmpx=${vmnet1#*/} echo "vmnet1=$vmip/$vmpx" >> /mnt/etc/vmware/slxvmconfig @@ -68,9 +75,10 @@ $(ipcalc -n $vmip/$vmpx|sed s/.*=//) {\n\trange $rstart $rend;\n\ \toption broadcast $(ipcalc -b $vmip/$vmpx|sed s/.*=//);\n\ \toption routers $vmip;\n}" > /mnt/etc/vmware/dhcpd.conf fi - if [ -n "vmnet8" ] ; then - local vmip=${vmnet8%/*} - local vmpx=${vmnet8#*/} + # vmware nat interface + if [ -n "$vmware_vmnet8" ] ; then + local vmip=${vmware_vmnet8%/*} + local vmpx=${vmware_vmnet8#*/} echo "vmnet8=$vmip/$vmpx" >> /mnt/etc/vmware/slxvmconfig echo "\nsubnet $(ipcalc -n $vmip/$vmpx|sed s/.*=//) netmask \ $(ipcalc -n $vmip/$vmpx|sed s/.*=//) {\n\trange $rstart $rend;\n\ diff --git a/os-plugins/plugins/vmware/files/vmware-startscript b/os-plugins/plugins/vmware/files/vmware-startscript index c6b22ee6..d41230ca 100755 --- a/os-plugins/plugins/vmware/files/vmware-startscript +++ b/os-plugins/plugins/vmware/files/vmware-startscript @@ -29,11 +29,8 @@ # read the configuration file generated in stage3 to configure the # host internal interfaces -#. /etc/vmware/slxvmconfig -# testing only -vmnet0="" -vmnet1="192.168.101.1/24" -vmnet8="" +. /etc/vmware/slxvmconfig + load_modules() { # to be filled in via the stage1 configuration script @@ -42,8 +39,9 @@ load_modules() { #modprobe vm... } unload_modules() { - # to be filled in via the stage1 configuration script - rmmod vmmon vmblock vmnet #2>/dev/null + # to be filled with the proper list within via the stage1 configuration + # script + rmmod vmmon vmblock vmnet 2>/dev/null } # the bridged interface setup_vmnet0() { |