vbox的更動 13499 路徑 trunk/src/VBox/Installer/solaris
- 時間撮記:
- 2008-10-22 下午03:40:54 (16 年 以前)
- 位置:
- trunk/src/VBox/Installer/solaris
- 檔案:
-
- 修改 4 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Installer/solaris/postinstall.sh
r13484 r13499 30 30 currentzone=`zonename` 31 31 if test "$currentzone" = "global"; then 32 echo "Configuring VirtualBox kernel module (s)..."33 /opt/VirtualBox/vboxdrv.sh stopall silentunload 32 echo "Configuring VirtualBox kernel modules..." 33 /opt/VirtualBox/vboxdrv.sh stopall silentunload checkarch 34 34 rc=$? 35 35 if test "$rc" -eq 0; then … … 84 84 # create the device link 85 85 /usr/sbin/devfsadm -i vboxdrv 86 sync 86 87 87 88 # We need to touch the desktop link in order to add it to the menu right away -
trunk/src/VBox/Installer/solaris/preremove.sh
r13485 r13499 38 38 39 39 # vboxdrv.sh would've been installed, we just need to call it. 40 /opt/VirtualBox/vboxdrv.sh stopall 40 /opt/VirtualBox/vboxdrv.sh fltstop alwaysremdrv 41 /opt/VirtualBox/vboxdrv.sh stop alwaysremdrv 41 42 42 43 # remove devlink.tab entry for vboxdrv -
trunk/src/VBox/Installer/solaris/vboxdrv.sh
r13484 r13499 18 18 # 19 19 20 STOPPING=""20 CHECKARCH="" 21 21 SILENTUNLOAD="" 22 ALWAYSREMDRV="" 23 24 22 25 MODNAME="vboxdrv" 23 26 VBIMODNAME="vbi" … … 37 40 } 38 41 42 warn() 43 { 44 echo 1>&2 "WARNING!! $!" 45 } 46 39 47 check_if_installed() 40 48 { … … 48 56 fi 49 57 50 # Check arch only if we are not stopping things(because rem_drv works for both arch.)51 if test - z "$STOPPING"; then58 # Check arch only while installing (because rem_drv works for both arch.) 59 if test -n "$CHECKARCH"; then 52 60 # Let us go a step further and check if user has mixed up x86/amd64 53 61 # amd64 ISA, x86 kernel module?? … … 72 80 } 73 81 74 module_loaded() 75 { 76 # modinfo should now work properly since we prevent module autounloading 77 loadentry=`/usr/sbin/modinfo | grep $MODNAME` 82 module_added() 83 { 84 loadentry=`cat /etc/name_to_major | grep $1` 78 85 if test -z "$loadentry"; then 79 86 return 1 … … 82 89 } 83 90 84 vboxflt_module_loaded()91 module_loaded() 85 92 { 86 93 # modinfo should now work properly since we prevent module autounloading 87 loadentry=`/usr/sbin/modinfo | grep $ FLTMODNAME`94 loadentry=`/usr/sbin/modinfo | grep $1` 88 95 if test -z "$loadentry"; then 89 96 return 1 90 97 fi 91 return 0 98 return 0 99 } 100 101 vboxdrv_loaded() 102 { 103 module_loaded $MODNAME 104 return $? 105 } 106 107 vboxdrv_added() 108 { 109 module_added $MODNAME 110 return $? 111 } 112 113 vboxflt_loaded() 114 { 115 module_loaded $FLTMODNAME 116 return $? 117 } 118 119 vboxflt_added() 120 { 121 module_added $FLTMODNAME 122 return $? 92 123 } 93 124 … … 111 142 start_module() 112 143 { 113 if module_loaded; then144 if vboxdrv_loaded; then 114 145 info "VirtualBox Host kernel module already loaded." 115 146 else … … 120 151 fi 121 152 /usr/sbin/modload -p drv/$MODNAME 122 if test ! module_loaded; then153 if test ! vboxdrv_loaded; then 123 154 abort "Failed to load VirtualBox Host kernel module." 124 155 elif test -c "/devices/pseudo/$MODNAME@0:$MODNAME"; then … … 132 163 stop_module() 133 164 { 134 if module_loaded; then165 if vboxdrv_loaded; then 135 166 vboxdrv_mod_id=`/usr/sbin/modinfo | grep $MODNAME | cut -f 1 -d ' ' ` 136 167 if test -n "$vboxdrv_mod_id"; then 137 168 /usr/sbin/modunload -i $vboxdrv_mod_id 138 if test "$?" -eq 0; then 139 /usr/sbin/rem_drv $MODNAME || abort "Unloaded VirtualBox Host kernel module, but failed to remove it!" 140 info "VirtualBox Host kernel module unloaded." 169 170 # While uninstalling we always remove the driver whether we unloaded successfully or not, 171 # while installing we make SURE if there is an existing driver about, it is cleanly unloaded 172 # and the new one is added hence the "alwaysremdrv" option. 173 if test -n "$ALWAYSREMDRV"; then 174 /usr/sbin/rem_drv $MODNAME 141 175 else 142 abort "Failed to unload VirtualBox Host kernel module. Old one still active!!" 176 if test "$?" -eq 0; then 177 /usr/sbin/rem_drv $MODNAME || abort "Unloaded VirtualBox Host kernel module, but failed to remove it!" 178 else 179 abort "Failed to unload VirtualBox Host kernel module. Old one still active!!" 180 fi 143 181 fi 144 fi 182 183 info "VirtualBox Host kernel module unloaded." 184 fi 185 elif vboxdrv_added; then 186 /usr/sbin/rem_drv $MODNAME || abort "Unloaded VirtualBox Host kernel module, but failed to remove it!" 187 info "VirtualBox Host kernel module unloaded." 145 188 elif test -z "$SILENTUNLOAD"; then 146 189 info "VirtualBox Host kernel module not loaded." … … 156 199 start_vboxflt() 157 200 { 158 if vboxflt_ module_loaded; then201 if vboxflt_loaded; then 159 202 info "VirtualBox NetFilter kernel module already loaded." 160 203 else 161 204 /usr/sbin/add_drv -m'* 0600 root sys' $FLTMODNAME || abort "Failed to add VirtualBox NetFilter Kernel module." 162 205 /usr/sbin/modload -p drv/$FLTMODNAME 163 if test ! vboxflt_ module_loaded; then206 if test ! vboxflt_loaded; then 164 207 abort "Failed to load VirtualBox NetFilter kernel module." 165 208 else … … 171 214 stop_vboxflt() 172 215 { 173 if vboxflt_ module_loaded; then216 if vboxflt_loaded; then 174 217 vboxflt_mod_id=`/usr/sbin/modinfo | grep $FLTMODNAME | cut -f 1 -d ' '` 175 218 if test -n "$vboxflt_mod_id"; then 176 219 /usr/sbin/modunload -i $vboxflt_mod_id 177 if test "$?" -eq 0; then 178 /usr/sbin/rem_drv $FLTMODNAME || abort "Unloaded VirtualBox NetFilter kernel module, but failed to remove it!" 179 info "VirtualBox NetFilter kernel module unloaded." 220 221 # see stop_vboxdrv() for why we have "alwaysremdrv". 222 if test -n "$ALWAYSREMDRV"; then 223 /usr/sbin/rem_drv $FLTMODNAME 180 224 else 181 abort "Failed to unload VirtualBox NetFilter kernel module. Old one still active!!" 225 if test "$?" -eq 0; then 226 /usr/sbin/rem_drv $FLTMODNAME || abort "Unloaded VirtualBox NetFilter kernel module, but failed to remove it!" 227 else 228 abort "Failed to unload VirtualBox NetFilter kernel module. Old one still active!!" 229 fi 182 230 fi 183 fi 231 232 info "VirtualBox NetFilter kernel module unloaded." 233 fi 234 elif vboxflt_added; then 235 /usr/sbin/rem_drv $FLTMODNAME || abort "Unloaded VirtualBox NetFilter kernel module, but failed to remove it!" 236 info "VirtualBox NetFilter kernel module unloaded." 184 237 elif test -z "$SILENTUNLOAD"; then 185 238 info "VirtualBox NetFilter kernel module not loaded." … … 187 240 } 188 241 189 status_ module()190 { 191 if module_loaded; then242 status_vboxdrv() 243 { 244 if vboxdrv_loaded; then 192 245 info "Running." 246 elif vboxdrv_added; then 247 info "Inactive." 193 248 else 194 info " Stopped."249 info "Not installed." 195 250 fi 196 251 } … … 211 266 check_if_installed 212 267 213 if test "$2" = "silentunload" ; then268 if test "$2" = "silentunload" || test "$3" = "silentunload"; then 214 269 SILENTUNLOAD="$2" 215 270 fi 216 271 272 if test "$2" = "alwaysremdrv" || test "$3" = "alwaysremdrv"; then 273 ALWAYSREMDRV="alwaysremdrv" 274 fi 275 276 if test "$2" = "checkarch" || test "$3" = "checkarch"; then 277 CHECKARCH="checkarch" 278 fi 279 217 280 case "$1" in 218 281 stopall) 219 STOPPING="stopping"220 282 stop_all_modules 221 283 ;; … … 230 292 ;; 231 293 status) 232 status_ module294 status_vboxdrv 233 295 ;; 234 296 fltstart) -
trunk/src/VBox/Installer/solaris/zoneaccess.sh
r13484 r13499 18 18 # 19 19 20 sleep 1000000000 < /dev/vboxdrv 20 if test -c "/devices/pseudo/vboxdrv@0:vboxdrv"; then 21 if test -h "/dev/vboxdrv" || test -f "/dev/vboxdrv"; then 22 sleep 1000000000 < /dev/vboxdrv & 23 else 24 echo "VirtualBox Host kernel module device link missing..." 25 exit 2 26 fi 27 else 28 echo "VirtualBox Host kernel module not loaded!! Zone access hack failed." 29 exit 1 30 fi 21 31
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器