Changeset 57945 in vbox for trunk/src/VBox/Additions/linux/installer
- Timestamp:
- Sep 29, 2015 3:21:38 PM (10 years ago)
- svn:sync-xref-src-repo-rev:
- 102920
- Location:
- trunk/src/VBox/Additions/linux/installer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/installer/vboxadd-service.sh
r57732 r57945 27 27 28 28 PATH=$PATH:/bin:/sbin:/usr/sbin 29 SCRIPTNAME=vboxadd-service 29 30 30 system=unknown 31 if [ -f /etc/redhat-release ]; then 32 system=redhat 33 PIDFILE="/var/lock/subsys/vboxadd-service" 34 elif [ -f /etc/SuSE-release ]; then 35 system=suse 36 PIDFILE="/var/run/vboxadd-service" 37 elif [ -f /etc/debian_version ]; then 38 system=debian 39 PIDFILE="/var/run/vboxadd-service.pid" 40 elif [ -f /etc/gentoo-release ]; then 41 system=gentoo 42 PIDFILE="/var/run/vboxadd-service" 43 elif [ -f /etc/slackware-version ]; then 44 system=slackware 45 PIDFILE="/var/run/vboxadd-service" 46 elif [ -f /etc/lfs-release ]; then 47 system=lfs 48 PIDFILE="/var/run/vboxadd-service.pid" 49 else 50 system=other 51 if [ -d /var/run -a -w /var/run ]; then 52 PIDFILE="/var/run/vboxadd-service" 53 fi 31 PIDFILE="/var/run/${SCRIPTNAME}" 32 33 # Preamble for Gentoo 34 if [ "`which $0`" = "/sbin/rc" ]; then 35 shift 54 36 fi 55 37 56 if [ "$system" = "redhat" ]; then 57 . /etc/init.d/functions 58 fail_msg() { 59 echo_failure 60 echo 61 } 38 begin() 39 { 40 test -n "${2}" && echo "${SCRIPTNAME}: ${1}." 41 logger "${SCRIPTNAME}: ${1}." 42 } 62 43 63 succ_msg() { 64 echo_success 65 echo66 44 succ_msg() 45 { 46 logger "${SCRIPTNAME}: done." 47 } 67 48 68 begin() { 69 echo -n "$1" 70 } 71 fi 49 fail_msg() 50 { 51 echo "${SCRIPTNAME}: failed." >&2 52 logger "${SCRIPTNAME}: failed." 53 } 72 54 73 if [ "$system" = "suse" ]; then 74 . /etc/rc.status 75 daemon() { 76 startproc ${1+"$@"} 77 } 55 daemon() { 56 $1 $2 $3 57 } 78 58 79 fail_msg() {80 rc_failed181 rc_status -v82 59 killproc() { 60 killall $1 61 rm -f $PIDFILE 62 } 83 63 84 succ_msg() { 85 rc_reset 86 rc_status -v 87 } 88 89 begin() { 90 echo -n "$1" 91 } 92 fi 93 94 if [ "$system" = "debian" ]; then 64 if which start-stop-daemon >/dev/null; then 95 65 daemon() { 96 66 start-stop-daemon --start --exec $1 -- $2 $3 … … 99 69 killproc() { 100 70 start-stop-daemon --stop --retry 2 --exec $@ 101 }102 103 fail_msg() {104 echo " ...fail!"105 }106 107 succ_msg() {108 echo " ...done."109 }110 111 begin() {112 echo -n "$1"113 }114 fi115 116 if [ "$system" = "gentoo" ]; then117 if [ -f /sbin/functions.sh ]; then118 . /sbin/functions.sh119 elif [ -f /etc/init.d/functions.sh ]; then120 . /etc/init.d/functions.sh121 fi122 daemon() {123 start-stop-daemon --start --exec $1 -- $2 $3124 }125 126 killproc() {127 start-stop-daemon --stop --retry 2 --exec $@128 }129 130 fail_msg() {131 echo " ...fail!"132 }133 134 succ_msg() {135 echo " ...done."136 }137 138 begin() {139 echo -n "$1"140 }141 142 if [ "`which $0`" = "/sbin/rc" ]; then143 shift144 fi145 fi146 147 if [ "$system" = "slackware" -o "$system" = "other" ]; then148 daemon() {149 $1 $2 $3150 }151 152 killproc() {153 killall $1154 rm -f $PIDFILE155 }156 157 fail_msg() {158 echo " ...fail!"159 }160 161 succ_msg() {162 echo " ...done."163 }164 165 begin() {166 echo -n "$1"167 }168 169 fi170 171 if [ "$system" = "lfs" ]; then172 . /etc/rc.d/init.d/functions173 daemon() {174 loadproc $1 $2 $3175 }176 177 fail_msg() {178 echo_failure179 }180 181 succ_msg() {182 echo_ok183 }184 185 begin() {186 echo $1187 }188 189 status() {190 statusproc $1191 71 } 192 72 fi … … 207 87 start() { 208 88 if ! test -f $PIDFILE; then 209 begin "Starting VirtualBox Guest Addition service " ;89 begin "Starting VirtualBox Guest Addition service " console; 210 90 vboxaddrunning || { 211 91 echo "VirtualBox Additions module not loaded!" … … 222 102 stop() { 223 103 if test -f $PIDFILE; then 224 begin "Stopping VirtualBox Guest Addition service " ;104 begin "Stopping VirtualBox Guest Addition service " console; 225 105 killproc $binary 226 106 RETVAL=$? -
trunk/src/VBox/Additions/linux/installer/vboxadd-x11.sh
r56860 r57945 33 33 CONFIG_DIR="/var/lib/VBoxGuestAdditions" 34 34 CONFIG="config" 35 SCRIPTNAME=vboxadd-x11 35 36 36 37 # Check architecture … … 69 70 /usr/X11R6/lib/X11/XF86Config" 70 71 71 if [ -f /etc/redhat-release ]; then 72 system=redhat 73 elif [ -f /etc/debian_version ]; then 74 system=debian 75 elif [ -f /etc/SuSE-release ]; then 76 system=suse 77 elif [ -f /etc/gentoo-release ]; then 78 system=gentoo 79 elif [ -f /etc/lfs-release -a -d /etc/rc.d/init.d ]; then 80 system=lfs 81 else 82 system=other 72 # Preamble for Gentoo 73 if [ "`which $0`" = "/sbin/rc" ]; then 74 shift 83 75 fi 84 76 85 if [ "$system" = "redhat" ]; then 86 . /etc/init.d/functions 87 fail_msg() { 88 echo_failure 89 echo 90 } 91 succ_msg() { 92 echo_success 93 echo 94 } 95 begin() { 96 echo -n "$1" 97 } 98 fi 99 100 if [ "$system" = "suse" ]; then 101 . /etc/rc.status 102 fail_msg() { 103 rc_failed 1 104 rc_status -v 105 } 106 succ_msg() { 107 rc_reset 108 rc_status -v 109 } 110 begin() { 111 echo -n "$1" 112 } 113 fi 114 115 if [ "$system" = "gentoo" ]; then 116 if [ -f /sbin/functions.sh ]; then 117 . /sbin/functions.sh 118 elif [ -f /etc/init.d/functions.sh ]; then 119 . /etc/init.d/functions.sh 120 fi 121 fail_msg() { 122 eend 1 123 } 124 succ_msg() { 125 eend $? 126 } 127 begin() { 128 ebegin $1 129 } 130 if [ "`which $0`" = "/sbin/rc" ]; then 131 shift 132 fi 133 fi 134 135 if [ "$system" = "lfs" ]; then 136 . /etc/rc.d/init.d/functions 137 fail_msg() { 138 echo_failure 139 } 140 succ_msg() { 141 echo_ok 142 } 143 begin() { 144 echo $1 145 } 146 fi 147 148 if [ "$system" = "debian" -o "$system" = "other" ]; then 149 fail_msg() { 150 echo " ...fail!" 151 } 152 succ_msg() { 153 echo " ...done." 154 } 155 begin() { 156 echo -n $1 157 } 158 fi 77 begin() 78 { 79 test -n "${2}" && echo "${SCRIPTNAME}: ${1}." 80 logger "${SCRIPTNAME}: ${1}." 81 } 82 83 succ_msg() 84 { 85 logger "${SCRIPTNAME}: done." 86 } 87 88 fail_msg() 89 { 90 echo "${SCRIPTNAME}: failed." >&2 91 logger "${SCRIPTNAME}: failed." 92 } 159 93 160 94 dev=/dev/vboxguest … … 165 99 fail() 166 100 { 167 if [ "$system" = "gentoo" ]; then 168 eerror $1 169 exit 1 170 fi 171 fail_msg 172 echo "($1)" 101 echo "${SCRIPTNAME}: failed: ${1}." >&2 102 logger "${SCRIPTNAME}: ${1}." 173 103 exit 1 174 104 } -
trunk/src/VBox/Additions/linux/installer/vboxadd.sh
r57589 r57945 34 34 MODPROBE=/sbin/modprobe 35 35 OLDMODULES="vboxguest vboxadd vboxsf vboxvfs vboxvideo" 36 SCRIPTNAME=vboxadd 36 37 37 38 if $MODPROBE -c 2>/dev/null | grep -q '^allow_unsupported_modules *0'; then … … 58 59 done 59 60 60 if [ -f /etc/redhat-release ]; then 61 system=redhat 62 elif [ -f /etc/SuSE-release ]; then 63 system=suse 64 elif [ -f /etc/gentoo-release ]; then 65 system=gentoo 66 elif [ -f /etc/lfs-release -a -d /etc/rc.d/init.d ]; then 67 system=lfs 68 else 69 system=other 61 # Preamble for Gentoo 62 if [ "`which $0`" = "/sbin/rc" ]; then 63 shift 70 64 fi 71 65 72 if [ "$system" = "redhat" ]; then 73 . /etc/init.d/functions 74 fail_msg() { 75 echo_failure 76 echo 77 } 78 succ_msg() { 79 echo_success 80 echo 81 } 82 begin() { 83 echo -n "$1" 84 } 85 fi 86 87 if [ "$system" = "suse" ]; then 88 . /etc/rc.status 89 fail_msg() { 90 rc_failed 1 91 rc_status -v 92 } 93 succ_msg() { 94 rc_reset 95 rc_status -v 96 } 97 begin() { 98 echo -n "$1" 99 } 100 fi 101 102 if [ "$system" = "gentoo" ]; then 103 if [ -f /sbin/functions.sh ]; then 104 . /sbin/functions.sh 105 elif [ -f /etc/init.d/functions.sh ]; then 106 . /etc/init.d/functions.sh 107 fi 108 fail_msg() { 109 eend 1 110 } 111 succ_msg() { 112 eend $? 113 } 114 begin() { 115 ebegin $1 116 } 117 if [ "`which $0`" = "/sbin/rc" ]; then 118 shift 119 fi 120 fi 121 122 if [ "$system" = "lfs" ]; then 123 . /etc/rc.d/init.d/functions 124 fail_msg() { 125 echo_failure 126 } 127 succ_msg() { 128 echo_ok 129 } 130 begin() { 131 echo $1 132 } 133 fi 134 135 if [ "$system" = "other" ]; then 136 fail_msg() { 137 echo " ...fail!" 138 } 139 succ_msg() { 140 echo " ...done." 141 } 142 begin() { 143 echo -n $1 144 } 145 fi 66 begin() 67 { 68 test -n "${2}" && echo "${SCRIPTNAME}: ${1}." 69 logger "${SCRIPTNAME}: ${1}." 70 } 71 72 succ_msg() 73 { 74 logger "${SCRIPTNAME}: done." 75 } 76 77 fail_msg() 78 { 79 echo "${SCRIPTNAME}: failed." >&2 80 logger "${SCRIPTNAME}: failed." 81 } 146 82 147 83 show_error() 148 84 { 149 if [ "$system" = "gentoo" ]; then 150 eerror $1 151 fi 152 fail_msg 153 echo "($1)" 85 echo "${SCRIPTNAME}: failed: ${1}." >&2 86 logger "${SCRIPTNAME}: ${1}." 154 87 } 155 88 … … 183 116 fi 184 117 printf "\nThe headers for the current running kernel were not found. If the following\nmodule compilation fails then this could be the reason.\n" 185 if [ "$system" = "redhat" ]; then118 if which yum >/dev/null; then 186 119 if echo "$KERN_VER" | grep -q "uek"; then 187 120 printf "The missing package can be probably installed with\nyum install kernel-uek-devel-$KERN_VER\n" … … 189 122 printf "The missing package can be probably installed with\nyum install kernel-devel-$KERN_VER\n" 190 123 fi 191 elif [ "$system" = "suse" ]; then124 elif which zypper >/dev/null; then 192 125 KERN_VER_SUSE=`echo "$KERN_VER" | sed 's/.*-\([^-]*\)/\1/g'` 193 126 KERN_VER_BASE=`echo "$KERN_VER" | sed 's/\(.*\)-[^-]*/\1/g'` 194 127 printf "The missing package can be probably installed with\nzypper install kernel-$KERN_VER_SUSE-devel-$KERN_VER_BASE\n" 195 elif [ "$system" = "debian" ]; then128 elif which apt-get >/dev/null; then 196 129 printf "The missing package can be probably installed with\napt-get install linux-headers-$KERN_VER\n" 197 130 fi … … 268 201 start() 269 202 { 270 begin "Starting the VirtualBox Guest Additions ";203 begin "Starting the VirtualBox Guest Additions" console; 271 204 uname -r | grep -q -E '^2\.6|^3|^4' 2>/dev/null && 272 205 ps -A -o comm | grep -q '/*udevd$' 2>/dev/null || … … 318 251 stop() 319 252 { 320 begin "Stopping VirtualBox Additions ";253 begin "Stopping VirtualBox Additions" console; 321 254 if ! umount -a -t vboxsf 2>/dev/null; then 322 255 fail "Cannot unmount vboxsf folders"
Note:
See TracChangeset
for help on using the changeset viewer.