Changeset 57940 in vbox for trunk/src/VBox/Installer/linux
- Timestamp:
- Sep 29, 2015 1:21:14 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 102914
- Location:
- trunk/src/VBox/Installer/linux
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/install.sh
r57876 r57940 130 130 create_log $LOG 131 131 132 # Now stop the autostart service otherwise it will keep VBoxSVC running133 stop_init_script vboxautostart-service134 135 # Now stop the ballon control service otherwise it will keep VBoxSVC running136 stop_init_script vboxballoonctrl-service137 138 # Now stop the web service otherwise it will keep VBoxSVC running139 stop_init_script vboxweb-service140 141 # Now check if no VBoxSVC daemon is running142 check_running143 144 132 log "VirtualBox $VERSION r$SVNREV installer, built $BUILD." 145 133 log "" … … 162 150 fi 163 151 164 # Check that the system is setup correctly for the installation165 have_bzip2="`check_bzip2; echo $?`" # Do we have bzip2?166 have_gmake="`check_gmake; echo $?`" # Do we have GNU make?167 have_ksource="`check_ksource; echo $?`" # Can we find the kernel source?168 have_gcc="`check_gcc; echo $?`" # Is GCC installed?169 170 if [ $have_bzip2 -eq 1 -o $have_gmake -eq 1 -o $have_ksource -eq 1 \171 -o $have_gcc -eq 1 ]; then172 info "Problems were found which would prevent VirtualBox from installing."173 info "Please correct these problems and try again."174 log "Giving up due to the problems mentioned above."175 exit 1176 else177 log "System setup appears correct."178 log ""179 fi180 181 152 # Sensible default actions 182 153 ACTION="install" … … 221 192 222 193 # Find previous installation 223 if [ ! -r $CONFIG_DIR/$CONFIG ]; then 224 mkdir -p -m 755 $CONFIG_DIR 225 touch $CONFIG_DIR/$CONFIG 226 else 194 if test -r "$CONFIG_DIR/$CONFIG"; then 227 195 . $CONFIG_DIR/$CONFIG 228 196 PREV_INSTALLATION=$INSTALL_DIR … … 247 215 fi 248 216 249 # Terminate Server and VBoxNetDHCP if running250 terminate_proc VBoxSVC251 terminate_proc VBoxNetDHCP252 terminate_proc VBoxNetNAT253 254 217 # Remove previous installation 255 if [ -n "$PREV_INSTALLATION" -a -z "$FORCE_UPGRADE" -a ! "$VERSION" = "$INSTALL_VER" ] &&256 expr "$INSTALL_VER" "<" "1.6.0" > /dev/null 2>&1257 then258 info259 info "If you are upgrading from VirtualBox 1.5 or older and if some of your virtual"260 info "machines have saved states, then the saved state information will be lost"261 info "after the upgrade and will have to be discarded. If you do not want this then"262 info "you can cancel the upgrade now."263 info264 info "Do you wish to continue? [yes or no]"265 read reply dummy266 if ! expr "$reply" : [yY] && ! expr "$reply" : [yY][eE][sS]267 then268 info269 info "Cancelling upgrade."270 log "User requested cancellation of the installation"271 exit 1272 fi273 fi274 275 218 if [ ! "$VERSION" = "$INSTALL_VER" -a ! "$BUILD_MODULE" = "true" -a -n "$DKMS" ] 276 219 then … … 279 222 BUILD_MODULE=true 280 223 fi 224 test "${BUILD_MODULE}" = true || VBOX_DONT_REMOVE_OLD_MODULES=1 281 225 282 226 if [ -n "$PREV_INSTALLATION" ]; then … … 286 230 log "" 287 231 288 stop_init_script vboxnet >/dev/null 2>&1 # Do we need this?289 delrunlevel vboxnet > /dev/null 2>&1290 if [ "$BUILD_MODULE" = "true" ]; then291 stop_init_script vboxdrv292 if [ -n "$DKMS" ]293 then294 $DKMS remove -m vboxhost -v $INSTALL_VER --all > /dev/null 2>&1295 $DKMS remove -m vboxdrv -v $INSTALL_VER --all > /dev/null 2>&1296 $DKMS remove -m vboxnetflt -v $INSTALL_VER --all > /dev/null 2>&1297 $DKMS remove -m vboxnetadp -v $INSTALL_VER --all > /dev/null 2>&1298 fi299 # OSE doesn't always have the initscript300 rmmod vboxpci > /dev/null 2>&1301 rmmod vboxnetadp > /dev/null 2>&1302 rmmod vboxnetflt > /dev/null 2>&1303 rmmod vboxdrv > /dev/null 2>&1304 305 module_loaded && {306 info "Warning: could not stop VirtualBox kernel module."307 info "Please restart your system to apply changes."308 log "Unable to remove the old VirtualBox kernel module."309 log " An old version of VirtualBox may be running."310 }311 else312 VBOX_DONT_REMOVE_OLD_MODULES=1313 fi314 315 232 VBOX_NO_UNINSTALL_MESSAGE=1 233 # This also checks $BUILD_MODULE and $VBOX_DONT_REMOVE_OLD_MODULES 316 234 . ./uninstall.sh 317 318 fi 235 fi 236 237 mkdir -p -m 755 $CONFIG_DIR 238 touch $CONFIG_DIR/$CONFIG 319 239 320 240 info "Installing VirtualBox to $INSTALLATION_DIR" … … 324 244 # Verify the archive 325 245 mkdir -p -m 755 $INSTALLATION_DIR 326 bzip2 -d -c VirtualBox.tar.bz2 | tar -tf - > $CONFIG_DIR/$CONFIG_FILES 327 RETVAL=$? 328 if [ $RETVAL != 0 ]; then 246 bzip2 -d -c VirtualBox.tar.bz2 > VirtualBox.tar 247 if ! tar -tf VirtualBox.tar > $CONFIG_DIR/$CONFIG_FILES; then 329 248 rmdir $INSTALLATION_DIR 2> /dev/null 330 249 rm -f $CONFIG_DIR/$CONFIG 2> /dev/null 331 250 rm -f $CONFIG_DIR/$CONFIG_FILES 2> /dev/null 332 log 'Error running "bzip2 -d -c VirtualBox.tar.bz2 | tar -tf - > '"$CONFIG_DIR/$CONFIG_FILES"'".'251 log 'Error running "bzip2 -d -c VirtualBox.tar.bz2" or "tar -tf VirtualBox.tar".' 333 252 abort "Error installing VirtualBox. Installation aborted" 334 253 fi 335 254 336 255 # Create installation directory and install 337 bzip2 -d -c VirtualBox.tar.bz2 | tar -xf - -C $INSTALLATION_DIR 338 RETVAL=$? 339 if [ $RETVAL != 0 ]; then 256 if ! tar -xf VirtualBox.tar -C $INSTALLATION_DIR; then 340 257 cwd=`pwd` 341 258 cd $INSTALLATION_DIR … … 344 261 rmdir $INSTALLATION_DIR 2> /dev/null 345 262 rm -f $CONFIG_DIR/$CONFIG 2> /dev/null 346 log 'Error running " bzip2 -d -c VirtualBox.tar.bz2 | tar -xf --C '"$INSTALLATION_DIR"'".'263 log 'Error running "tar -xf VirtualBox.tar -C '"$INSTALLATION_DIR"'".' 347 264 abort "Error installing VirtualBox. Installation aborted" 348 265 fi … … 461 378 cur=`pwd` 462 379 log "" 463 ./vboxdrv.sh setup464 380 # Start VirtualBox kernel module 465 if [ $RETVAL -eq 0 ] &&! ./vboxdrv.sh start; then381 if ! ./vboxdrv.sh setup || ! ./vboxdrv.sh start; then 466 382 info "Failed to load the kernel module." 467 383 MODULE_FAILED="true" -
trunk/src/VBox/Installer/linux/routines.sh
r57876 r57940 107 107 fi 108 108 fi 109 }110 111 ## Do we have bzip2?112 check_bzip2()113 {114 if ! ls /bin/bzip2 /usr/bin/bzip2 /usr/local/bin/bzip2 2> /dev/null | grep bzip2 > /dev/null; then115 echo 1>&2 "Please install the bzip2 utility."116 log "Please install bzip2."117 return 1118 fi119 return 0120 }121 122 ## Do we have GNU make?123 check_gmake()124 {125 make --version 2>&1 | grep GNU > /dev/null126 if [ ! $? = 0 ]; then127 echo 1>&2 "Please install GNU make."128 log "Please install GNU make."129 return 1130 fi131 return 0132 }133 134 ## Can we find the kernel source?135 check_ksource()136 {137 ro_KBUILD_DIR=/lib/modules/`uname -r`/build138 if [ ! -d $ro_KBUILD_DIR/include ]; then139 ro_KBUILD_DIR=/usr/src/linux140 if [ ! -d $ro_KBUILD_DIR/include ]; then141 echo 1>&2 "Please install the build and header files for your current Linux kernel."142 echo 1>&2 "The current kernel version is `uname -r`"143 ro_KBUILD_DIR=""144 log "Could not find the Linux kernel header files - the directories"145 log " /lib/modules/`uname -r`/build/include and /usr/src/linux/include"146 log " do not exist."147 return 1148 fi149 fi150 return 0151 }152 153 ## Is GCC installed?154 check_gcc()155 {156 ro_gcc_version=`gcc --version 2> /dev/null | head -n 1`157 if [ "$ro_gcc_version" = "" ]; then158 echo 1>&2 "Please install the GNU compiler."159 log "Please install the GNU compiler."160 return 1161 fi # GCC installed162 return 0163 }164 165 ## Is bash installed? You never know...166 check_bash()167 {168 if [ ! -x /bin/bash ]; then169 echo 1>&2 "Please install GNU bash."170 log "Please install GNU bash."171 return 1172 fi173 return 0174 }175 176 ## Is perl installed?177 check_perl()178 {179 if [ ! `perl -e 'print "test"' 2> /dev/null` = "test" ]; then180 echo 1>&2 "Please install perl."181 echo "Please install perl."182 return 1183 fi184 return 0185 109 } 186 110 -
trunk/src/VBox/Installer/linux/run-inst.sh
r56887 r57940 177 177 178 178 info "$PACKAGE_NAME installer" 179 180 check_bzip2181 179 182 180 # Check architecture -
trunk/src/VBox/Installer/linux/uninstall.sh
r57711 r57940 50 50 # Do pre-removal common to all installer types, currently service script 51 51 # clean-up. 52 ./prerm-common.sh 52 test "${BUILD_MODULE}" = true && DO_DKMS="--dkms ${INSTALL_VER}" 53 `dirname $0`/prerm-common.sh ${DO_DKMS} || exit 1 # Arguments intentionally not quoted. 53 54 54 55 # Remove kernel module installed
Note:
See TracChangeset
for help on using the changeset viewer.