2018年5月

下载kernel源文件,
https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.16.9.tar.xz
解压,然后到对应目录执行make

$cd /opt/dev/workspace/kernel/linux-4.16.9/drivers/gpu/drm/i915
$make -C /usr/lib/modules/`uname -r`/build/ M=`pwd` modules    -j 3

然后发现有错误:

In file included from /opt/dev/workspace/kernel/linux-4.16.9/drivers/gpu/drm/i915/i915_trace.h:1006:0,
                 from /opt/dev/workspace/kernel/linux-4.16.9/drivers/gpu/drm/i915/i915_trace_points.c:13:
./include/trace/define_trace.h:89:42: 致命错误:../../drivers/gpu/drm/i915/i915_trace.h:没有那个文件或目录
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
                                          ^
编译中断

按照经验是需要修改TRACE_INCLUDE_PATH就可以了。
但是发现改为绝对路径以后仍然不能。 卡了很久。
后来一检查:

配置的是:
#define TRACE_INCLUDE_PATH /opt/dev/workspace/kernel/linux-4.16.9/drivers/gpu/drm/i915

错误是:
In file included from /opt/dev/workspace/kernel/linux-4.16.9/drivers/gpu/drm/i915/i915_trace.h:1006:0,
                 from /opt/dev/workspace/kernel/linux-4.16.9/drivers/gpu/drm/i915/i915_trace_points.c:13:
./include/trace/define_trace.h:89:42: 致命错误:/opt/dev/workspace/kernel/1-4.16.9/drivers/gpu/drm/i915/i915_trace.h:没有那个文件或目录
 #include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
                                          ^

错误的是我的目录有-号: linux-4.16.9 VS 1-4.16.9

神奇。。。。

于是换了一个目录名搞定。