Changeset 76611 in vbox
- Timestamp:
- Jan 2, 2019 3:16:20 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 127915
- Location:
- trunk/src/VBox/Installer/linux
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/check_module_dependencies.sh
r76610 r76611 74 74 UNIT_TEST= 75 75 76 case "$ 1" in76 case "${1}" in 77 77 "") 78 78 # Return immediately successfully if everything is installed 79 79 type ${TOOLS} >/dev/null 2>&1 && HAVE_TOOLS=yes 80 80 test -d "/lib/modules/`uname -r`/build/include" && HAVE_HEADERS=yes 81 test -n "$ HAVE_TOOLS" && test -n "$HAVE_HEADERS" && exit 081 test -n "${HAVE_TOOLS}" && test -n "${HAVE_HEADERS}" && exit 0 82 82 UNAME=`uname -r` 83 83 for i in rpm dpkg; do 84 84 for j in /var/lib/${i}/*; do 85 85 test -e "${j}" || break 86 if test -z "$ PACKAGE_TYPE"; then86 if test -z "${PACKAGE_TYPE}"; then 87 87 PACKAGE_TYPE="${i}" 88 88 else … … 94 94 ;; 95 95 -h|--help) 96 echo "$ USAGE_MESSAGE"96 echo "${USAGE_MESSAGE}" 97 97 exit 0 ;; 98 98 *) 99 99 ERROR="" 100 UNAME="$ 2"101 PACKAGE_TYPE="$ 3"102 BASE_EXPECTED="$ 4"103 VERSIONED_EXPECTED="$ 5"100 UNAME="${2}" 101 PACKAGE_TYPE="${3}" 102 BASE_EXPECTED="${4}" 103 VERSIONED_EXPECTED="${5}" 104 104 test "${1}" = --test || ERROR=yes 105 test -n "$ UNAME" && test -n "${PACKAGE_TYPE}" || test -z "$UNAME" ||105 test -n "${UNAME}" && test -n "${PACKAGE_TYPE}" || test -z "${UNAME}" || 106 106 ERROR=yes 107 test -n "$ BASE_EXPECTED" && test -n "$VERSIONED_EXPECTED" ||108 test -z "$ BASE_EXPECTED" || ERROR=yes109 case "$ ERROR" in ?*)110 echo "$ USAGE_MESSAGE" >&2107 test -n "${BASE_EXPECTED}" && test -n "${VERSIONED_EXPECTED}" || 108 test -z "${BASE_EXPECTED}" || ERROR=yes 109 case "${ERROR}" in ?*) 110 echo "${USAGE_MESSAGE}" >&2 111 111 exit 1 112 112 esac 113 113 TEST=yes 114 114 TEST_PARAMS="${2} ${3} ${4} ${5}" 115 test -z "$ UNAME" && UNIT_TEST=yes115 test -z "${UNAME}" && UNIT_TEST=yes 116 116 ;; 117 117 esac 118 118 119 case "$ PACKAGE_TYPE" in119 case "${PACKAGE_TYPE}" in 120 120 rpm) 121 121 for i in ${SUSE_FLAVOURS}; do 122 case "$ UNAME" in *-"${i}")122 case "${UNAME}" in *-"${i}") 123 123 BASE_PACKAGE="kernel-${i}-devel" 124 VERSIONED_PACKAGE="kernel-${i}-devel-$ UNAME%-${i}"124 VERSIONED_PACKAGE="kernel-${i}-devel-${UNAME%-${i}}" 125 125 break 126 126 esac 127 127 done 128 128 for i in ${EL_FLAVOURS} ""; do 129 case "$ UNAME" in *.el5"${i}"|*.el*"${i}".i686|*.el*"${i}".x86_64)129 case "${UNAME}" in *.el5"${i}"|*.el*"${i}".i686|*.el*"${i}".x86_64) 130 130 test -n "${i}" && i="${i}-" # Hack to handle empty flavour. 131 131 BASE_PACKAGE="kernel-${i}devel" 132 VERSIONED_PACKAGE="kernel-${i}devel-$ UNAME"133 break 134 esac 135 done 136 case "$ UNAME" in *.fc*.i686|*.fc*.x86_64) # Fedora132 VERSIONED_PACKAGE="kernel-${i}devel-${UNAME}" 133 break 134 esac 135 done 136 case "${UNAME}" in *.fc*.i686|*.fc*.x86_64) # Fedora 137 137 BASE_PACKAGE="kernel-devel" 138 VERSIONED_PACKAGE="kernel-devel-$ UNAME"138 VERSIONED_PACKAGE="kernel-devel-${UNAME}" 139 139 esac 140 140 for i in ${MAGEIA_FLAVOURS} ""; do # Mageia 141 case "$ UNAME" in *-"${i}"*.mga*)141 case "${UNAME}" in *-"${i}"*.mga*) 142 142 if test -z "${i}"; then 143 143 BASE_PACKAGE="kernel-linus-devel" 144 VERSIONED_PACKAGE="kernel-linus-devel-$ UNAME"144 VERSIONED_PACKAGE="kernel-linus-devel-${UNAME}" 145 145 else 146 146 BASE_PACKAGE="kernel-${i}-devel" 147 VERSIONED_PACKAGE="kernel-${i}-devel-$ UNAME%-${i}*$UNAME#*${i}"147 VERSIONED_PACKAGE="kernel-${i}-devel-${UNAME%-${i}*}${UNAME#*${i}}" 148 148 fi 149 149 break … … 153 153 dpkg) 154 154 for i in ${DEBIAN_FLAVOURS}; do # Debian/Ubuntu 155 case "$ UNAME" in *-${i})155 case "${UNAME}" in *-${i}) 156 156 BASE_PACKAGE="linux-headers-${i}" 157 VERSIONED_PACKAGE="linux-headers-$ UNAME"158 break 159 esac 160 done 161 case "$ UNAME" in *-pclos*) # PCLinuxOS157 VERSIONED_PACKAGE="linux-headers-${UNAME}" 158 break 159 esac 160 done 161 case "${UNAME}" in *-pclos*) # PCLinuxOS 162 162 BASE_PACKAGE="kernel-devel" 163 VERSIONED_PACKAGE="kernel-devel-$ UNAME"164 esac 165 esac 166 167 case "$ UNIT_TEST$BASE_EXPECTED" in "")163 VERSIONED_PACKAGE="kernel-devel-${UNAME}" 164 esac 165 esac 166 167 case "${UNIT_TEST}${BASE_EXPECTED}" in "") 168 168 echo "This system is currently not set up to build kernel modules." >&2 169 test -n "$ HAVE_TOOLS" ||170 echo "Please install the $ TOOLSpackages from your distribution." >&2171 test -n "$ HAVE_HEADERS" && exit 1169 test -n "${HAVE_TOOLS}" || 170 echo "Please install the ${TOOLS} packages from your distribution." >&2 171 test -n "${HAVE_HEADERS}" && exit 1 172 172 echo "Please install the Linux kernel \"header\" files matching the current kernel" >&2 173 173 echo "for adding new hardware support to the system." >&2 174 if test -n "$ BASE_PACKAGE$VERSIONED_PACKAGE"; then174 if test -n "${BASE_PACKAGE}${VERSIONED_PACKAGE}"; then 175 175 echo "The distribution packages containing the headers are probably:" >&2 176 echo " $ BASE_PACKAGE $VERSIONED_PACKAGE" >&2176 echo " ${BASE_PACKAGE} ${VERSIONED_PACKAGE}" >&2 177 177 fi 178 test -z "$ TEST" && exit 1178 test -z "${TEST}" && exit 1 179 179 exit 0 180 180 esac 181 181 182 case "$ BASE_EXPECTED" in ?*)183 case "$ BASE_EXPECTED $VERSIONED_EXPECTED" in184 "$ BASE_PACKAGE $VERSIONED_PACKAGE")182 case "${BASE_EXPECTED}" in ?*) 183 case "${BASE_EXPECTED} ${VERSIONED_EXPECTED}" in 184 "${BASE_PACKAGE} ${VERSIONED_PACKAGE}") 185 185 exit 0 186 186 esac 187 echo "Test: $ TEST_PARAMS" >&2188 echo "Result: $ BASE_PACKAGE $VERSIONED_PACKAGE"187 echo "Test: ${TEST_PARAMS}" >&2 188 echo "Result: ${BASE_PACKAGE} ${VERSIONED_PACKAGE}" 189 189 exit 1 190 190 esac -
trunk/src/VBox/Installer/linux/install.sh
r76610 r76611 202 202 # Find previous installation 203 203 if test -r "$CONFIG_DIR/$CONFIG"; then 204 . $ {CONFIG_DIR}/$CONFIG204 . $CONFIG_DIR/$CONFIG 205 205 PREV_INSTALLATION=$INSTALL_DIR 206 206 fi … … 228 228 229 229 # Remove previous installation 230 test "$ BUILD_MODULE" = true || VBOX_DONT_REMOVE_OLD_MODULES=1230 test "${BUILD_MODULE}" = true || VBOX_DONT_REMOVE_OLD_MODULES=1 231 231 232 232 if [ -n "$PREV_INSTALLATION" ]; then … … 241 241 fi 242 242 243 mkdir -p -m 755 $ {CONFIG_DIR}244 touch $ {CONFIG_DIR}/$CONFIG243 mkdir -p -m 755 $CONFIG_DIR 244 touch $CONFIG_DIR/$CONFIG 245 245 246 246 info "Installing VirtualBox to $INSTALLATION_DIR" … … 249 249 250 250 # Verify the archive 251 mkdir -p -m 755 $ {INSTALLATION_DIR}251 mkdir -p -m 755 $INSTALLATION_DIR 252 252 bzip2 -d -c VirtualBox.tar.bz2 > VirtualBox.tar 253 if ! tar -tf VirtualBox.tar > $ {CONFIG_DIR}/$CONFIG_FILES; then254 rmdir $ {INSTALLATION_DIR}2> /dev/null255 rm -f $ {CONFIG_DIR}/$CONFIG 2> /dev/null256 rm -f $ {CONFIG_DIR}/$CONFIG_FILES 2> /dev/null253 if ! tar -tf VirtualBox.tar > $CONFIG_DIR/$CONFIG_FILES; then 254 rmdir $INSTALLATION_DIR 2> /dev/null 255 rm -f $CONFIG_DIR/$CONFIG 2> /dev/null 256 rm -f $CONFIG_DIR/$CONFIG_FILES 2> /dev/null 257 257 log 'Error running "bzip2 -d -c VirtualBox.tar.bz2" or "tar -tf VirtualBox.tar".' 258 258 abort "Error installing VirtualBox. Installation aborted" … … 260 260 261 261 # Create installation directory and install 262 if ! tar -xf VirtualBox.tar -C $ {INSTALLATION_DIR}; then262 if ! tar -xf VirtualBox.tar -C $INSTALLATION_DIR; then 263 263 cwd=`pwd` 264 cd $ {INSTALLATION_DIR}265 rm -f `cat $ {CONFIG_DIR}/$CONFIG_FILES` 2> /dev/null264 cd $INSTALLATION_DIR 265 rm -f `cat $CONFIG_DIR/$CONFIG_FILES` 2> /dev/null 266 266 cd $pwd 267 rmdir $ {INSTALLATION_DIR}2> /dev/null268 rm -f $ {CONFIG_DIR}/$CONFIG 2> /dev/null267 rmdir $INSTALLATION_DIR 2> /dev/null 268 rm -f $CONFIG_DIR/$CONFIG 2> /dev/null 269 269 log 'Error running "tar -xf VirtualBox.tar -C '"$INSTALLATION_DIR"'".' 270 270 abort "Error installing VirtualBox. Installation aborted" 271 271 fi 272 272 273 cp uninstall.sh $ {INSTALLATION_DIR}274 echo "uninstall.sh" >> $ {CONFIG_DIR}/$CONFIG_FILES273 cp uninstall.sh $INSTALLATION_DIR 274 echo "uninstall.sh" >> $CONFIG_DIR/$CONFIG_FILES 275 275 276 276 # Hardened build: Mark selected binaries set-user-ID-on-execution, … … 278 278 # and finally make sure the directory is only writable by the user (paranoid). 279 279 if [ -n "$HARDENED" ]; then 280 if [ -f "$INSTALLATION_DIR/VirtualBoxVM"]; then281 test -e $ {INSTALLATION_DIR}/VirtualBoxVM && chmod 4511 ${INSTALLATION_DIR}/VirtualBoxVM280 if [ -f $INSTALLATION_DIR/VirtualBoxVM ]; then 281 test -e $INSTALLATION_DIR/VirtualBoxVM && chmod 4511 $INSTALLATION_DIR/VirtualBoxVM 282 282 else 283 test -e $ {INSTALLATION_DIR}/VirtualBox && chmod 4511 ${INSTALLATION_DIR}/VirtualBox283 test -e $INSTALLATION_DIR/VirtualBox && chmod 4511 $INSTALLATION_DIR/VirtualBox 284 284 fi 285 test -e $ {INSTALLATION_DIR}/VBoxSDL && chmod 4511 ${INSTALLATION_DIR}/VBoxSDL286 test -e $ {INSTALLATION_DIR}/VBoxHeadless && chmod 4511 ${INSTALLATION_DIR}/VBoxHeadless287 test -e $ {INSTALLATION_DIR}/VBoxNetDHCP && chmod 4511 ${INSTALLATION_DIR}/VBoxNetDHCP288 test -e $ {INSTALLATION_DIR}/VBoxNetNAT && chmod 4511 ${INSTALLATION_DIR}/VBoxNetNAT289 290 ln -sf $ {INSTALLATION_DIR}/VBoxVMM.so ${INSTALLATION_DIR}/components/VBoxVMM.so291 ln -sf $ {INSTALLATION_DIR}/VBoxRT.so ${INSTALLATION_DIR}/components/VBoxRT.so292 293 chmod go-w $ {INSTALLATION_DIR}285 test -e $INSTALLATION_DIR/VBoxSDL && chmod 4511 $INSTALLATION_DIR/VBoxSDL 286 test -e $INSTALLATION_DIR/VBoxHeadless && chmod 4511 $INSTALLATION_DIR/VBoxHeadless 287 test -e $INSTALLATION_DIR/VBoxNetDHCP && chmod 4511 $INSTALLATION_DIR/VBoxNetDHCP 288 test -e $INSTALLATION_DIR/VBoxNetNAT && chmod 4511 $INSTALLATION_DIR/VBoxNetNAT 289 290 ln -sf $INSTALLATION_DIR/VBoxVMM.so $INSTALLATION_DIR/components/VBoxVMM.so 291 ln -sf $INSTALLATION_DIR/VBoxRT.so $INSTALLATION_DIR/components/VBoxRT.so 292 293 chmod go-w $INSTALLATION_DIR 294 294 fi 295 295 296 296 # This binaries need to be suid root in any case, even if not hardened 297 test -e $ {INSTALLATION_DIR}/VBoxNetAdpCtl && chmod 4511 ${INSTALLATION_DIR}/VBoxNetAdpCtl298 test -e $ {INSTALLATION_DIR}/VBoxVolInfo && chmod 4511 ${INSTALLATION_DIR}/VBoxVolInfo297 test -e $INSTALLATION_DIR/VBoxNetAdpCtl && chmod 4511 $INSTALLATION_DIR/VBoxNetAdpCtl 298 test -e $INSTALLATION_DIR/VBoxVolInfo && chmod 4511 $INSTALLATION_DIR/VBoxVolInfo 299 299 300 300 # Write the configuration. Needs to be done before the vboxdrv service is 301 301 # started. 302 echo "# VirtualBox installation directory" > $ {CONFIG_DIR}/$CONFIG303 echo "INSTALL_DIR='$ {INSTALLATION_DIR}'" >> ${CONFIG_DIR}/$CONFIG304 echo "# VirtualBox version" >> $ {CONFIG_DIR}/$CONFIG305 echo "INSTALL_VER='$VERSION'" >> $ {CONFIG_DIR}/$CONFIG306 echo "INSTALL_REV='$SVNREV'" >> $ {CONFIG_DIR}/$CONFIG307 echo "# Build type and user name for logging purposes" >> $ {CONFIG_DIR}/$CONFIG308 echo "BUILD_TYPE='$BUILD_BUILDTYPE'" >> $ {CONFIG_DIR}/$CONFIG309 echo "USERNAME='$BUILD_USERNAME'" >> $ {CONFIG_DIR}/$CONFIG302 echo "# VirtualBox installation directory" > $CONFIG_DIR/$CONFIG 303 echo "INSTALL_DIR='$INSTALLATION_DIR'" >> $CONFIG_DIR/$CONFIG 304 echo "# VirtualBox version" >> $CONFIG_DIR/$CONFIG 305 echo "INSTALL_VER='$VERSION'" >> $CONFIG_DIR/$CONFIG 306 echo "INSTALL_REV='$SVNREV'" >> $CONFIG_DIR/$CONFIG 307 echo "# Build type and user name for logging purposes" >> $CONFIG_DIR/$CONFIG 308 echo "BUILD_TYPE='$BUILD_BUILDTYPE'" >> $CONFIG_DIR/$CONFIG 309 echo "USERNAME='$BUILD_USERNAME'" >> $CONFIG_DIR/$CONFIG 310 310 311 311 # Create users group … … 313 313 314 314 # Create symlinks to start binaries 315 ln -sf $ {INSTALLATION_DIR}/VBox.sh /usr/bin/VirtualBox316 if [ -f "$INSTALLATION_DIR/VirtualBoxVM"]; then317 ln -sf $ {INSTALLATION_DIR}/VBox.sh /usr/bin/VirtualBoxVM318 fi 319 ln -sf $ {INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxManage320 ln -sf $ {INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxSDL321 ln -sf $ {INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxVRDP322 ln -sf $ {INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxHeadless323 ln -sf $ {INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxBalloonCtrl324 ln -sf $ {INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxBugReport325 ln -sf $ {INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxAutostart326 ln -sf $ {INSTALLATION_DIR}/VBox.sh /usr/bin/vboxwebsrv327 ln -sf $ {INSTALLATION_DIR}/vbox-img /usr/bin/vbox-img328 ln -sf $ {INSTALLATION_DIR}/VBox.png /usr/share/pixmaps/VBox.png329 if [ -f "$INSTALLATION_DIR/VBoxDTrace"]; then330 ln -sf $ {INSTALLATION_DIR}/VBox.sh /usr/bin/VBoxDTrace315 ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VirtualBox 316 if [ -f $INSTALLATION_DIR/VirtualBoxVM ]; then 317 ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VirtualBoxVM 318 fi 319 ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxManage 320 ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxSDL 321 ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxVRDP 322 ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxHeadless 323 ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxBalloonCtrl 324 ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxBugReport 325 ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxAutostart 326 ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/vboxwebsrv 327 ln -sf $INSTALLATION_DIR/vbox-img /usr/bin/vbox-img 328 ln -sf $INSTALLATION_DIR/VBox.png /usr/share/pixmaps/VBox.png 329 if [ -f $INSTALLATION_DIR/VBoxDTrace ]; then 330 ln -sf $INSTALLATION_DIR/VBox.sh /usr/bin/VBoxDTrace 331 331 fi 332 332 # Unity and Nautilus seem to look here for their icons 333 ln -sf $ {INSTALLATION_DIR}/icons/128x128/virtualbox.png /usr/share/pixmaps/virtualbox.png334 ln -sf $ {INSTALLATION_DIR}/virtualbox.desktop /usr/share/applications/virtualbox.desktop335 ln -sf $ {INSTALLATION_DIR}/virtualbox.xml /usr/share/mime/packages/virtualbox.xml336 ln -sf $ {INSTALLATION_DIR}/rdesktop-vrdp /usr/bin/rdesktop-vrdp337 ln -sf $ {INSTALLATION_DIR}/src/vboxhost /usr/src/vboxhost-_VERSION_333 ln -sf $INSTALLATION_DIR/icons/128x128/virtualbox.png /usr/share/pixmaps/virtualbox.png 334 ln -sf $INSTALLATION_DIR/virtualbox.desktop /usr/share/applications/virtualbox.desktop 335 ln -sf $INSTALLATION_DIR/virtualbox.xml /usr/share/mime/packages/virtualbox.xml 336 ln -sf $INSTALLATION_DIR/rdesktop-vrdp /usr/bin/rdesktop-vrdp 337 ln -sf $INSTALLATION_DIR/src/vboxhost /usr/src/vboxhost-_VERSION_ 338 338 339 339 # Convenience symlinks. The creation fails if the FS is not case sensitive 340 340 ln -sf VirtualBox /usr/bin/virtualbox > /dev/null 2>&1 341 if [ -f "$INSTALLATION_DIR/VirtualBoxVM"]; then341 if [ -f $INSTALLATION_DIR/VirtualBoxVM ]; then 342 342 ln -sf VirtualBoxVM /usr/bin/virtualboxvm > /dev/null 2>&1 343 343 fi … … 346 346 ln -sf VBoxHeadless /usr/bin/vboxheadless > /dev/null 2>&1 347 347 ln -sf VBoxBugReport /usr/bin/vboxbugreport > /dev/null 2>&1 348 if [ -f "$INSTALLATION_DIR/VBoxDTrace"]; then348 if [ -f $INSTALLATION_DIR/VBoxDTrace ]; then 349 349 ln -sf VBoxDTrace /usr/bin/vboxdtrace > /dev/null 2>&1 350 350 fi 351 351 352 352 # Create legacy symlinks if necesary for Qt5/xcb stuff. 353 if [ -d "$INSTALLATION_DIR/legacy"]; then353 if [ -d $INSTALLATION_DIR/legacy ]; then 354 354 if ! /sbin/ldconfig -p | grep -q "\<libxcb\.so\.1\>"; then 355 for f in `ls -1 $ {INSTALLATION_DIR}/legacy/`; do356 ln -s $ {INSTALLATION_DIR}/legacy/$f ${INSTALLATION_DIR}/$f357 echo $ {INSTALLATION_DIR}/$f >> ${CONFIG_DIR}/$CONFIG_FILES355 for f in `ls -1 $INSTALLATION_DIR/legacy/`; do 356 ln -s $INSTALLATION_DIR/legacy/$f $INSTALLATION_DIR/$f 357 echo $INSTALLATION_DIR/$f >> $CONFIG_DIR/$CONFIG_FILES 358 358 done 359 359 fi … … 362 362 # Icons 363 363 cur=`pwd` 364 cd $ {INSTALLATION_DIR}/icons364 cd $INSTALLATION_DIR/icons 365 365 for i in *; do 366 366 cd $i … … 373 373 fi 374 374 if [ -d /usr/share/icons/hicolor/$i/$dst ]; then 375 ln -s $ {INSTALLATION_DIR}/icons/$i/$j /usr/share/icons/hicolor/$i/$dst/$j376 echo /usr/share/icons/hicolor/$i/$dst/$j >> $ {CONFIG_DIR}/$CONFIG_FILES375 ln -s $INSTALLATION_DIR/icons/$i/$j /usr/share/icons/hicolor/$i/$dst/$j 376 echo /usr/share/icons/hicolor/$i/$dst/$j >> $CONFIG_DIR/$CONFIG_FILES 377 377 fi 378 378 done … … 390 390 # If Python is available, install Python bindings 391 391 if [ -n "$PYTHON" ]; then 392 maybe_run_python_bindings_installer $ {INSTALLATION_DIR} ${CONFIG_DIR}$CONFIG_FILES392 maybe_run_python_bindings_installer $INSTALLATION_DIR $CONFIG_DIR $CONFIG_FILES 393 393 fi 394 394 395 395 # Do post-installation common to all installer types, currently service 396 396 # script set-up. 397 if test "$ BUILD_MODULE" = "true"; then397 if test "${BUILD_MODULE}" = "true"; then 398 398 START_SERVICES= 399 399 else 400 400 START_SERVICES="--nostart" 401 401 fi 402 "$ INSTALLATION_DIR/prerm-common.sh" >> "$LOG"402 "${INSTALLATION_DIR}/prerm-common.sh" >> "${LOG}" 403 403 404 404 # Now check whether the kernel modules were stopped. 405 405 lsmod | grep -q vboxdrv && MODULES_STOPPED= 406 406 407 "$ INSTALLATION_DIR/postinst-common.sh" ${START_SERVICES} >> "$LOG"407 "${INSTALLATION_DIR}/postinst-common.sh" ${START_SERVICES} >> "${LOG}" 408 408 409 409 info "" … … 420 420 # And do a final test as to whether the kernel modules were properly created 421 421 # and loaded. Return 0 if both are true, 1 if not. 422 test -n "$ MODULES_STOPPED" &&422 test -n "${MODULES_STOPPED}" && 423 423 modinfo vboxdrv >/dev/null 2>&1 && 424 424 lsmod | grep -q vboxdrv || -
trunk/src/VBox/Installer/linux/postinst-common.sh
r76610 r76611 30 30 TARGET=`readlink -e -- "${0}"` || exit 1 31 31 MY_PATH="${TARGET%/[!/]*}" 32 cd "$ MY_PATH"32 cd "${MY_PATH}" 33 33 . "./routines.sh" 34 34 … … 53 53 54 54 # Install runlevel scripts and systemd unit files 55 install_init_script "$ MY_PATH/vboxdrv.sh" vboxdrv56 install_init_script "$ MY_PATH/vboxballoonctrl-service.sh" vboxballoonctrl-service57 install_init_script "$ MY_PATH/vboxautostart-service.sh" vboxautostart-service58 install_init_script "$ MY_PATH/vboxweb-service.sh" vboxweb-service55 install_init_script "${MY_PATH}/vboxdrv.sh" vboxdrv 56 install_init_script "${MY_PATH}/vboxballoonctrl-service.sh" vboxballoonctrl-service 57 install_init_script "${MY_PATH}/vboxautostart-service.sh" vboxautostart-service 58 install_init_script "${MY_PATH}/vboxweb-service.sh" vboxweb-service 59 59 finish_init_script_install 60 60 … … 68 68 addrunlevel vboxweb-service 69 69 70 ln -sf "$ MY_PATH/postinst-common.sh" /sbin/vboxconfig70 ln -sf "${MY_PATH}/postinst-common.sh" /sbin/vboxconfig 71 71 72 72 # Set SELinux permissions 73 73 # XXX SELinux: allow text relocation entries 74 74 if [ -x /usr/bin/chcon ]; then 75 chcon -t texrel_shlib_t ${MY_PATH}/*VBox* > /dev/null 2>&176 chcon -t texrel_shlib_t ${MY_PATH}/VBoxAuth.so \75 chcon -t texrel_shlib_t "${MY_PATH}"/*VBox* > /dev/null 2>&1 76 chcon -t texrel_shlib_t "${MY_PATH}"/VBoxAuth.so \ 77 77 > /dev/null 2>&1 78 chcon -t texrel_shlib_t ${MY_PATH}/VirtualBox.so \78 chcon -t texrel_shlib_t "${MY_PATH}"/VirtualBox.so \ 79 79 > /dev/null 2>&1 80 chcon -t texrel_shlib_t ${MY_PATH}/components/VBox*.so \80 chcon -t texrel_shlib_t "${MY_PATH}"/components/VBox*.so \ 81 81 > /dev/null 2>&1 82 chcon -t java_exec_t ${MY_PATH}/VirtualBox > /dev/null 2>&183 chcon -t java_exec_t ${MY_PATH}/VBoxSDL > /dev/null 2>&184 chcon -t java_exec_t ${MY_PATH}/VBoxHeadless \82 chcon -t java_exec_t "${MY_PATH}"/VirtualBox > /dev/null 2>&1 83 chcon -t java_exec_t "${MY_PATH}"/VBoxSDL > /dev/null 2>&1 84 chcon -t java_exec_t "${MY_PATH}"/VBoxHeadless \ 85 85 > /dev/null 2>&1 86 chcon -t java_exec_t ${MY_PATH}/VBoxNetDHCP \86 chcon -t java_exec_t "${MY_PATH}"/VBoxNetDHCP \ 87 87 > /dev/null 2>&1 88 chcon -t java_exec_t ${MY_PATH}/VBoxNetNAT \88 chcon -t java_exec_t "${MY_PATH}"/VBoxNetNAT \ 89 89 > /dev/null 2>&1 90 chcon -t java_exec_t ${MY_PATH}/VBoxExtPackHelperApp \90 chcon -t java_exec_t "${MY_PATH}"/VBoxExtPackHelperApp \ 91 91 > /dev/null 2>&1 92 chcon -t java_exec_t ${MY_PATH}/vboxwebsrv > /dev/null 2>&193 chcon -t bin_t ${MY_PATH}/src/vboxhost/build_in_tmp \92 chcon -t java_exec_t "${MY_PATH}"/vboxwebsrv > /dev/null 2>&1 93 chcon -t bin_t "${MY_PATH}"/src/vboxhost/build_in_tmp \ 94 94 > /dev/null 2>&1 95 95 chcon -t bin_t /usr/share/virtualbox/src/vboxhost/build_in_tmp \ … … 97 97 fi 98 98 99 test -n "$ START" &&99 test -n "${START}" && 100 100 { 101 if ! "$ MY_PATH/vboxdrv.sh" setup; then102 "$ MY_PATH/check_module_dependencies.sh" >&2101 if ! "${MY_PATH}/vboxdrv.sh" setup; then 102 "${MY_PATH}/check_module_dependencies.sh" >&2 103 103 echo >&2 104 104 echo "There were problems setting up VirtualBox. To re-start the set-up process, run" >&2 -
trunk/src/VBox/Installer/linux/uninstall.sh
r76610 r76611 39 39 40 40 # Find previous installation 41 if [ -r "$CONFIG_DIR/$CONFIG"]; then42 . $ {CONFIG_DIR}/$CONFIG43 PREV_INSTALLATION=$ {INSTALL_DIR}41 if [ -r $CONFIG_DIR/$CONFIG ]; then 42 . $CONFIG_DIR/$CONFIG 43 PREV_INSTALLATION=$INSTALL_DIR 44 44 fi 45 45 … … 93 93 /usr/bin/vboxdtrace \ 94 94 /usr/bin/vboxbugreport \ 95 $ {PREV_INSTALLATION}/components/VBoxVMM.so \96 $ {PREV_INSTALLATION}/components/VBoxREM.so \97 $ {PREV_INSTALLATION}/components/VBoxRT.so \98 $ {PREV_INSTALLATION}/components/VBoxDDU.so \99 $ {PREV_INSTALLATION}/components/VBoxXPCOM.so \95 $PREV_INSTALLATION/components/VBoxVMM.so \ 96 $PREV_INSTALLATION/components/VBoxREM.so \ 97 $PREV_INSTALLATION/components/VBoxRT.so \ 98 $PREV_INSTALLATION/components/VBoxDDU.so \ 99 $PREV_INSTALLATION/components/VBoxXPCOM.so \ 100 100 2> /dev/null 101 101 102 102 cwd=`pwd` 103 if [ -f $ {PREV_INSTALLATION}/src/Makefile ]; then104 cd $ {PREV_INSTALLATION}/src103 if [ -f $PREV_INSTALLATION/src/Makefile ]; then 104 cd $PREV_INSTALLATION/src 105 105 make clean > /dev/null 2>&1 106 106 fi 107 if [ -f $ {PREV_INSTALLATION}/src/vboxdrv/Makefile ]; then108 cd $ {PREV_INSTALLATION}/src/vboxdrv107 if [ -f $PREV_INSTALLATION/src/vboxdrv/Makefile ]; then 108 cd $PREV_INSTALLATION/src/vboxdrv 109 109 make clean > /dev/null 2>&1 110 110 fi 111 if [ -f $ {PREV_INSTALLATION}/src/vboxnetflt/Makefile ]; then112 cd $ {PREV_INSTALLATION}/src/vboxnetflt111 if [ -f $PREV_INSTALLATION/src/vboxnetflt/Makefile ]; then 112 cd $PREV_INSTALLATION/src/vboxnetflt 113 113 make clean > /dev/null 2>&1 114 114 fi 115 if [ -f $ {PREV_INSTALLATION}/src/vboxnetadp/Makefile ]; then116 cd $ {PREV_INSTALLATION}/src/vboxnetadp115 if [ -f $PREV_INSTALLATION/src/vboxnetadp/Makefile ]; then 116 cd $PREV_INSTALLATION/src/vboxnetadp 117 117 make clean > /dev/null 2>&1 118 118 fi 119 if [ -f $ {PREV_INSTALLATION}/src/vboxpci/Makefile ]; then120 cd $ {PREV_INSTALLATION}/src/vboxpci119 if [ -f $PREV_INSTALLATION/src/vboxpci/Makefile ]; then 120 cd $PREV_INSTALLATION/src/vboxpci 121 121 make clean > /dev/null 2>&1 122 122 fi 123 cd $ {PREV_INSTALLATION}124 if [ -r "$CONFIG_DIR/$CONFIG_FILES"]; then125 rm -f `cat $ {CONFIG_DIR}/$CONFIG_FILES` 2> /dev/null123 cd $PREV_INSTALLATION 124 if [ -r $CONFIG_DIR/$CONFIG_FILES ]; then 125 rm -f `cat $CONFIG_DIR/$CONFIG_FILES` 2> /dev/null 126 126 elif [ -n "$DEFAULT_FILES" -a -r "$DEFAULT_FILES" ]; then 127 127 DEFAULT_FILE_NAMES="" … … 131 131 done 132 132 fi 133 for file in `find $ {PREV_INSTALLATION}2> /dev/null`; do133 for file in `find $PREV_INSTALLATION 2> /dev/null`; do 134 134 rmdir -p $file 2> /dev/null 135 135 done 136 136 cd $cwd 137 mkdir -p $ {PREV_INSTALLATION}2> /dev/null # The above actually removes the current directory and parents!138 rmdir $ {PREV_INSTALLATION}2> /dev/null139 rm -r $ {CONFIG_DIR}/$CONFIG 2> /dev/null137 mkdir -p $PREV_INSTALLATION 2> /dev/null # The above actually removes the current directory and parents! 138 rmdir $PREV_INSTALLATION 2> /dev/null 139 rm -r $CONFIG_DIR/$CONFIG 2> /dev/null 140 140 141 141 if [ -z "$VBOX_NO_UNINSTALL_MESSAGE" ]; then 142 rm -r $ {CONFIG_DIR}/$CONFIG_FILES 2> /dev/null143 rmdir $ {CONFIG_DIR}2> /dev/null142 rm -r $CONFIG_DIR/$CONFIG_FILES 2> /dev/null 143 rmdir $CONFIG_DIR 2> /dev/null 144 144 [ -n "$INSTALL_REV" ] && INSTALL_REV=" r$INSTALL_REV" 145 145 info "VirtualBox $INSTALL_VER$INSTALL_REV has been removed successfully."
Note:
See TracChangeset
for help on using the changeset viewer.