- Timestamp:
- May 26, 2008 9:33:25 AM (17 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/installer/vboxadd-timesync.sh
r9104 r9108 33 33 PATH=$PATH:/bin:/sbin:/usr/sbin 34 34 35 [ -f /lib/lsb/init-functions ] || NOLSB=yes 36 35 system=unknown 37 36 if [ -f /etc/redhat-release ]; then 38 37 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" 41 42 elif [ -f /etc/debian_version ]; then 42 43 system=debian 44 PIDFILE="/var/run/vboxadd-timesync" 43 45 elif [ -f /etc/gentoo-release ]; then 44 46 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 } 47 PIDFILE="/var/run/vboxadd-timesync" 59 48 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 } 49 system=other 50 if [ -d /var/run -a -w /var/run ]; then 51 PIDFILE="/var/run/vboxadd-timesync" 116 52 fi 117 53 fi 118 54 119 55 if [ "$system" = "redhat" ]; then 120 PIDFILE="/var/lock/subsys/vboxadd-timesync" 121 elif [ "$system" = "suse" ]; then 122 PIDFILE="/var/lock/subsys/vboxadd-timesync" 56 . /etc/init.d/functions 57 fail_msg() { 58 echo_failure 59 echo 60 } 61 62 succ_msg() { 63 echo_success 64 echo 65 } 66 fi 67 68 if [ "$system" = "suse" ]; then 69 . /etc/rc.status 123 70 daemon() { 124 71 startproc ${1+"$@"} 125 72 } 126 elif [ "$system" = "debian" ]; then 127 PIDFILE="/var/run/vboxadd-timesync" 73 74 fail_msg() { 75 rc_failed 1 76 rc_status -v 77 } 78 79 succ_msg() { 80 rc_reset 81 rc_status -v 82 } 83 fi 84 85 if [ "$system" = "debian" ]; then 128 86 daemon() { 129 87 start-stop-daemon --start --exec $1 -- $2 130 88 } 89 131 90 killproc() { 132 91 start-stop-daemon --stop --exec $@ 133 92 } 134 elif [ "$system" = "gentoo" ]; then 135 PIDFILE="/var/run/vboxadd-timesync" 93 94 fail_msg() { 95 echo " ...fail!" 96 } 97 98 succ_msg() { 99 echo " ...done." 100 } 101 fi 102 103 if [ "$system" = "gentoo" ]; then 104 . /sbin/functions.sh 136 105 daemon() { 137 106 start-stop-daemon --start --exec $1 -- $2 138 107 } 108 139 109 killproc() { 140 110 start-stop-daemon --stop --exec $@ 141 111 } 142 else 143 if [ -d /var/run -a -w /var/run ]; then 144 PIDFILE="/var/run/vboxadd-timesync" 145 fi 112 113 fail_msg() { 114 echo " ...fail!" 115 } 116 117 succ_msg() { 118 echo " ...done." 119 } 120 121 if [ "`which $0`" = "/sbin/rc" ]; then 122 shift 123 fi 124 fi 125 126 if [ "$system" = "other" ]; then 127 fail_msg() { 128 echo " ...fail!" 129 } 130 131 succ_msg() { 132 echo " ...done." 133 } 134 135 begin() { 136 echo -n "$1" 137 } 146 138 fi 147 139 … … 159 151 start() { 160 152 if ! test -f $PIDFILE; then 161 begin_msg "Starting VirtualBox host to guest time synchronisation";153 echo -n "Starting VirtualBox host to guest time synchronisation "; 162 154 vboxaddrunning || { 163 failure "VirtualBox Additions module not loaded!" 155 echo "VirtualBox Additions module not loaded!" 156 exit 1 164 157 } 165 158 daemon $binary --daemonize … … 173 166 stop() { 174 167 if test -f $PIDFILE; then 175 begin_msg "Stopping VirtualBox host to guest time synchronisation";168 echo -n "Stopping VirtualBox host to guest time synchronisation "; 176 169 vboxaddrunning || { 177 failure "VirtualBox Additions module not loaded!" 170 echo "VirtualBox Additions module not loaded!" 171 exit 1 178 172 } 179 173 killproc $binary -
trunk/src/VBox/Additions/linux/installer/vboxadd.sh
r9104 r9108 33 33 PATH=$PATH:/bin:/sbin:/usr/sbin 34 34 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 } 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 59 41 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 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 } 117 110 fi 118 111 … … 124 117 group=1 125 118 126 failure() 127 { 128 fail_msg "$1" 119 fail() { 120 if [ "$system" = "gentoo" ]; then 121 eerror $1 122 exit 1 123 fi 124 fail_msg 125 echo "($1)" 129 126 exit 1 130 127 } … … 135 132 136 133 start() { 137 begin _msg "Starting VirtualBox Additions";134 begin "Starting VirtualBox Additions "; 138 135 running || { 139 136 rm -f $dev || { 140 fail ure"Cannot remove $dev"137 fail "Cannot remove $dev" 141 138 } 142 139 143 140 modprobe $modname >/dev/null 2>&1 || { 144 fail ure"modprobe $modname failed"141 fail "modprobe $modname failed" 145 142 } 146 143 … … 159 156 test -z "$maj" && { 160 157 rmmod $modname 2>/dev/null 161 fail ure"Cannot locate the VirtualBox device"162 } 163 164 mknod -m 0664 $dev c $maj $min 2>/dev/null|| {158 fail "Cannot locate the VirtualBox device" 159 } 160 161 mknod -m 0664 $dev c $maj $min || { 165 162 rmmod $modname 2>/dev/null 166 fail ure"Cannot create device $dev with major $maj and minor $min"163 fail "Cannot create device $dev with major $maj and minor $min" 167 164 } 168 165 fi … … 170 167 chown $owner:$group $dev 2>/dev/null || { 171 168 rmmod $modname 2>/dev/null 172 fail ure"Cannot change owner $owner:$group for device $dev"169 fail "Cannot change owner $owner:$group for device $dev" 173 170 } 174 171 … … 178 175 179 176 stop() { 180 begin _msg "Stopping VirtualBox Additions";177 begin "Stopping VirtualBox Additions "; 181 178 if running; then 182 rmmod $modname 2>/dev/null || fail ure"Cannot unload module $modname"183 rm -f $dev || fail ure"Cannot unlink $dev"179 rmmod $modname 2>/dev/null || fail "Cannot unload module $modname" 180 rm -f $dev || fail "Cannot unlink $dev" 184 181 fi 185 182 succ_msg -
trunk/src/VBox/Additions/linux/installer/vboxvfs.sh
r9104 r9108 33 33 PATH=$PATH:/bin:/sbin:/usr/sbin 34 34 35 [ -f /lib/lsb/init-functions ] || NOLSB=yes 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 36 44 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 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 44 95 fi 45 96 fi 46 97 47 if [ -z "$NOLSB" ]; then 48 . /lib/lsb/init-functions 98 if [ "$system" = "other" ]; then 49 99 fail_msg() { 50 echo "" 51 log_failure_msg "$1" 100 echo " ...fail!" 52 101 } 102 53 103 succ_msg() { 54 log_end_msg 0104 echo " ...done." 55 105 } 56 begin_msg() { 57 log_daemon_msg "$@" 106 107 begin() { 108 echo -n $1 58 109 } 59 else60 if [ "$system" = "redhat" ]; then61 . /etc/init.d/functions62 fail_msg() {63 echo -n " "64 echo_failure65 echo66 echo " ($1)"67 }68 succ_msg() {69 echo -n " "70 echo_success71 echo72 }73 elif [ "$system" = "suse" ]; then74 . /etc/rc.status75 fail_msg() {76 rc_failed 177 rc_status -v78 echo " ($1)"79 }80 succ_msg() {81 rc_reset82 rc_status -v83 }84 elif [ "$system" = "gentoo" ]; then85 . /sbin/functions.sh86 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" ]; then96 shift97 fi98 else99 fail_msg() {100 echo " ...failed!"101 echo " ($1)"102 }103 succ_msg() {104 echo " ...done."105 }106 fi107 if [ "$system" != "gentoo" ]; then108 begin_msg() {109 [ -z "${1:-}" ] && return 1110 if [ -z "${2:-}" ]; then111 echo -n "$1"112 else113 echo -n "$1: $2"114 fi115 }116 fi117 110 fi 118 111 … … 121 114 module="$kdir/$modname" 122 115 123 failure() 124 { 125 fail_msg "$1" 116 fail() { 117 if [ "$system" = "gentoo" ]; then 118 eerror $1 119 exit 1 120 fi 121 fail_msg 122 echo "($1)" 126 123 exit 1 127 124 } 128 125 129 126 running() { 130 lsmod | grep -q $modname[^_-]127 lsmod | grep -q "$modname[^_-]" 131 128 } 132 129 133 130 start() { 134 begin _msg "Starting VirtualBox Additions shared folder support";131 begin "Starting VirtualBox Additions shared folder support "; 135 132 running || { 136 133 modprobe $modname > /dev/null 2>&1 || { 137 134 if dmesg | grep "vboxConnect failed" > /dev/null 2>&1; then 138 fail_msg "modprobe $modname failed"135 fail_msg 139 136 echo "You may be trying to run Guest Additions from binary release of VirtualBox" 140 137 echo "in the Open Source Edition." 141 138 exit 1 142 139 fi 143 fail ure"modprobe $modname failed"140 fail "modprobe $modname failed" 144 141 } 145 142 } 146 # Mount all vboxsf filesystems from /etc/fstab147 mount -a -t vboxsf148 143 succ_msg 149 144 return 0 … … 151 146 152 147 stop() { 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 2>/dev/null || failure "Cannot unload module $modname" 158 fi 159 succ_msg 160 else 161 failure "Cannot unmount vboxvsf filesystems" 148 begin "Stopping VirtualBox Additions shared folder support "; 149 if running; then 150 rmmod $modname 2>/dev/null || fail "Cannot unload module $modname" 162 151 fi 152 succ_msg 163 153 return 0 164 154 } -
trunk/src/VBox/Installer/linux/vboxdrv.sh.in
r9096 r9108 64 64 } 65 65 succ_msg() { 66 log_ end_msg 066 log_success_msg " done." 67 67 } 68 68 begin_msg() { -
trunk/src/VBox/Installer/linux/vboxnet.sh.in
r9096 r9108 54 54 } 55 55 succ_msg() { 56 log_ end_msg 056 log_success_msg " done." 57 57 } 58 58 begin_msg() { … … 63 63 . /etc/init.d/functions 64 64 fail_msg() { 65 echo -n " "66 65 echo_failure 67 66 echo … … 69 68 } 70 69 succ_msg() { 71 echo -n " "72 70 echo_success 73 71 echo
Note:
See TracChangeset
for help on using the changeset viewer.