Changeset 9096 in vbox
- Timestamp:
- May 25, 2008 9:35:33 PM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/installer/vboxadd-timesync.sh
r8178 r9096 26 26 # Required-Start: vboxadd 27 27 # Required-Stop: vboxadd 28 # Default-Start: 3529 # Default-Stop: 28 # Default-Start: 2 3 4 5 29 # Default-Stop: 0 1 6 30 30 # Description: VirtualBox Additions timesync 31 31 ### END INIT INFO … … 33 33 PATH=$PATH:/bin:/sbin:/usr/sbin 34 34 35 system=unknown 35 [ -f /lib/lsb/init-functions ] || NOLSB=yes 36 36 37 if [ -f /etc/redhat-release ]; then 37 38 system=redhat 38 PIDFILE="/var/lock/subsys/vboxadd-timesync"39 39 elif [ -f /etc/SuSE-release ]; then 40 40 system=suse 41 PIDFILE="/var/lock/subsys/vboxadd-timesync"42 41 elif [ -f /etc/debian_version ]; then 43 42 system=debian 44 PIDFILE="/var/run/vboxadd-timesync"45 43 elif [ -f /etc/gentoo-release ]; then 46 44 system=gentoo 45 fi 46 47 if [ -z "$NOLSB" ]; then 48 . /lib/lsb/init-functions 49 fail_msg() { 50 echo "" 51 log_failure_msg "$1" 52 } 53 succ_msg() { 54 log_end_msg 0 55 } 56 begin_msg() { 57 log_daemon_msg "$@" 58 } 59 else 60 if [ "$system" = "redhat" ]; then 61 . /etc/init.d/functions 62 fail_msg() { 63 echo -n " " 64 echo_failure 65 echo 66 echo " ($1)" 67 } 68 succ_msg() { 69 echo -n " " 70 echo_success 71 echo 72 } 73 elif [ "$system" = "suse" ]; then 74 . /etc/rc.status 75 fail_msg() { 76 rc_failed 1 77 rc_status -v 78 echo " ($1)" 79 } 80 succ_msg() { 81 rc_reset 82 rc_status -v 83 } 84 elif [ "$system" = "gentoo" ]; then 85 . /sbin/functions.sh 86 fail_msg() { 87 eerror "$1" 88 } 89 succ_msg() { 90 eend "$?" 91 } 92 begin_msg() { 93 ebegin "$1" 94 } 95 if [ "`which $0`" = "/sbin/rc" ]; then 96 shift 97 fi 98 else 99 fail_msg() { 100 echo " ...failed!" 101 echo " ($1)" 102 } 103 succ_msg() { 104 echo " ...done." 105 } 106 fi 107 if [ "$system" != "gentoo" ]; then 108 begin_msg() { 109 [ -z "${1:-}" ] && return 1 110 if [ -z "${2:-}" ]; then 111 echo -n "$1" 112 else 113 echo -n "$1: $2" 114 fi 115 } 116 fi 117 fi 118 119 if [ "$system" = "redhat" ]; then 120 PIDFILE="/var/lock/subsys/vboxadd-timesync" 121 elif [ "$system" = "suse" ]; then 122 PIDFILE="/var/lock/subsys/vboxadd-timesync" 123 daemon() { 124 startproc ${1+"$@"} 125 } 126 elif [ "$system" = "debian" ]; then 47 127 PIDFILE="/var/run/vboxadd-timesync" 128 daemon() { 129 start-stop-daemon --start --exec $1 -- $2 130 } 131 killproc() { 132 start-stop-daemon --stop --exec $@ 133 } 134 elif [ "$system" = "gentoo" ]; then 135 PIDFILE="/var/run/vboxadd-timesync" 136 daemon() { 137 start-stop-daemon --start --exec $1 -- $2 138 } 139 killproc() { 140 start-stop-daemon --stop --exec $@ 141 } 48 142 else 49 system=other50 143 if [ -d /var/run -a -w /var/run ]; then 51 144 PIDFILE="/var/run/vboxadd-timesync" 52 145 fi 53 fi54 55 if [ "$system" = "redhat" ]; then56 . /etc/init.d/functions57 fail_msg() {58 echo_failure59 echo60 }61 62 succ_msg() {63 echo_success64 echo65 }66 fi67 68 if [ "$system" = "suse" ]; then69 . /etc/rc.status70 daemon() {71 startproc ${1+"$@"}72 }73 74 fail_msg() {75 rc_failed 176 rc_status -v77 }78 79 succ_msg() {80 rc_reset81 rc_status -v82 }83 fi84 85 if [ "$system" = "debian" ]; then86 daemon() {87 start-stop-daemon --start --exec $1 -- $288 }89 90 killproc() {91 start-stop-daemon --stop --exec $@92 }93 94 fail_msg() {95 echo " ...fail!"96 }97 98 succ_msg() {99 echo " ...done."100 }101 fi102 103 if [ "$system" = "gentoo" ]; then104 . /sbin/functions.sh105 daemon() {106 start-stop-daemon --start --exec $1 -- $2107 }108 109 killproc() {110 start-stop-daemon --stop --exec $@111 }112 113 fail_msg() {114 echo " ...fail!"115 }116 117 succ_msg() {118 echo " ...done."119 }120 121 if [ "`which $0`" = "/sbin/rc" ]; then122 shift123 fi124 fi125 126 if [ "$system" = "other" ]; then127 fail_msg() {128 echo " ...fail!"129 }130 131 succ_msg() {132 echo " ...done."133 }134 135 begin() {136 echo -n "$1"137 }138 146 fi 139 147 … … 151 159 start() { 152 160 if ! test -f $PIDFILE; then 153 echo -n "Starting VirtualBox host to guest time synchronisation";161 begin_msg "Starting VirtualBox host to guest time synchronisation"; 154 162 vboxaddrunning || { 155 echo "VirtualBox Additions module not loaded!" 156 exit 1 163 failure "VirtualBox Additions module not loaded!" 157 164 } 158 165 daemon $binary --daemonize … … 166 173 stop() { 167 174 if test -f $PIDFILE; then 168 echo -n"Stopping VirtualBox host to guest time synchronisation ";175 begin_msg "Stopping VirtualBox host to guest time synchronisation "; 169 176 vboxaddrunning || { 170 echo "VirtualBox Additions module not loaded!" 171 exit 1 177 failure "VirtualBox Additions module not loaded!" 172 178 } 173 179 killproc $binary -
trunk/src/VBox/Additions/linux/installer/vboxadd.sh
r8713 r9096 33 33 PATH=$PATH:/bin:/sbin:/usr/sbin 34 34 35 if [ -f /etc/redhat-release ]; then 36 system=redhat 37 elif [ -f /etc/SuSE-release ]; then 38 system=suse 39 elif [ -f /etc/gentoo-release ]; then 40 system=gentoo 35 [ -f /lib/lsb/init-functions ] || NOLSB=yes 36 37 if [ -n "$NOLSB" ]; then 38 if [ -f /etc/redhat-release ]; then 39 system=redhat 40 elif [ -f /etc/SuSE-release ]; then 41 system=suse 42 elif [ -f /etc/gentoo-release ]; then 43 system=gentoo 44 fi 45 fi 46 47 if [ -z "$NOLSB" ]; then 48 . /lib/lsb/init-functions 49 fail_msg() { 50 echo "" 51 log_failure_msg "$1" 52 } 53 succ_msg() { 54 log_end_msg 0 55 } 56 begin_msg() { 57 log_daemon_msg "$@" 58 } 41 59 else 42 system=other 43 fi 44 45 if [ "$system" = "redhat" ]; then 46 . /etc/init.d/functions 47 fail_msg() { 48 echo_failure 49 echo 50 } 51 52 succ_msg() { 53 echo_success 54 echo 55 } 56 57 begin() { 58 echo -n "$1" 59 } 60 fi 61 62 if [ "$system" = "suse" ]; then 63 . /etc/rc.status 64 fail_msg() { 65 rc_failed 1 66 rc_status -v 67 } 68 69 succ_msg() { 70 rc_reset 71 rc_status -v 72 } 73 74 begin() { 75 echo -n "$1" 76 } 77 fi 78 79 if [ "$system" = "gentoo" ]; then 80 . /sbin/functions.sh 81 fail_msg() { 82 eend 1 83 } 84 85 succ_msg() { 86 eend $? 87 } 88 89 begin() { 90 ebegin $1 91 } 92 93 if [ "`which $0`" = "/sbin/rc" ]; then 94 shift 95 fi 96 fi 97 98 if [ "$system" = "other" ]; then 99 fail_msg() { 100 echo " ...fail!" 101 } 102 103 succ_msg() { 104 echo " ...done." 105 } 106 107 begin() { 108 echo -n $1 109 } 60 if [ "$system" = "redhat" ]; then 61 . /etc/init.d/functions 62 fail_msg() { 63 echo -n " " 64 echo_failure 65 echo 66 echo " ($1)" 67 } 68 succ_msg() { 69 echo -n " " 70 echo_success 71 echo 72 } 73 elif [ "$system" = "suse" ]; then 74 . /etc/rc.status 75 fail_msg() { 76 rc_failed 1 77 rc_status -v 78 echo " ($1)" 79 } 80 succ_msg() { 81 rc_reset 82 rc_status -v 83 } 84 elif [ "$system" = "gentoo" ]; then 85 . /sbin/functions.sh 86 fail_msg() { 87 eerror "$1" 88 } 89 succ_msg() { 90 eend "$?" 91 } 92 begin_msg() { 93 ebegin "$1" 94 } 95 if [ "`which $0`" = "/sbin/rc" ]; then 96 shift 97 fi 98 else 99 fail_msg() { 100 echo " ...failed!" 101 echo " ($1)" 102 } 103 succ_msg() { 104 echo " ...done." 105 } 106 fi 107 if [ "$system" != "gentoo" ]; then 108 begin_msg() { 109 [ -z "${1:-}" ] && return 1 110 if [ -z "${2:-}" ]; then 111 echo -n "$1" 112 else 113 echo -n "$1: $2" 114 fi 115 } 116 fi 110 117 fi 111 118 … … 117 124 group=1 118 125 119 fail() { 120 if [ "$system" = "gentoo" ]; then 121 eerror $1 122 exit 1 123 fi 124 fail_msg 125 echo "($1)" 126 failure() 127 { 128 fail_msg "$1" 126 129 exit 1 127 130 } … … 132 135 133 136 start() { 134 begin "Starting VirtualBox Additions ";137 begin_msg "Starting VirtualBox Additions "; 135 138 running || { 136 139 rm -f $dev || { 137 fail "Cannot remove $dev"140 failure "Cannot remove $dev" 138 141 } 139 142 140 143 modprobe $modname || { 141 fail "modprobe $modname failed"144 failure "modprobe $modname failed" 142 145 } 143 146 … … 156 159 test -z "$maj" && { 157 160 rmmod $modname 158 fail "Cannot locate the VirtualBox device"161 failure "Cannot locate the VirtualBox device" 159 162 } 160 163 161 164 mknod -m 0664 $dev c $maj $min || { 162 165 rmmod $modname 163 fail "Cannot create device $dev with major $maj and minor $min"166 failure "Cannot create device $dev with major $maj and minor $min" 164 167 } 165 168 fi … … 167 170 chown $owner:$group $dev 2>/dev/null || { 168 171 rmmod $modname 2>/dev/null 169 fail "Cannot change owner $owner:$group for device $dev"172 failure "Cannot change owner $owner:$group for device $dev" 170 173 } 171 174 … … 175 178 176 179 stop() { 177 begin "Stopping VirtualBox Additions ";180 begin_msg "Stopping VirtualBox Additions "; 178 181 if running; then 179 rmmod $modname || fail "Cannot unload module $modname"180 rm -f $dev || fail "Cannot unlink $dev"182 rmmod $modname || failure "Cannot unload module $modname" 183 rm -f $dev || failure "Cannot unlink $dev" 181 184 fi 182 185 succ_msg -
trunk/src/VBox/Additions/linux/installer/vboxvfs.sh
r8713 r9096 33 33 PATH=$PATH:/bin:/sbin:/usr/sbin 34 34 35 if [ -f /etc/redhat-release ]; then 36 system=redhat 37 elif [ -f /etc/SuSE-release ]; then 38 system=suse 39 elif [ -f /etc/gentoo-release ]; then 40 system=gentoo 41 else 42 system=other 43 fi 35 [ -f /lib/lsb/init-functions ] || NOLSB=yes 44 36 45 if [ "$system" = "redhat" ]; then 46 . /etc/init.d/functions 47 fail_msg() { 48 echo_failure 49 echo 50 } 51 52 succ_msg() { 53 echo_success 54 echo 55 } 56 57 begin() { 58 echo -n "$1" 59 } 60 fi 61 62 if [ "$system" = "suse" ]; then 63 . /etc/rc.status 64 fail_msg() { 65 rc_failed 1 66 rc_status -v 67 } 68 69 succ_msg() { 70 rc_reset 71 rc_status -v 72 } 73 74 begin() { 75 echo -n "$1" 76 } 77 fi 78 79 if [ "$system" = "gentoo" ]; then 80 . /sbin/functions.sh 81 fail_msg() { 82 eend 1 83 } 84 85 succ_msg() { 86 eend $? 87 } 88 89 begin() { 90 ebegin $1 91 } 92 93 if [ "`which $0`" = "/sbin/rc" ]; then 94 shift 37 if [ -n "$NOLSB" ]; then 38 if [ -f /etc/redhat-release ]; then 39 system=redhat 40 elif [ -f /etc/SuSE-release ]; then 41 system=suse 42 elif [ -f /etc/gentoo-release ]; then 43 system=gentoo 95 44 fi 96 45 fi 97 46 98 if [ "$system" = "other" ]; then 47 if [ -z "$NOLSB" ]; then 48 . /lib/lsb/init-functions 99 49 fail_msg() { 100 echo " ...fail!" 50 echo "" 51 log_failure_msg "$1" 101 52 } 102 103 53 succ_msg() { 104 echo " ...done."54 log_end_msg 0 105 55 } 106 107 begin() { 108 echo -n $1 56 begin_msg() { 57 log_daemon_msg "$@" 109 58 } 59 else 60 if [ "$system" = "redhat" ]; then 61 . /etc/init.d/functions 62 fail_msg() { 63 echo -n " " 64 echo_failure 65 echo 66 echo " ($1)" 67 } 68 succ_msg() { 69 echo -n " " 70 echo_success 71 echo 72 } 73 elif [ "$system" = "suse" ]; then 74 . /etc/rc.status 75 fail_msg() { 76 rc_failed 1 77 rc_status -v 78 echo " ($1)" 79 } 80 succ_msg() { 81 rc_reset 82 rc_status -v 83 } 84 elif [ "$system" = "gentoo" ]; then 85 . /sbin/functions.sh 86 fail_msg() { 87 eerror "$1" 88 } 89 succ_msg() { 90 eend "$?" 91 } 92 begin_msg() { 93 ebegin "$1" 94 } 95 if [ "`which $0`" = "/sbin/rc" ]; then 96 shift 97 fi 98 else 99 fail_msg() { 100 echo " ...failed!" 101 echo " ($1)" 102 } 103 succ_msg() { 104 echo " ...done." 105 } 106 fi 107 if [ "$system" != "gentoo" ]; then 108 begin_msg() { 109 [ -z "${1:-}" ] && return 1 110 if [ -z "${2:-}" ]; then 111 echo -n "$1" 112 else 113 echo -n "$1: $2" 114 fi 115 } 116 fi 110 117 fi 111 118 … … 114 121 module="$kdir/$modname" 115 122 116 fail() { 117 if [ "$system" = "gentoo" ]; then 118 eerror $1 119 exit 1 120 fi 121 fail_msg 122 echo "($1)" 123 failure() 124 { 125 fail_msg "$1" 123 126 exit 1 124 127 } … … 129 132 130 133 start() { 131 begin "Starting VirtualBox Additions shared folder support";134 begin_msg "Starting VirtualBox Additions shared folder support"; 132 135 running || { 133 136 modprobe $modname > /dev/null 2>&1 || { 134 137 if dmesg | grep "vboxConnect failed" > /dev/null 2>&1; then 135 fail_msg 138 fail_msg "modprobe $modname failed" 136 139 echo "You may be trying to run Guest Additions from binary release of VirtualBox" 137 140 echo "in the Open Source Edition." 138 141 exit 1 139 142 fi 140 fail "modprobe $modname failed"143 failure "modprobe $modname failed" 141 144 } 142 145 } 146 # Mount all vboxsf filesystems from /etc/fstab 147 mount -a -t vboxsf 143 148 succ_msg 144 149 return 0 … … 146 151 147 152 stop() { 148 begin "Stopping VirtualBox Additions shared folder support "; 149 if running; then 150 rmmod $modname || fail "Cannot unload module $modname" 153 begin_msg "Stopping VirtualBox Additions shared folder support"; 154 # At first, unmount all vboxsf filesystems 155 if umount -a -t vboxsf 2>/dev/null; then 156 if running; then 157 rmmod $modname || failure "Cannot unload module $modname" 158 fi 159 succ_msg 160 else 161 failure "Cannot unmount vboxvsf filesystems" 151 162 fi 152 succ_msg153 163 return 0 154 164 } -
trunk/src/VBox/Installer/linux/vboxdrv.sh.in
r8713 r9096 64 64 } 65 65 succ_msg() { 66 log_ success_msg " done."66 log_end_msg 0 67 67 } 68 68 begin_msg() { -
trunk/src/VBox/Installer/linux/vboxnet.sh.in
r8453 r9096 23 23 # Required-Start: $network 24 24 # Required-Stop: 25 # Default-Start: 3526 # Default-Stop: 25 # Default-Start: 2 3 4 5 26 # Default-Stop: 0 1 6 27 27 # Description: VirtualBox permanent host networking setup 28 28 ### END INIT INFO … … 54 54 } 55 55 succ_msg() { 56 log_ success_msg " done."56 log_end_msg 0 57 57 } 58 58 begin_msg() { … … 63 63 . /etc/init.d/functions 64 64 fail_msg() { 65 echo -n " " 65 66 echo_failure 66 67 echo … … 68 69 } 69 70 succ_msg() { 71 echo -n " " 70 72 echo_success 71 73 echo
Note:
See TracChangeset
for help on using the changeset viewer.