[vbox-dev] Fixes for kernel v5.5

Larry Finger Larry.Finger at lwfinger.net
Fri Dec 20 21:48:16 GMT 2019


With kernel v5.5, the only change so far is in the behavior of depmod. In 
earlier versions, it was sufficient to copy the contents of Module.sysmvers from 
the vboxdrv directory to the current directory to have the exported symbols from 
vboxdrv be available to another module such as vboxnetflt, etc. With v5.5, that 
no longer works.

The workaround is to pass the path of Module.sysvers to kbuild (make) in a 
symbol named KBUILD_EXTRA_SYMBOLS. The patch file, which has an MIT license, is 
attached. Additional changes were required in the .spec file used to build an 
openSUSE RPM, and I would expect changes to be needed for the RPM or DEB build 
of other distros. As these changes do not exist here as a separate patch file, I 
cannot attach them; however, the meat of the inline builds need to look like this:

        if [ "$module_name" = "vboxdrv" -o \
             "$module_name" = "vboxguest" ] ; then
             SYMBOLS=""
         fi
         # create build directory for specific flavor
         mkdir -p modules_build_dir/$flavor

         # copy sources which will be used to build vbox module in last step
         cp -r $vbox_module/ modules_build_dir/$flavor/

         # copy vboxdrv (for host) module symbols which are used by vboxnetflt 
and vboxnetadp km's:
         if [ "$module_name" = "vboxnetflt" -o \
              "$module_name" = "vboxnetadp" -o \
              "$module_name" = "vboxpci" ] ; then
             cp $PWD/modules_build_dir/$flavor/vboxdrv/Module.symvers    \
                   $PWD/modules_build_dir/$flavor/$module_name
             SYMBOLS="$PWD/modules_build_dir/$flavor/vboxdrv/Module.symvers"
         fi
         # copy vboxguest (for guest) module symbols which are used by vboxsf km:
        if [ "$module_name" = "vboxsf" -o \
             "$module_name" = "vboxvideo" ] ; then
            cp $PWD/modules_build_dir/$flavor/vboxguest/Module.symvers \
                   $PWD/modules_build_dir/$flavor/$module_name
             SYMBOLS="$PWD/modules_build_dir/$flavor/vboxguest/Module.symvers"
         fi
         # build the module for the specific flavor
         make -j2 -C %{_prefix}/src/linux-obj/%{_target_cpu}/$flavor \
	 %{?linux_make_arch} \
	 modules M=$PWD/modules_build_dir/$flavor/$module_name  \
  	 KBUILD_EXTRA_SYMBOLS="$SYMBOLS" V=1

Larry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixes_for_5.5.patch
Type: text/x-patch
Size: 2327 bytes
Desc: not available
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20191220/102cfc8b/attachment.bin>


More information about the vbox-dev mailing list