Changeset 87742 in vbox for trunk/src/VBox/HostDrivers/linux
- Timestamp:
- Feb 12, 2021 4:38:55 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/linux/Makefile
r87728 r87742 43 43 44 44 # convenience Makefile without KERNELRELEASE 45 46 ifndef SUDO 47 ifneq ($(shell id -u),0) 48 SUDO := $(firstword $(wildcard /usr/bin/sudo /bin/sudo /usr/sbin/sudo)) 49 else 50 SUDO := 51 endif 52 endif 45 53 46 54 KBUILD_VERBOSE ?= … … 122 130 define wrapper_template 123 131 $(wrapper): $(subst $(wrapper),,vbox_vmmr0) 124 $$(MAKE) KBUILD_VERBOSE=$$(KBUILD_VERBOSE) -C $(wrapper)/125 126 load-$(wrapper): $( if $(eq $(wrapper),vbox_vmmr0),,load-vbox_vmmr0)132 +$$(MAKE) KBUILD_VERBOSE=$$(KBUILD_VERBOSE) -C $(wrapper)/ 133 134 load-$(wrapper): $(subst load-$(wrapper),,load-vbox_vmmr0) 127 135 @if ! grep -q "^$(wrapper) " /proc/modules; then \ 128 136 echo "Loading $(wrapper)..."; \ 129 /sbin/insmod $(wrapper)/$(wrapper).ko; \137 $(SUDO) /sbin/insmod $(wrapper)/$(wrapper).ko; \ 130 138 else \ 131 139 echo "Skipping loading $(wrapper) module (already loaded)."; \ … … 135 143 @if grep -q "^$(wrapper) " /proc/modules; then \ 136 144 echo "Unloading $(wrapper)..."; \ 137 /sbin/rmmod $(wrapper)/$(wrapper).ko; \145 $(SUDO) /sbin/rmmod $(wrapper)/$(wrapper).ko; \ 138 146 fi 139 147 endef … … 141 149 142 150 wrappers: $(VBOX_WRAPPER_DIRS) 143 load-wrappers: $(addprefix load-,$(VBOX_WRAPPER_DIRS))144 unload-wrappers:151 wrappers-load: $(addprefix load-,$(VBOX_WRAPPER_DIRS)) 152 wrappers-unload: 145 153 @for module in $(filter-out vbox_vmmr0,$(VBOX_WRAPPER_DIRS)) $(filter vbox_vmmr0,$(VBOX_WRAPPER_DIRS)); \ 146 154 do \ 147 155 if grep -q "^$${module} " /proc/modules; then \ 148 156 echo "Unloading $${module}..."; \ 149 if \ 150 done 157 $(SUDO) /sbin/rmmod "$${module}"; \ 158 fi \ 159 done 160 wrappers-reload: wrappers-unload 161 +$(MAKE) -f $(lastword $(MAKEFILE_LIST)) --no-print-directory wrappers-load 151 162 152 163 buildid: … … 158 169 ln -sfn -- "$(CURDIR)/$${module}" ~/.debug/.build-id/$${buildid}; \ 159 170 else \ 160 echo "warning: No build ID for $${module} }"; \171 echo "warning: No build ID for $${module}"; \ 161 172 fi \ 162 173 done 163 174 164 .PHONY: wrappers load-wrappers unload-wrappersbuildid $(VBOX_WRAPPER_DIRS) \175 .PHONY: wrappers wrappers-load wrappers-unload buildid $(VBOX_WRAPPER_DIRS) \ 165 176 $(addprefix load-,$(VBOX_WRAPPER_DIRS)) $(addprefix unload-,$(VBOX_WRAPPER_DIRS)) 166 177 … … 175 186 install: 176 187 wrappers: 177 load-wrappers:178 unload-wrappers:179 buildid -wrappers:188 wrappers-load: 189 wrappers-unload: 190 buildid: 180 191 181 192 endif … … 212 223 if grep "^$$module " /proc/modules >/dev/null; then \ 213 224 echo "Removing previously installed $$module module"; \ 214 /sbin/rmmod $$module; \225 $(SUDO) /sbin/rmmod $$module; \ 215 226 fi; \ 216 227 done … … 220 231 if test -f $$module.ko; then \ 221 232 echo "Installing $$module module"; \ 222 /sbin/insmod $$module.ko; \233 $(SUDO) /sbin/insmod $$module.ko; \ 223 234 fi; \ 224 235 done
Note:
See TracChangeset
for help on using the changeset viewer.