构建内核树报错

构建内核树时用
sudo make modules
命令编译模块时报下面的错:
fs/overlayfs/super.c: In function ‘ovl_init’:
fs/overlayfs/super.c:1311:30: error: ‘ovl_v1_fs_type’ undeclared (first use in this function)
   ret = register_filesystem(&ovl_v1_fs_type);
                              ^
fs/overlayfs/super.c:1311:30: note: each undeclared identifier is reported only once for each function it appears in
fs/overlayfs/super.c: In function ‘ovl_exit’:
fs/overlayfs/super.c:1324:26: error: ‘ovl_v1_fs_type’ undeclared (first use in this function)
   unregister_filesystem(&ovl_v1_fs_type);
                          ^
scripts/Makefile.build:269: recipe for target 'fs/overlayfs/super.o' failed
make[2]: *** [fs/overlayfs/super.o] Error 1
scripts/Makefile.build:476: recipe for target 'fs/overlayfs' failed
make[1]: *** [fs/overlayfs] Error 2
Makefile:983: recipe for target 'fs' failed
make: *** [fs] Error 2
原因是没有定义CONFIG_OVERLAY_FS_V1这个宏,可能是因为这个文件是在之前内核复制过来的
修改方法:
在含.config文件的目录下执行
sudo vim .config
搜索这个宏前面部分 CONFIG_OVER
定义这个宏然后把其他相关的宏注释掉就ok了

猜你喜欢

转载自blog.csdn.net/wg_rui/article/details/80463493