diff options
author | knu <knu@FreeBSD.org> | 2000-11-02 20:20:26 +0800 |
---|---|---|
committer | knu <knu@FreeBSD.org> | 2000-11-02 20:20:26 +0800 |
commit | e88b047958b6f8b1b2d13282db654f28e81ee675 (patch) | |
tree | 785ae55f30b075833233f95d3c7e89d00d7a6b5b /emulators/vmware2 | |
parent | d1f3d14973f2555c54250d5cb834b8dc8510a1df (diff) | |
download | freebsd-ports-gnome-e88b047958b6f8b1b2d13282db654f28e81ee675.tar.gz freebsd-ports-gnome-e88b047958b6f8b1b2d13282db654f28e81ee675.tar.zst freebsd-ports-gnome-e88b047958b6f8b1b2d13282db654f28e81ee675.zip |
Make the startup script read ${PREFIX}/etc/vmware/config so people do
not have discrepant configurations between them.
Diffstat (limited to 'emulators/vmware2')
-rw-r--r-- | emulators/vmware2/Makefile | 4 | ||||
-rw-r--r-- | emulators/vmware2/files/vmware.sh | 31 |
2 files changed, 27 insertions, 8 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 |