[LEDE-DEV] Identifying kernel version (major) during build (.mk file)

Mauro Mozzarelli openwrt at ezplanet.net
Sat Feb 18 03:49:30 PST 2017

I was wondering someone could help me the following problem:

I want to add some device drivers to the kernel build, but the kernel 
configuration in kernel version 3 is different from the configuration in 
kernel version 4.

I was looking for a parameter that I could use inside an .mk file to 
find which kernel version I am building for.

So far with trial and error (unfortunately I could not find specific 
documentation) I found that I can test reliably a variable that includes 
both kernel version and patchlevel as follows:


... and so on.

However all I would need is something like LINUX_4 or LINUX_3

otherwise I would have to list every possible patchlevel (present and 
future to allow the build when patchlevel changes).

Thank you in advance,


More information about the Lede-dev mailing list