Changeset 57808 in vbox for trunk/src/VBox/Installer/linux
- Timestamp:
- Sep 17, 2015 4:09:23 PM (9 years ago)
- Location:
- trunk/src/VBox/Installer/linux
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/Makefile.kmk
r57711 r57808 210 210 ExtensionPacks/VNC/ExtPack-license.rtf \ 211 211 ExtensionPacks/VNC/ExtPack-license.txt,) \ 212 postinst-common.sh \ 213 prerm-common.sh \ 214 routines.sh \ 212 215 VBoxSysInfo.sh \ 213 216 vboxautostart-service.sh \ -
trunk/src/VBox/Installer/linux/install.sh
r57711 r57808 348 348 fi 349 349 350 cp uninstall.sh routines.sh $INSTALLATION_DIR 351 echo "routines.sh" >> $CONFIG_DIR/$CONFIG_FILES 350 cp uninstall.sh $INSTALLATION_DIR 352 351 echo "uninstall.sh" >> $CONFIG_DIR/$CONFIG_FILES 353 352 -
trunk/src/VBox/Installer/linux/prerm-common.sh
r57712 r57808 50 50 remove_init_script vboxweb-service 51 51 # Stop kernel module and uninstall runlevel script 52 stop_init_script vboxdrv 52 stop_init_script vboxdrv 2>/dev/null 53 53 delrunlevel vboxdrv 54 54 remove_init_script vboxdrv -
trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
r57789 r57808 171 171 mv accessible $RPM_BUILD_ROOT/usr/lib/virtualbox 172 172 fi 173 install -D -m 755 vboxdrv.init $RPM_BUILD_ROOT%{_initrddir}/vboxdrv 174 ln -sf %{_initrddir}/vboxdrv $RPM_BUILD_ROOT/sbin/rcvboxdrv 175 install -D -m 755 vboxballoonctrl-service.init $RPM_BUILD_ROOT%{_initrddir}/vboxballoonctrl-service 176 install -D -m 755 vboxautostart-service.init $RPM_BUILD_ROOT%{_initrddir}/vboxautostart-service 177 install -D -m 755 vboxweb-service.init $RPM_BUILD_ROOT%{_initrddir}/vboxweb-service 178 %if %{?rpm_suse:1}%{!?rpm_suse:0} 179 ln -sf ../etc/init.d/vboxballoonctrl-service $RPM_BUILD_ROOT/sbin/rcvboxballoonctrl-service 180 ln -sf ../etc/init.d/vboxautostart-service $RPM_BUILD_ROOT/sbin/rcvboxautostart-service 181 ln -sf ../etc/init.d/vboxweb-service $RPM_BUILD_ROOT/sbin/rcvboxweb-service 182 %endif 173 mv vboxdrv.sh $RPM_BUILD_ROOT/usr/lib/virtualbox 174 ln -sf /usr/lib/virtualbox/vboxdrv.sh $RPM_BUILD_ROOT/sbin/rcvboxdrv 175 mv vboxballoonctrl-service.sh $RPM_BUILD_ROOT/usr/lib/virtualbox 176 ln -sf /usr/lib/virtualbox/vboxballoonctrl-service.sh $RPM_BUILD_ROOT/sbin/rcvboxballoonctrl-service 177 mv vboxautostart-service.sh $RPM_BUILD_ROOT/usr/lib/virtualbox 178 ln -sf /usr/lib/virtualbox/vboxautostart-service.sh $RPM_BUILD_ROOT/sbin/rcvboxautostart-service 179 mv vboxweb-service.sh $RPM_BUILD_ROOT/usr/lib/virtualbox 180 ln -sf /usr/lib/virtualbox/vboxweb-service.sh $RPM_BUILD_ROOT/sbin/rcvboxweb-service 181 mv postinst-common.sh $RPM_BUILD_ROOT/usr/lib/virtualbox 182 mv prerm-common.sh $RPM_BUILD_ROOT/usr/lib/virtualbox 183 mv routines.sh $RPM_BUILD_ROOT/usr/lib/virtualbox 183 184 ln -s VBox $RPM_BUILD_ROOT/usr/bin/VirtualBox 184 185 ln -s VBox $RPM_BUILD_ROOT/usr/bin/virtualbox … … 204 205 205 206 %pre 207 set -x 208 echo Running pre... 206 209 # defaults 207 210 [ -r /etc/default/virtualbox ] && . /etc/default/virtualbox 208 209 # check for active VMs of the installed (old) package210 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true`211 if [ -n "$VBOXSVC_PID" ]; then212 # executed before the new package is installed!213 if [ -f /etc/init.d/vboxballoonctrl-service ]; then214 # try graceful termination; terminate the balloon control service first215 /etc/init.d/vboxballoonctrl-service stop 2>/dev/null || true216 fi217 if [ -f /etc/init.d/vboxautostart-service ]; then218 # try graceful termination; terminate the autostart service first219 /etc/init.d/vboxautostart-service stop 2>/dev/null || true220 fi221 if [ -f /etc/init.d/vboxweb-service ]; then222 # try graceful termination; terminate the webservice first223 /etc/init.d/vboxweb-service stop 2>/dev/null || true224 fi225 # ask the daemon to terminate immediately226 kill -USR1 $VBOXSVC_PID227 sleep 1228 if pidof VBoxSVC > /dev/null 2>&1; then229 echo "A copy of VirtualBox is currently running. Please close it and try again."230 echo "Please note that it can take up to ten seconds for VirtualBox (in particular"231 echo "the VBoxSVC daemon) to finish running."232 exit 1233 fi234 fi235 211 236 212 # check for old installation … … 246 222 fi 247 223 224 # check for active VMs of the installed (old) package 225 # Execute the installed packages pre-uninstaller if present. 226 /usr/lib/virtualbox/prerm-common.sh 2>/dev/null 227 # Stop services from older versions without pre-uninstaller. 228 /etc/init.d/vboxballoonctrl-service stop 2>/dev/null 229 /etc/init.d/vboxautostart-service stop 2>/dev/null 230 /etc/init.d/vboxweb-service stop 2>/dev/null 231 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true` 232 if [ -n "$VBOXSVC_PID" ]; then 233 # ask the daemon to terminate immediately 234 kill -USR1 $VBOXSVC_PID 235 sleep 1 236 if pidof VBoxSVC > /dev/null 2>&1; then 237 echo "A copy of VirtualBox is currently running. Please close it and try again." 238 echo "Please note that it can take up to ten seconds for VirtualBox (in particular" 239 echo "the VBoxSVC daemon) to finish running." 240 exit 1 241 fi 242 fi 243 248 244 # XXX remove old modules from previous versions (disable with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox) 249 245 if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then … … 256 252 257 253 %post 254 set -x 255 echo Running post... 258 256 #include installer-common.sh 259 257 … … 290 288 # and /dev/vboxdrv and /dev/vboxusb/*/* device nodes 291 289 install_device_node_setup root 0600 /usr/share/virtualbox "${usb_group}" 292 %if %{?rpm_redhat:1}%{!?rpm_redhat:0}293 /sbin/chkconfig --add vboxdrv294 /sbin/chkconfig --add vboxballoonctrl-service295 /sbin/chkconfig --add vboxautostart-service296 /sbin/chkconfig --add vboxweb-service297 %endif298 %if %{?rpm_suse:1}%{!?rpm_suse:0}299 %{fillup_and_insserv -f -y -Y vboxdrv vboxballoonctrl-service vboxautostart-service vboxweb-service}300 %endif301 290 %if %{?rpm_mdv:1}%{!?rpm_mdv:0} 302 291 /sbin/ldconfig 303 %_post_service vboxdrv304 %_post_service vboxballoonctrl-service305 %_post_service vboxautostart-service306 %_post_service vboxweb-service307 292 %update_menus 308 293 %endif … … 335 320 fi 336 321 if [ $BUILD_MODULES -eq 1 ]; then 337 / etc/init.d/vboxdrv setup || true322 /sbin/rcvboxdrv setup || true 338 323 else 339 324 if lsmod | grep -q "vboxdrv[^_-]"; then 340 / etc/init.d/vboxdrv stop || true325 /sbin/rcvboxdrv stop || true 341 326 fi 342 327 if [ $REGISTER_MODULES -eq 1 ]; then … … 346 331 fi 347 332 fi 348 /etc/init.d/vboxdrv start > /dev/null 349 fi 350 /etc/init.d/vboxballoonctrl-service start > /dev/null 351 /etc/init.d/vboxautostart-service start > /dev/null 352 /etc/init.d/vboxweb-service start > /dev/null 333 fi 334 # Install and start the new service scripts. 335 /usr/lib/virtualbox/prerm-common.sh 336 /usr/lib/virtualbox/postinst-common.sh /usr/lib/virtualbox --start > /dev/null 353 337 354 338 355 339 %preun 340 set -x 341 echo Running preun... 356 342 # $1==0: remove the last version of the package 357 343 # $1==1: install the first time 358 344 # $1>=2: upgrade 359 %if %{?rpm_suse:1}%{!?rpm_suse:0}360 %stop_on_removal vboxballoonctrl-service361 %stop_on_removal vboxautostart-service362 %stop_on_removal vboxweb-service363 %endif364 %if %{?rpm_mdv:1}%{!?rpm_mdv:0}365 %_preun_service vboxballoonctrl-service366 %_preun_service vboxautostart-service367 %_preun_service vboxweb-service368 %endif369 %if %{?rpm_redhat:1}%{!?rpm_redhat:0}370 345 if [ "$1" = 0 ]; then 371 /sbin/service vboxballoonctrl-service stop > /dev/null 372 /sbin/chkconfig --del vboxballoonctrl-service 373 /sbin/service vboxautostart-service stop > /dev/null 374 /sbin/chkconfig --del vboxautostart-service 375 /sbin/service vboxweb-service stop > /dev/null 376 /sbin/chkconfig --del vboxweb-service 377 fi 378 %endif 379 380 if [ "$1" = 0 ]; then 381 # check for active VMs 382 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true` 383 if [ -n "$VBOXSVC_PID" ]; then 384 kill -USR1 $VBOXSVC_PID 385 sleep 1 386 if pidof VBoxSVC > /dev/null 2>&1; then 387 echo "A copy of VirtualBox is currently running. Please close it and try again." 388 echo "Please note that it can take up to ten seconds for VirtualBox (in particular" 389 echo "the VBoxSVC daemon) to finish running." 390 exit 1 391 fi 392 fi 393 fi 394 %if %{?rpm_suse:1}%{!?rpm_suse:0} 395 %stop_on_removal vboxdrv 396 %endif 397 %if %{?rpm_mdv:1}%{!?rpm_mdv:0} 398 %_preun_service vboxdrv 399 %endif 400 if [ "$1" = 0 ]; then 401 %if %{?rpm_redhat:1}%{!?rpm_redhat:0} 402 /sbin/service vboxdrv stop > /dev/null 403 /sbin/chkconfig --del vboxdrv 404 %endif 346 /usr/lib/virtualbox/prerm-common.sh || exit 1 405 347 rm -f /etc/udev/rules.d/60-vboxdrv.rules 406 348 rm -f /etc/vbox/license_agreed … … 414 356 415 357 %postun 416 %if %{?rpm_redhat:1}%{!?rpm_redhat:0} 417 if [ "$1" -ge 1 ]; then 418 /sbin/service vboxdrv restart > /dev/null 2>&1 419 /sbin/service vboxballoonctrl-service restart > /dev/null 2>&1 420 /sbin/service vboxautostart-service restart > /dev/null 2>&1 421 /sbin/service vboxweb-service restart > /dev/null 2>&1 422 fi 423 %endif 424 %if %{?rpm_suse:1}%{!?rpm_suse:0} 425 %restart_on_update vboxdrv vboxballoonctrl-service vboxautostart-service vboxweb-service 426 %insserv_cleanup 427 %endif 358 set -x 359 echo Running postun... 428 360 %if %{?rpm_mdv:1}%{!?rpm_mdv:0} 429 361 /sbin/ldconfig … … 447 379 %doc UserManual*.pdf 448 380 %doc %{!?is_ose: VirtualBox*.chm} 449 %{_initrddir}/vboxdrv450 %{_initrddir}/vboxballoonctrl-service451 %{_initrddir}/vboxautostart-service452 %{_initrddir}/vboxweb-service453 381 %{?rpm_suse: %{py_sitedir}/*} 454 382 %{!?rpm_suse: %{python_sitelib}/*} 455 383 /sbin/rcvboxdrv 456 %{?rpm_suse: /sbin/rcvboxballoonctrl-service} 457 %{?rpm_suse: /sbin/rcvboxautostart-service} 458 %{?rpm_suse: /sbin/rcvboxweb-service} 384 /sbin/rcvboxballoonctrl-service 385 /sbin/rcvboxautostart-service 386 /sbin/rcvboxweb-service 459 387 /etc/vbox 460 388 /usr/bin/* -
trunk/src/VBox/Installer/linux/rpm/rules
r57807 r57808 249 249 -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \ 250 250 -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \ 251 vboxdrv.sh.in > $(archdir)/vboxdrv. init252 cp vboxballoonctrl-service.sh $(archdir) /vboxballoonctrl-service.init253 cp vboxautostart-service.sh $(archdir) /vboxautostart-service.init254 cp vboxweb-service.sh $(archdir) /vboxweb-service.init251 vboxdrv.sh.in > $(archdir)/vboxdrv.sh 252 cp vboxballoonctrl-service.sh $(archdir) 253 cp vboxautostart-service.sh $(archdir) 254 cp vboxweb-service.sh $(archdir) 255 255 cp VBox.sh $(archdir) 256 256 mv rpm/VirtualBox-$(ver) rpm/$(rpmname)
Note:
See TracChangeset
for help on using the changeset viewer.