VirtualBox

Changeset 69529 in vbox for trunk


Ignore:
Timestamp:
Oct 30, 2017 5:42:36 PM (7 years ago)
Author:
vboxsync
Message:

Linux drivers: make it easier to use different kernel headers.
bugref:4567: Linux kernel driver maintenance

With this change it is possible to pass KERN_DIR on the command line to
specify which kernel headers to do test builds of kernel modules against.
The default is now the most recent headers found, not the matching headers
for the currently running kernel.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Config.kmk

    r69528 r69529  
    42064206 TEMPLATE_VBOXR0DRV_TOOL                = $(NO_SUCH_VARIABLE)
    42074207
     4208 ifndef KERN_DIR
     4209  ifndef KERN_VER
     4210   KERN_VER=$(notdir $(lastword $(sort $(wildcard /lib/modules/*))))
     4211  endif
     4212  ifneq ($(KERN_VER),)
     4213   KERN_DIR=/lib/modules/$(KERN_VER)/build
     4214  endif
     4215 endif
     4216
    42084217##
    42094218# Using the extra expansion to replace $(module) before eval, thus everything
    42104219# else needs escaped dollars.
    42114220 define VBOX_LINUX_GENERATE_KMOD_TEST
    4212   VBOX_TARGET_$(module) = $$(PATH_TARGET)/tst$(module)_mod.run
     4221  VBOX_TARGET_$(module) = $$(PATH_TARGET)/tst$(module)$(subst /,_,$(KERN_DIR))_mod.run
    42134222  TESTING      += $$(VBOX_TARGET_$(module))
    42144223  OTHERS       += $$(VBOX_TARGET_$(module))
     
    42204229        $(QUIET)$$(MKDIR) -p -- "$$(PATH_TARGET)/tst$(module)_mod"
    42214230        $(QUIET)$$(CP) -R -- "$$(PATH_STAGE_BIN)/../$$($(module)_INST)" "$$(PATH_TARGET)/tst$(module)_mod/"
    4222         + $(QUIET)make KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C $$(PATH_TARGET)/tst$(module)_mod clean
    4223         + $(QUIET)make KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C $$(PATH_TARGET)/tst$(module)_mod
     4231        + $(QUIET)make KBUILD_VERBOSE=$(KBUILD_VERBOSE) KERN_DIR=$$(KERN_DIR) -C $$(PATH_TARGET)/tst$(module)_mod clean
     4232        + $(QUIET)make KBUILD_VERBOSE=$(KBUILD_VERBOSE) KERN_DIR=$$(KERN_DIR) -C $$(PATH_TARGET)/tst$(module)_mod
    42244233        $(QUIET)$$(RM) -Rf -- $$(PATH_TARGET)/tst$(module)_mod
    42254234        $(QUIET)$$(APPEND) -t "$$@" "done"
  • trunk/src/VBox/Additions/linux/Makefile.kmk

    r69528 r69529  
    364364 && "$(KBUILD_HOST_ARCH)" == "$(KBUILD_TARGET_ARCH)"
    365365
    366  $(foreach module, vboxguest-mod vboxsf-mod vboxvideo-mod, $(eval $(VBOX_LINUX_GENERATE_KMOD_TEST)))
     366 ifneq ($(KERN_DIR),)
     367  $(foreach module, vboxguest-mod vboxsf-mod vboxvideo-mod, $(eval $(VBOX_LINUX_GENERATE_KMOD_TEST)))
     368 endif
    367369
    368370endif
  • trunk/src/VBox/HostDrivers/Makefile.kmk

    r69528 r69529  
    7777 && "$(KBUILD_HOST_ARCH)" == "$(KBUILD_TARGET_ARCH)"
    7878
    79  $(foreach module, vboxdrv-mod VBoxNetFlt-src VBoxNetAdp-src VBoxPci-src, $(eval $(VBOX_LINUX_GENERATE_KMOD_TEST)))
     79 ifneq ($(KERN_DIR),)
     80  $(foreach module, vboxdrv-mod VBoxNetFlt-src VBoxNetAdp-src VBoxPci-src, $(eval $(VBOX_LINUX_GENERATE_KMOD_TEST)))
     81 endif
    8082
    8183endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette