Changeset 57809 in vbox for trunk/src/VBox/Installer/linux
- Timestamp:
- Sep 17, 2015 4:12:55 PM (9 years ago)
- Location:
- trunk/src/VBox/Installer/linux
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/Makefile.kmk
r57808 r57809 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 \215 212 VBoxSysInfo.sh \ 216 213 vboxautostart-service.sh \ -
trunk/src/VBox/Installer/linux/install.sh
r57808 r57809 348 348 fi 349 349 350 cp uninstall.sh $INSTALLATION_DIR 350 cp uninstall.sh routines.sh $INSTALLATION_DIR 351 echo "routines.sh" >> $CONFIG_DIR/$CONFIG_FILES 351 352 echo "uninstall.sh" >> $CONFIG_DIR/$CONFIG_FILES 352 353 -
trunk/src/VBox/Installer/linux/prerm-common.sh
r57808 r57809 50 50 remove_init_script vboxweb-service 51 51 # Stop kernel module and uninstall runlevel script 52 stop_init_script vboxdrv 2>/dev/null52 stop_init_script vboxdrv 53 53 delrunlevel vboxdrv 54 54 remove_init_script vboxdrv -
trunk/src/VBox/Installer/linux/rpm/VirtualBox.tmpl.spec
r57808 r57809 171 171 mv accessible $RPM_BUILD_ROOT/usr/lib/virtualbox 172 172 fi 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 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 184 183 ln -s VBox $RPM_BUILD_ROOT/usr/bin/VirtualBox 185 184 ln -s VBox $RPM_BUILD_ROOT/usr/bin/virtualbox … … 205 204 206 205 %pre 207 set -x208 echo Running pre...209 206 # defaults 210 207 [ -r /etc/default/virtualbox ] && . /etc/default/virtualbox 208 209 # check for active VMs of the installed (old) package 210 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true` 211 if [ -n "$VBOXSVC_PID" ]; then 212 # executed before the new package is installed! 213 if [ -f /etc/init.d/vboxballoonctrl-service ]; then 214 # try graceful termination; terminate the balloon control service first 215 /etc/init.d/vboxballoonctrl-service stop 2>/dev/null || true 216 fi 217 if [ -f /etc/init.d/vboxautostart-service ]; then 218 # try graceful termination; terminate the autostart service first 219 /etc/init.d/vboxautostart-service stop 2>/dev/null || true 220 fi 221 if [ -f /etc/init.d/vboxweb-service ]; then 222 # try graceful termination; terminate the webservice first 223 /etc/init.d/vboxweb-service stop 2>/dev/null || true 224 fi 225 # ask the daemon to terminate immediately 226 kill -USR1 $VBOXSVC_PID 227 sleep 1 228 if pidof VBoxSVC > /dev/null 2>&1; then 229 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 1 233 fi 234 fi 211 235 212 236 # check for old installation … … 222 246 fi 223 247 224 # check for active VMs of the installed (old) package225 # Execute the installed packages pre-uninstaller if present.226 /usr/lib/virtualbox/prerm-common.sh 2>/dev/null227 # Stop services from older versions without pre-uninstaller.228 /etc/init.d/vboxballoonctrl-service stop 2>/dev/null229 /etc/init.d/vboxautostart-service stop 2>/dev/null230 /etc/init.d/vboxweb-service stop 2>/dev/null231 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true`232 if [ -n "$VBOXSVC_PID" ]; then233 # ask the daemon to terminate immediately234 kill -USR1 $VBOXSVC_PID235 sleep 1236 if pidof VBoxSVC > /dev/null 2>&1; then237 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 1241 fi242 fi243 244 248 # XXX remove old modules from previous versions (disable with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox) 245 249 if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then … … 252 256 253 257 %post 254 set -x255 echo Running post...256 258 #include installer-common.sh 257 259 … … 288 290 # and /dev/vboxdrv and /dev/vboxusb/*/* device nodes 289 291 install_device_node_setup root 0600 /usr/share/virtualbox "${usb_group}" 292 %if %{?rpm_redhat:1}%{!?rpm_redhat:0} 293 /sbin/chkconfig --add vboxdrv 294 /sbin/chkconfig --add vboxballoonctrl-service 295 /sbin/chkconfig --add vboxautostart-service 296 /sbin/chkconfig --add vboxweb-service 297 %endif 298 %if %{?rpm_suse:1}%{!?rpm_suse:0} 299 %{fillup_and_insserv -f -y -Y vboxdrv vboxballoonctrl-service vboxautostart-service vboxweb-service} 300 %endif 290 301 %if %{?rpm_mdv:1}%{!?rpm_mdv:0} 291 302 /sbin/ldconfig 303 %_post_service vboxdrv 304 %_post_service vboxballoonctrl-service 305 %_post_service vboxautostart-service 306 %_post_service vboxweb-service 292 307 %update_menus 293 308 %endif … … 320 335 fi 321 336 if [ $BUILD_MODULES -eq 1 ]; then 322 / sbin/rcvboxdrv setup || true337 /etc/init.d/vboxdrv setup || true 323 338 else 324 339 if lsmod | grep -q "vboxdrv[^_-]"; then 325 / sbin/rcvboxdrv stop || true340 /etc/init.d/vboxdrv stop || true 326 341 fi 327 342 if [ $REGISTER_MODULES -eq 1 ]; then … … 331 346 fi 332 347 fi 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 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 337 353 338 354 339 355 %preun 340 set -x341 echo Running preun...342 356 # $1==0: remove the last version of the package 343 357 # $1==1: install the first time 344 358 # $1>=2: upgrade 359 %if %{?rpm_suse:1}%{!?rpm_suse:0} 360 %stop_on_removal vboxballoonctrl-service 361 %stop_on_removal vboxautostart-service 362 %stop_on_removal vboxweb-service 363 %endif 364 %if %{?rpm_mdv:1}%{!?rpm_mdv:0} 365 %_preun_service vboxballoonctrl-service 366 %_preun_service vboxautostart-service 367 %_preun_service vboxweb-service 368 %endif 369 %if %{?rpm_redhat:1}%{!?rpm_redhat:0} 345 370 if [ "$1" = 0 ]; then 346 /usr/lib/virtualbox/prerm-common.sh || exit 1 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 347 405 rm -f /etc/udev/rules.d/60-vboxdrv.rules 348 406 rm -f /etc/vbox/license_agreed … … 356 414 357 415 %postun 358 set -x 359 echo Running 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 360 428 %if %{?rpm_mdv:1}%{!?rpm_mdv:0} 361 429 /sbin/ldconfig … … 379 447 %doc UserManual*.pdf 380 448 %doc %{!?is_ose: VirtualBox*.chm} 449 %{_initrddir}/vboxdrv 450 %{_initrddir}/vboxballoonctrl-service 451 %{_initrddir}/vboxautostart-service 452 %{_initrddir}/vboxweb-service 381 453 %{?rpm_suse: %{py_sitedir}/*} 382 454 %{!?rpm_suse: %{python_sitelib}/*} 383 455 /sbin/rcvboxdrv 384 /sbin/rcvboxballoonctrl-service 385 /sbin/rcvboxautostart-service 386 /sbin/rcvboxweb-service 456 %{?rpm_suse: /sbin/rcvboxballoonctrl-service} 457 %{?rpm_suse: /sbin/rcvboxautostart-service} 458 %{?rpm_suse: /sbin/rcvboxweb-service} 387 459 /etc/vbox 388 460 /usr/bin/* -
trunk/src/VBox/Installer/linux/rpm/rules
r57808 r57809 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. sh252 cp vboxballoonctrl-service.sh $(archdir) 253 cp vboxautostart-service.sh $(archdir) 254 cp vboxweb-service.sh $(archdir) 251 vboxdrv.sh.in > $(archdir)/vboxdrv.init 252 cp vboxballoonctrl-service.sh $(archdir)/vboxballoonctrl-service.init 253 cp vboxautostart-service.sh $(archdir)/vboxautostart-service.init 254 cp vboxweb-service.sh $(archdir)/vboxweb-service.init 255 255 cp VBox.sh $(archdir) 256 256 mv rpm/VirtualBox-$(ver) rpm/$(rpmname)
Note:
See TracChangeset
for help on using the changeset viewer.