So here is an updated patchset for kmod https://github.com/hramrach/kmod/commits/master MODULE_PREFIX="$(kmod config | jq .module_prefix)" should set MODULE_PREFIX to the directory in which lib/modules is expected. It gives an error on unpatched kmod but the result is correct empty string either way.