Make the startup script read ${PREFIX}/etc/vmware/config so people do

not have discrepant configurations between them.
This commit is contained in:
Akinori MUSHA 2000-11-02 12:20:26 +00:00
parent 44981116e3
commit a4dab13de1
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=34630
4 changed files with 54 additions and 16 deletions

View file

@ -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};' \

View file

@ -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

View file

@ -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};' \

View file

@ -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