You don't need the full build-essential to compile the modules, only the dependencies from gcc. So in Debian just install in linux-headers-${::kernelrelease} as this package has a dependency on gcc (and the correct version of gcc to build for that kernel).
Leaving Ubuntu alone for now since I've not tested that.
You don't need the full build-essential to compile the modules, only the dependencies from gcc. So in Debian just install in linux-headers-${::kernelrelease} as this package has a dependency on gcc (and the correct version of gcc to build for that kernel).
Leaving Ubuntu alone for now since I've not tested that.