diff options
author | Akinori MUSHA <knu@FreeBSD.org> | 2000-11-02 12:20:26 +0000 |
---|---|---|
committer | Akinori MUSHA <knu@FreeBSD.org> | 2000-11-02 12:20:26 +0000 |
commit | a4dab13de1204a5db3462c365f126e6f2d8d5785 (patch) | |
tree | 464ae7970e74df215db735179454aa6a94678690 /emulators | |
parent | Change the default kernel name assumed by this port from "/vmunix" to (diff) |
Make the startup script read ${PREFIX}/etc/vmware/config so people do
not have discrepant configurations between them.
Diffstat (limited to 'emulators')
-rw-r--r-- | emulators/vmware2/Makefile | 4 | ||||
-rw-r--r-- | emulators/vmware2/files/vmware.sh | 31 | ||||
-rw-r--r-- | emulators/vmware3/Makefile | 4 | ||||
-rw-r--r-- | emulators/vmware3/files/vmware.sh | 31 |
4 files changed, 54 insertions, 16 deletions
diff --git a/emulators/vmware2/Makefile b/emulators/vmware2/Makefile index 4453cdcb5bff..8845a6697e25 100644 --- a/emulators/vmware2/Makefile +++ b/emulators/vmware2/Makefile @@ -8,7 +8,7 @@ PORTNAME= vmware2 PORTVERSION= 2.0.2.621 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= emulators linux MASTER_SITES= http://www4.vmware.com/software/ \ http://vmware-svca.www.conxion.com/software/ \ @@ -84,8 +84,6 @@ setoptions: ${SED} -e 's;@@PREFIX@@;${PREFIX};' \ -e 's;@@LINUXBASE@@;${LINUXBASE};' \ -e 's;@@NETWORKING@@;${VMNET_NETWORKING};' \ - -e 's;@@HOST_IP@@;${VMNET_HOST_IP};' \ - -e 's;@@NETMASK@@;${VMNET_NETMASK};' \ ${FILESDIR}/vmware.sh > ${WRKDIR}/vmware.sh ${SED} -e 's;@@PREFIX@@;${PREFIX};' \ diff --git a/emulators/vmware2/files/vmware.sh b/emulators/vmware2/files/vmware.sh index fe19977b293c..ee6db6d0d76b 100644 --- a/emulators/vmware2/files/vmware.sh +++ b/emulators/vmware2/files/vmware.sh @@ -4,13 +4,34 @@ # # $FreeBSD$ -vmware_dir=@@PREFIX@@/lib/vmware +vmware_config_file=@@PREFIX@@/etc/vmware/config + +if [ ! -e $vmware_config_file ]; then + echo "$vmware_config_file does not exist!" >&2 + exit 255 +fi + +vmware_config() { + cat $vmware_config_file | while read var eq value; do + if [ "$1" = "$var" ]; then + ret=`expr "$value" : '"\(.*\)"$'` + echo ${ret:-$value} + break + fi + done +} + +vmware=`vmware_config vmware.fullpath` +vmware_libdir=`vmware_config libdir` networking=@@NETWORKING@@ -host_ip=@@HOST_IP@@ -netmask=@@NETMASK@@ +host_ip=`vmware_config vmnet1.HostOnlyAddress` +netmask=`vmware_config vmnet1.HostOnlyNetMask` dev_vmnet1=@@LINUXBASE@@/dev/vmnet1 -[ -x $vmware_dir/bin/vmware ] || exit +if [ ! -x $vmware ]; then + echo "$vmware does not exist!" >&2 + exit 255 +fi if [ `sysctl -n hw.ncpu` -eq 1 ]; then suffix=up @@ -22,7 +43,7 @@ exec >/dev/null case $1 in start) - kldload ${vmware_dir}/lib/modules/vmmon_${suffix}.ko + kldload ${vmware_libdir}/modules/vmmon_${suffix}.ko if [ $networking -eq 1 ]; then sysctl net.link.ether.bridge_refresh && bridge="_bridge" kldload if_tap.ko diff --git a/emulators/vmware3/Makefile b/emulators/vmware3/Makefile index 4453cdcb5bff..8845a6697e25 100644 --- a/emulators/vmware3/Makefile +++ b/emulators/vmware3/Makefile @@ -8,7 +8,7 @@ PORTNAME= vmware2 PORTVERSION= 2.0.2.621 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= emulators linux MASTER_SITES= http://www4.vmware.com/software/ \ http://vmware-svca.www.conxion.com/software/ \ @@ -84,8 +84,6 @@ setoptions: ${SED} -e 's;@@PREFIX@@;${PREFIX};' \ -e 's;@@LINUXBASE@@;${LINUXBASE};' \ -e 's;@@NETWORKING@@;${VMNET_NETWORKING};' \ - -e 's;@@HOST_IP@@;${VMNET_HOST_IP};' \ - -e 's;@@NETMASK@@;${VMNET_NETMASK};' \ ${FILESDIR}/vmware.sh > ${WRKDIR}/vmware.sh ${SED} -e 's;@@PREFIX@@;${PREFIX};' \ diff --git a/emulators/vmware3/files/vmware.sh b/emulators/vmware3/files/vmware.sh index fe19977b293c..ee6db6d0d76b 100644 --- a/emulators/vmware3/files/vmware.sh +++ b/emulators/vmware3/files/vmware.sh @@ -4,13 +4,34 @@ # # $FreeBSD$ -vmware_dir=@@PREFIX@@/lib/vmware +vmware_config_file=@@PREFIX@@/etc/vmware/config + +if [ ! -e $vmware_config_file ]; then + echo "$vmware_config_file does not exist!" >&2 + exit 255 +fi + +vmware_config() { + cat $vmware_config_file | while read var eq value; do + if [ "$1" = "$var" ]; then + ret=`expr "$value" : '"\(.*\)"$'` + echo ${ret:-$value} + break + fi + done +} + +vmware=`vmware_config vmware.fullpath` +vmware_libdir=`vmware_config libdir` networking=@@NETWORKING@@ -host_ip=@@HOST_IP@@ -netmask=@@NETMASK@@ +host_ip=`vmware_config vmnet1.HostOnlyAddress` +netmask=`vmware_config vmnet1.HostOnlyNetMask` dev_vmnet1=@@LINUXBASE@@/dev/vmnet1 -[ -x $vmware_dir/bin/vmware ] || exit +if [ ! -x $vmware ]; then + echo "$vmware does not exist!" >&2 + exit 255 +fi if [ `sysctl -n hw.ncpu` -eq 1 ]; then suffix=up @@ -22,7 +43,7 @@ exec >/dev/null case $1 in start) - kldload ${vmware_dir}/lib/modules/vmmon_${suffix}.ko + kldload ${vmware_libdir}/modules/vmmon_${suffix}.ko if [ $networking -eq 1 ]; then sysctl net.link.ether.bridge_refresh && bridge="_bridge" kldload if_tap.ko |