Changeset 57888 in vbox for trunk/src/VBox/Installer/linux
- Timestamp:
- Sep 24, 2015 6:50:06 PM (9 years ago)
- Location:
- trunk/src/VBox/Installer/linux/debian
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/linux/debian/postinst.in
r56299 r57888 90 90 #DEBHELPER# 91 91 92 if [ "$1" = "configure" ]; then 93 # Start vboxdrv/vboxballoonctrl/vboxweb-service manually as we use our own error handling in postrm 94 if [ -x "/etc/init.d/vboxdrv" ]; then 95 update-rc.d vboxdrv defaults 20 80 >/dev/null 96 97 BUILD_MODULES=0 98 REGISTER_MODULES=1 99 # Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox 100 if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then 101 REGISTER_MODULES=0 102 if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then 103 db_get virtualbox/module-compilation-allowed 104 if [ "$RET" = "false" ]; then 105 cat << EOF 92 BUILD_MODULES=0 93 REGISTER_MODULES=1 94 # Disable module compilation with INSTALL_NO_VBOXDRV=1 in /etc/default/virtualbox 95 if [ ! -f /lib/modules/`uname -r`/misc/vboxdrv.ko ]; then 96 REGISTER_MODULES=0 97 if [ "$1" = "configure" ]; then 98 if [ "$INSTALL_NO_VBOXDRV" != "1" ]; then 99 db_get virtualbox/module-compilation-allowed 100 if [ "$RET" = "false" ]; then 101 cat << EOF 106 102 Unable to find a precompiled module for the current kernel 107 103 though module compilation denied by debconf setting. 108 104 EOF 109 else 110 db_input low virtualbox/module-compilation-allowed || true 111 db_go || true 112 db_get virtualbox/module-compilation-allowed 113 if [ "$RET" = "true" ]; then 114 BUILD_MODULES=1 115 fi 105 else 106 db_input low virtualbox/module-compilation-allowed || true 107 db_go || true 108 db_get virtualbox/module-compilation-allowed 109 if [ "$RET" = "true" ]; then 110 BUILD_MODULES=1 116 111 fi 117 112 fi 118 113 fi 114 fi # $1 = "configure" 115 fi 119 116 120 if [ $BUILD_MODULES -eq 1 ]; then 121 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then 122 invoke-rc.d vboxdrv setup || true 123 else 124 /etc/init.d/vboxdrv setup || true 125 fi 126 else 127 # shipped modules found, register sources at DKMS anyway 128 if lsmod | grep -q "vboxdrv[^_-]"; then 129 /etc/init.d/vboxdrv stop || true 130 fi 131 if [ $REGISTER_MODULES -eq 1 ]; then 132 DKMS=`which dkms 2>/dev/null` 133 if [ -n "$DKMS" ]; then 134 $DKMS add -m vboxhost -v %VER% > /dev/null 2>&1 || true 135 fi 136 fi 137 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then 138 invoke-rc.d vboxdrv start || exit $? 139 else 140 /etc/init.d/vboxdrv start || exit $? 141 fi 142 fi 143 fi 144 if [ -x "/etc/init.d/vboxballoonctrl-service" ]; then 145 update-rc.d vboxballoonctrl-service defaults 35 65 >/dev/null 146 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then 147 invoke-rc.d vboxballoonctrl-service start || exit $? 148 else 149 /etc/init.d/vboxballoonctrl-service start || exit $? 150 fi 151 fi 152 if [ -x "/etc/init.d/vboxautostart-service" ]; then 153 update-rc.d vboxautostart-service defaults 35 65 >/dev/null 154 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then 155 invoke-rc.d vboxautostart-service start || exit $? 156 else 157 /etc/init.d/vboxautostart-service start || exit $? 158 fi 159 fi 160 if [ -x "/etc/init.d/vboxweb-service" ]; then 161 update-rc.d vboxweb-service defaults 35 65 >/dev/null 162 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then 163 invoke-rc.d vboxweb-service start || exit $? 164 else 165 /etc/init.d/vboxweb-service start || exit $? 166 fi 167 fi 117 if [ $BUILD_MODULES -eq 1 ]; then 118 /usr/lib/virtualbox/vboxdrv.sh setup || true 119 fi 168 120 169 fi # $1 = "configure" 121 # Install and start the new service scripts. 122 PRERM_DKMS= 123 test "${REGISTER_MODULES}" = 1 && PRERM_DKMS="--dkms %VER%" 124 POSTINST_START=--start 125 test "${INSTALL_NO_VBOXDRV}" = 1 && POSTINST_START= 126 /usr/lib/virtualbox/prerm-common.sh ${PRERM_DKMS} || true 127 /usr/lib/virtualbox/postinst-common.sh /usr/lib/virtualbox "${POSTINST_START}" > /dev/null || true 170 128 171 129 exit 0 -
trunk/src/VBox/Installer/linux/debian/preinst.in
r56299 r57888 26 26 db_capb backup 27 27 28 # check for active VMs29 VBOXSVC_PID=`pidof VBoxSVC 2> /dev/null || true`30 if [ -n "$VBOXSVC_PID" ]; then31 if [ -f /etc/init.d/vboxballoonctrl-service ]; then32 # try graceful termination; terminate the ballon control service first33 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then34 invoke-rc.d vboxballoonctrl-service stop || true35 else36 /etc/init.d/vboxballoonctrl-service stop || true37 fi38 fi39 if [ -f /etc/init.d/vboxweb-service ]; then40 # try graceful termination; terminate the webservice first41 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then42 invoke-rc.d vboxweb-service stop || true43 else44 /etc/init.d/vboxweb-service stop || true45 fi46 fi47 kill -USR1 $VBOXSVC_PID48 sleep 149 if pidof VBoxSVC > /dev/null 2>&1; then50 db_fset virtualbox/old-running seen false || true51 db_input critical virtualbox/old-running || true52 db_go || true53 exit 154 fi55 fi56 57 28 # check for old installation 58 29 if [ -r /etc/vbox/vbox.cfg ]; then … … 65 36 fi 66 37 # we will remove that file in postinst 38 fi 39 40 # check for active VMs 41 # Execute the installed package's pre-uninstaller if present. 42 /usr/lib/virtualbox/prerm-common.sh 2>/dev/null || true 43 # Stop services from older versions without pre-uninstaller. 44 invoke-rc.d vboxballoonctrl-service stop 2>/dev/null || true 45 /etc/init.d/vboxballoonctrl-service stop 2>/dev/null || true 46 invoke-rc.d vboxautostart-service stop 2>/dev/null || true 47 /etc/init.d/vboxautostart-service stop 2>/dev/null || true 48 invoke-rc.d vboxweb-service stop 2>/dev/null || true 49 /etc/init.d/vboxweb-service stop 2>/dev/null || true 50 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null || true` 51 if [ -n "$VBOXSVC_PID" ]; then 52 # ask the daemon to terminate immediately 53 kill -USR1 $VBOXSVC_PID 54 sleep 1 55 if pidof VBoxSVC > /dev/null 2>&1; then 56 db_fset virtualbox/old-running seen false || true 57 db_input critical virtualbox/old-running || true 58 db_go || true 59 exit 1 60 fi 67 61 fi 68 62 -
trunk/src/VBox/Installer/linux/debian/prerm.in
r56299 r57888 17 17 # failed-upgrade: (our version): failed to upgrade 18 18 # remove: (our version): remove this package 19 # purge: (our version): purge this package20 19 # deconfigure: (our version): removing conflicting version 21 20 … … 27 26 [ -r /etc/default/virtualbox ] && . /etc/default/virtualbox 28 27 29 if [ "$1" = "upgrade" -o "$1" = "remove" -o "$1" = "failed-upgrade" ]; then 30 . /usr/share/debconf/confmodule 31 db_version 2.0 32 db_capb backup 28 . /usr/share/debconf/confmodule 29 db_version 2.0 30 db_capb backup 33 31 34 # check for active VMs 35 VBOXSVC_PID=`pidof VBoxSVC 2>/dev/null` 36 if [ -n "$VBOXSVC_PID" ]; then 37 # try graceful termination; terminate the balloon control servic first 38 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then 39 invoke-rc.d vboxballoonctrl-service stop || true 40 else 41 /etc/init.d/vboxballoonctrl-service stop || true 42 fi 43 # try graceful termination; terminate the webservice first 44 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then 45 invoke-rc.d vboxweb-service stop || true 46 else 47 /etc/init.d/vboxweb-service stop || true 48 fi 49 kill -USR1 $VBOXSVC_PID 50 sleep 1 51 if pidof VBoxSVC > /dev/null 2>&1; then 52 if [ "$1" != "failed-upgrade" ]; then 53 db_fset virtualbox/old-running seen false || true 54 db_input critical virtualbox/old-running || true 55 db_go || true 56 fi 57 exit 1 58 fi 32 if ! /usr/lib/virtualbox/prerm-common.sh --dkms %VER% > /dev/null 2>&1; then 33 if [ "$1" != "failed-upgrade" ]; then 34 db_fset virtualbox/old-running seen false || true 35 db_input critical virtualbox/old-running || true 36 db_go || true 59 37 fi 60 fi 61 62 # make sure we de-register the DMKS modules before the files get removed 63 if [ "$1" = "upgrade" -o "$1" = "remove" -o "$1" = "deconfigure" ]; then 64 DKMS=`which dkms 2>/dev/null` 65 if [ -n "$DKMS" ]; then 66 $DKMS remove -m vboxhost -v %VER% --all > /dev/null 2>&1 || true 67 fi 68 fi 69 70 # stop vboxnet/vboxdrv manually as we use our own error handling in postrm 71 if [ -x "/etc/init.d/vboxdrv" ]; then 72 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then 73 invoke-rc.d vboxdrv stop || exit $? 74 else 75 /etc/init.d/vboxdrv stop || exit $? 76 fi 77 fi 78 if [ -x "/etc/init.d/vboxnet" ]; then 79 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then 80 invoke-rc.d vboxnet stop || exit $? 81 else 82 /etc/init.d/vboxnet stop || exit $? 83 fi 38 exit 1 84 39 fi 85 40 -
trunk/src/VBox/Installer/linux/debian/rules
r57887 r57888 242 242 mv $(archdir) $(prefix)/usr/lib/$(package) 243 243 ln -s ../VBoxVMM.so $(prefix)/usr/lib/$(package)/components/VBoxVMM.so 244 mkdir $(prefix)/sbin245 ln -s ../etc/init.d/vboxdrv $(prefix)/sbin/rcvboxdrv246 244 rmdir $(prefix)/opt 247 245 dh_desktop … … 253 251 -e "s|%VERSION%|$(VBOX_VERSION_STRING)|g" \ 254 252 -e "s|%GROUP%|$(if $(VBOX_WITHOUT_HARDENING),vboxusers,root)|g" \ 255 $(vboxroot)/src/VBox/Installer/linux/vboxdrv.sh.in > debian/vboxdrv.init 256 dh_installinit --name=vboxdrv --noscripts 257 cp $(vboxroot)/src/VBox/Installer/linux/vboxballoonctrl-service.sh debian/vboxballoonctrl-service.init 258 dh_installinit --name=vboxballoonctrl-service --noscripts 259 cp $(vboxroot)/src/VBox/Installer/linux/vboxautostart-service.sh debian/vboxautostart-service.init 260 dh_installinit --name=vboxautostart-service --noscripts 261 cp $(vboxroot)/src/VBox/Installer/linux/vboxweb-service.sh debian/vboxweb-service.init 262 dh_installinit --name=vboxweb-service --noscripts 253 $(vboxroot)/src/VBox/Installer/linux/vboxdrv.sh.in > $(prefix)/usr/lib/$(package)/vboxdrv.sh 254 cp $(vboxroot)/src/VBox/Installer/linux/vboxballoonctrl-service.sh $(prefix)/usr/lib/$(package) 255 cp $(vboxroot)/src/VBox/Installer/linux/vboxautostart-service.sh $(prefix)/usr/lib/$(package) 256 cp $(vboxroot)/src/VBox/Installer/linux/vboxweb-service.sh $(prefix)/usr/lib/$(package) 263 257 sed -e 's|%VER%|$(debver)|g' \ 264 258 -e 's|%DATE%|$(shell date -R)|g' \
Note:
See TracChangeset
for help on using the changeset viewer.