[vbox-dev] Fix for Kernel 5.x

Sérgio Basto sergio at serjux.com
Sun Aug 4 12:08:55 GMT 2019


On Sun, 2019-06-02 at 11:46 -0400, Valdis Klētnieks wrote:
> On Sun, 02 Jun 2019 08:48:15 +0100, S?rgio Basto said:
> 
> > 'SUBDIRS' will be removed after Linux 5.3
> > Please use 'M=' or 'KBUILD_EXTMOD' instead
> > -  ifeq ($(shell if grep '"[432]\.'
> > $(KERN_DIR)/include/linux/version.h > /dev/null 2>&1; then echo
> > yes; fi),yes)
> > +  ifeq ($(shell if grep '"[98765432]\.'
> > $(KERN_DIR)/include/linux/version.h /dev/null 2>&1; then echo yes;
> > fi),yes)
> 
> I submitted a more correct patch back in March, which did the right
> thing
> and changed all the SUBDIRS= to M=, though I admit I didn't go near
> this
> script (I only adressed the actual kernel module tree that ends up in
> /usrshare/virtualbox/src/vboxhost)
> 
> I admit not even being sure what this code used to be trying to do,
> or why
> this patch seems to work for you.  Hint:   It's looking for "any
> number other than a 1,
> followed by a period".   At least in my kernel tree, what I have is:
> 
> [/usr/src/linux-next] cat include/generated/uapi/linux/version.h 
> #define LINUX_VERSION_CODE 328192
> #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
> 
> Which means that neither [432]\. or [2-9]\. is ever going to match.
> What's
> in the version.h file your script is trying to work with?
> 
> I'm not sure what version.h this script is looking at, but unless
> there's a
> '1.' and no other digits followed by a period anywhere in the file,
> it's going
> to find it.
> 
> Hint:  (a) your patch will mysteriously break if we ever get to an
> 11.0
> kernel, and (b) It doesn't DTRT in distinguishing between a 2.4.X and
> a 2.6.X
> kernel, which is what actually matters for SUBDIRS/M.
> 
> M= has been supported for forever.
> 
> commit 0126be38d98815d25d9ec4573541ed4315bf6a88
> Author: Masahiro Yamada <yamada.masahiro at socionext.com>
> Date:   Wed Nov 21 00:04:18 2018 +0900
> 
>     kbuild: announce removal of SUBDIRS if used
>     
>     SUBDIRS has been kept as a backward compatibility since
>     commit ("[PATCH] kbuild: external module support") in 2002.
> 
> In other words, since the 2.6.0 kernel.  If somebody is trying to
> build
> VirtualBox on a 2.4 or earlier kernel, this is the *least* of their
> problems.
> 

I wonder if Virtualbox 6.0.10 have any fix for this subject ?  Since my
patch still applies cleanly .

Thanks,

> 
-- 
Sérgio M. B.




More information about the vbox-dev mailing list