]> git.pld-linux.org Git - packages/VMware-workstation.git/commitdiff
- Switched to plain config file - 'locations' file is no longer needed
authoradgor <adgor@pld-linux.org>
Mon, 5 Apr 2004 20:10:02 +0000 (20:10 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    VMware-workstation-vmnet.conf -> 1.1
    VMware-workstation.init -> 1.8

VMware-workstation-vmnet.conf [new file with mode: 0644]
VMware-workstation.init

diff --git a/VMware-workstation-vmnet.conf b/VMware-workstation-vmnet.conf
new file mode 100644 (file)
index 0000000..739b2a8
--- /dev/null
@@ -0,0 +1,19 @@
+#
+# Configuration file for VMware Workstation networking 
+#
+
+# vmnet binaries location
+VMNET_BINDIR=/usr/bin
+
+# Wanna VMware Workstation networking?
+VM_NETWORKING=yes
+
+# Bridged networking on /dev/vmnet0 - sufficient in most cases
+VNET_0_INTERFACE=eth0
+
+# Host-only networking on /dev/vmnet2 - samba subpackage needed
+#VNET_1_HOSTONLY_HOSTADDR=192.168.23.1
+#VNET_1_HOSTONLY_NETMASK=255.255.255.0
+
+# NAT networking on /dev/vmnet1
+#VNET_2_NAT=yes
index ba39969c66921b360831e9b48c87098c0c58888b..c252ae507c5639ec75914d97a68ede74c91df93d 100755 (executable)
@@ -25,10 +25,12 @@ smbd=vmware-smbd
 nmbd=vmware-nmbd
 
 vmware_etc_dir=/etc/vmware
-vmware_db="$vmware_etc_dir"/locations
-if [ ! -r "$vmware_db" ]; then
+vmnet_cfg="$vmware_etc_dir"/vmnet.conf
+if [ -r "$vmnet_cfg" ]; then
+       . "$vmnet_cfg"
+else   
        echo "Warning: Unable to find VMware Workstation's main database"
-       echo "($vmware_db)."
+       echo "($vmnet_cfg)."
        echo        
        exit 1
 fi
@@ -86,77 +88,6 @@ make_tmp_dir() {
        eval "$dirname"'="$tmp"'"'"'/'"'"'"$prefix$serial"'
 }
 
-#
-# Manage an installer database
-#
-
-# Add an answer to a database in memory
-db_answer_add() {
-       local dbvar="$1" # IN/OUT
-       local id="$2"    # IN
-       local value="$3" # IN
-       local answers
-       local i
-
-       eval "$dbvar"'_answer_'"$id"'="$value"'
-       eval 'answers="$'"$dbvar"'_answers"'
-       # There is no double quote around $answers on purpose
-       for i in $answers; do
-               if [ "$i" = "$id" ]; then
-                       return
-               fi
-       done
-       answers="$answers"' '"$id"
-       eval "$dbvar"'_answers="$answers"'
-}
-
-# Remove an answer from a database in memory
-db_answer_remove() {
-       local dbvar="$1" # IN/OUT
-       local id="$2"    # IN
-       local new_answers
-       local answers
-       local i
-
-       eval 'unset '"$dbvar"'_answer_'"$id"
-        new_answers=''
-       eval 'answers="$'"$dbvar"'_answers"'
-       # There is no double quote around $answers on purpose
-       for i in $answers; do
-               if [ "$i" != "$id" ]; then
-               new_answers="$new_answers"' '"$i"
-               fi
-       done
-       eval "$dbvar"'_answers="$new_answers"'
-}
-
-# Load all answers from a database on stdin to memory (<dbvar>_answer_*
-# variables)
-db_load_from_stdin() {
-       local dbvar="$1" # OUT
-
-       eval "$dbvar"'_answers=""'
-       # read doesn't support -r on FreeBSD 3.x.
-       # For this reason, the folowing line is patched to remove the -r in case of 
-       # Free BSD tools build. Please look at
-       # bora-vmsoft/install/FreeBSD/tools-tar.make before making drastic changes to
-       # the folowing line.
-       # -- Jeremy Bar
-       while read -r action p1 p2; do
-               if [ "$action" = 'answer' ]; then
-                       db_answer_add "$dbvar" "$p1" "$p2"
-               elif [ "$action" = 'remove_answer' ]; then
-                       db_answer_remove "$dbvar" "$p1"
-               fi
-       done
-}
-
-#
-# Load database
-#
-
-db_load_from_stdin "vmdb" < "$vmware_db"
-
 #
 # Utilities
 #
@@ -281,13 +212,13 @@ vmware_start_hostonly() {
        # XXX ping takes 10 seconds to timeout if nobody answers
        #     that slows boot too much so we do this bit in the
        #     background.
-       if "$vmdb_answer_BINDIR"/"$ping" -q "$ifIp"; then
+       if "$VMNET_BINDIR"/"$ping" -q "$ifIp"; then
                echo 'Host-only networking disabled because '"$ifIp"
                echo 'appears to be a real, physical, existing address.'
                echo 'Please modify your host-only network configuration.'
                exit 1
        fi
-       cd "$vmdb_answer_BINDIR" && "$vmdb_answer_BINDIR"/"$netifup" \
+       cd "$VMNET_BINDIR" && "$VMNET_BINDIR"/"$netifup" \
        -d /var/run/"$netifup"-"$vHostIf".pid /dev/vmnet"$vHubNr" "$vHostIf"
        [ "$?" -eq 0 ] || exit 1
        # Configure the virtual host ethernet interface and define the private IP
@@ -309,7 +240,7 @@ vmware_start_hostonly() {
                        # Start a DHCP server on a private IP network
                        # The daemon already logs its output in the system log, so we can safely
                        # trash it
-                       cd "$vmdb_answer_BINDIR" && "$vmdb_answer_BINDIR"/"$dhcpd" \
+                       cd "$VMNET_BINDIR" && "$VMNET_BINDIR"/"$dhcpd" \
                        -cf "$vmware_etc_dir"/"$vHostIf"/dhcpd/dhcpd.conf \
                        -lf "$vmware_etc_dir"/"$vHostIf"/dhcpd/dhcpd.leases \
                        -pf /var/run/"$dhcpd"-"$vHostIf".pid "$vHostIf" >/dev/null 2>&1 || exit 1
@@ -317,12 +248,12 @@ vmware_start_hostonly() {
                if [ "$run_samba" = 'yes' ]; then
                        # Start a SMB name server on a private IP network
                        # Disable logging to avoid the uncontrolled creation of unmanaged files
-                       cd "$vmdb_answer_BINDIR" && "$vmdb_answer_BINDIR"/"$nmbd" -D -l /dev/null \
+                       cd "$VMNET_BINDIR" && "$VMNET_BINDIR"/"$nmbd" -D -l /dev/null \
                        -s "$vmware_etc_dir"/"$vHostIf"/smb/smb.conf \
                        -f /var/run/"$nmbd"-"$vHostIf".pid || exit 1
                        # Start a SMB share server on a private IP network
                        # Disable logging to avoid the uncontrolled creation of unmanaged files
-                       cd "$vmdb_answer_BINDIR" && "$vmdb_answer_BINDIR"/"$smbd" -D -l /dev/null \
+                       cd "$VMNET_BINDIR" && "$VMNET_BINDIR"/"$smbd" -D -l /dev/null \
                        -s "$vmware_etc_dir"/"$vHostIf"/smb/smb.conf \
                        -f /var/run/"$smbd"-"$vHostIf".pid || exit 1
                fi
@@ -352,11 +283,15 @@ vmware_stop_hostonly() {
 # See how we were called.
 case "$1" in
   start)
+       if [ -f /var/lock/subsys/"$subsys" ]; then
+               msg_already_running "VMware Workstation networking"
+               exit 1
+       fi      
         exitcode='0'
        # Try to load parport_pc. Failure is allowed as it does not exist
        # on kernels 2.0
        /sbin/modprobe parport_pc >/dev/null 2>&1
-       if [ "$vmdb_answer_NETWORKING" = 'yes' ]; then
+       if [ "$VM_NETWORKING" = 'yes' ]; then
                msg_starting 'Virtual ethernet'
                busy
                /sbin/modprobe $vnet
@@ -364,30 +299,31 @@ case "$1" in
                exitcode=`expr "$exitcode" + "$?"`
                vHubNr=0
                while [ $vHubNr -lt 256 ]; do
-                       eval 'interface="$vmdb_answer_VNET_'"$vHubNr"'_INTERFACE"'
-                       eval 'hostaddr="$vmdb_answer_VNET_'"$vHubNr"'_HOSTONLY_HOSTADDR"'
-                       eval 'netmask="$vmdb_answer_VNET_'"$vHubNr"'_HOSTONLY_NETMASK"'
+                       eval 'interface="$VNET_'"$vHubNr"'_INTERFACE"'
+                       eval 'hostaddr="$VNET_'"$vHubNr"'_HOSTONLY_HOSTADDR"'
+                       eval 'netmask="$VNET_'"$vHubNr"'_HOSTONLY_NETMASK"'
                        if [ -n "$interface" ]; then
                                # Connect a physical host ethernet interface to a virtual ethernet hub
                                msg_starting 'Bridged networking on /dev/vmnet'"$vHubNr"
                                busy
-                               cd "$vmdb_answer_BINDIR" && "$vmdb_answer_BINDIR"/"$bridge" \
+                               cd "$VMNET_BINDIR" && "$VMNET_BINDIR"/"$bridge" \
                                -d /var/run/"$bridge"-"$vHubNr".pid /dev/vmnet"$vHubNr" "$interface"
                                [ "$?" -eq 0 ] && ok || fail
                                exitcode=`expr "$exitcode" + "$?"`
                        elif [ -n "$hostaddr" -a -n "$netmask" ]; then
-                               eval 'samba="$vmdb_answer_VNET_'"$vHubNr"'_SAMBA"'
+                               eval 'samba="$VNET_'"$vHubNr"'_SAMBA"'
                                msg_starting 'Host-only networking on /dev/vmnet'"$vHubNr"
                                busy
-                               daemon vmware_start_hostonly "$vHubNr" 'vmnet'"$vHubNr" "$hostaddr" "$netmask" 'yes' "$samba"
+                               daemon vmware_start_hostonly "$vHubNr" 'vmnet'"$vHubNr" "$hostaddr" \
+                               "$netmask" 'yes' "$samba"
                                [ "$?" -eq 0 ] && ok || fail
                                exitcode=`expr "$exitcode" + "$?"`
-                               eval 'nat="$vmdb_answer_VNET_'"$vHubNr"'_NAT"'
+                               eval 'nat="$VNET_'"$vHubNr"'_NAT"'
                                if [ "$nat" = 'yes' ]; then
                                        # Start the NAT network user service
                                        msg_starting 'NAT networking on /dev/vmnet'"$vHubNr"
                                        busy
-                                       cd "$vmdb_answer_BINDIR" && "$vmdb_answer_BINDIR"/"$natd" \
+                                       cd "$VMNET_BINDIR" && "$VMNET_BINDIR"/"$natd" \
                                        -d /var/run/"$natd"-"$vHubNr".pid \
                                        -m /var/run/"$natd"-"$vHubNr".mac \
                                        -c "$vmware_etc_dir"/vmnet"$vHubNr"/nat/nat.conf
@@ -410,21 +346,24 @@ case "$1" in
                echo 'At least one instance of VMware Workstation is still running.'
                echo 'Please stop all running instances of VMware Workstation first.'
                echo
-               # The unconfigurator handle this exit code differently
-               exit 2
+               exit 1
        fi
+       if [ ! -f /var/lock/subsys/"$subsys" ]; then
+               msg_not_running "VMware Workstation networking"
+               exit 1
+       fi      
         exitcode='0'
        # Try to unload parport_pc. Failure is allowed as it does not exist
        # on kernels 2.0, and some other process could be using it.
        /sbin/modprobe -r parport_pc >/dev/null 2>&1
-       if [ "$vmdb_answer_NETWORKING" = "yes" ]; then
+       if [ "$VM_NETWORKING" = "yes" ]; then
                # NB: must kill off processes using vmnet before
                #     unloading module
                vHubNr=0
                while [ $vHubNr -lt 256 ]; do
-                       eval 'interface="$vmdb_answer_VNET_'"$vHubNr"'_INTERFACE"'
-                       eval 'hostaddr="$vmdb_answer_VNET_'"$vHubNr"'_HOSTONLY_HOSTADDR"'
-                       eval 'netmask="$vmdb_answer_VNET_'"$vHubNr"'_HOSTONLY_NETMASK"'
+                       eval 'interface="$VNET_'"$vHubNr"'_INTERFACE"'
+                       eval 'hostaddr="$VNET_'"$vHubNr"'_HOSTONLY_HOSTADDR"'
+                       eval 'netmask="$VNET_'"$vHubNr"'_HOSTONLY_NETMASK"'
                        if [ -n "$interface" ]; then
                                # Disconnect a physical host ethernet interface from a virtual ethernet hub
                                msg_stopping "Bridged networking on /dev/vmnet$vHubNr"
@@ -439,7 +378,7 @@ case "$1" in
                                vmware_stop_pidfile /var/run/"$dhcpd"-"vmnet$vHubNr".pid
                                [ "$?" -eq 0 ] && ok || fail
                                exitcode=`expr "$exitcode" + "$?"`
-                               eval 'samba="$vmdb_answer_VNET_'"$vHubNr"'_SAMBA"'
+                               eval 'samba="$VNET_'"$vHubNr"'_SAMBA"'
                                if [ "$samba" = "yes" ]; then
                                        # Stop a SMB share server on a private IP network
                                        msg_stopping 'SMB share server on /dev/vmnet'"$vHubNr"
@@ -454,7 +393,7 @@ case "$1" in
                                        [ "$?" -eq 0 ] && ok || fail
                                        exitcode=`expr "$exitcode" + "$?"`
                                fi
-                               eval 'nat="$vmdb_answer_VNET_'"$vHubNr"'_NAT"'
+                               eval 'nat="$VNET_'"$vHubNr"'_NAT"'
                                        if [ "$nat" = "yes" ]; then
                                                # Stop the NAT network user service
                                                msg_stopping 'NAT networking on /dev/vmnet'"$vHubNr"
@@ -488,12 +427,12 @@ case "$1" in
                echo 'At least one instance of VMware Workstation is still running.'
                echo
        fi
-       if [ "$vmdb_answer_NETWORKING" = "yes" ]; then
+       if [ "$VM_NETWORKING" = "yes" ]; then
                status "$bridge"
                status "$dhcpd"
                status "$netifup"
         fi
-       if [ "$vmdb_answer_NETWORKING" = "yes" ]; then
+       if [ "$VM_NETWORKING" = "yes" ]; then
                echo -n "Module $vnet "
                /sbin/modprobe "$vnet" >/dev/null 2>&1 && echo installed || echo "not installed"
         fi
This page took 0.088793 seconds and 4 git commands to generate.