makefile文件宏定义注意事项:
CONFIG_KERNEL_DEBUG:生成可调试的内核镜像文件,并且模块的so文件同样携带调试信息,
导致编译的模块体积过大,在执行make modlues_install会出现内存不足,错误如下:
/bin/sh: line 1: 7769 Killed /sbin/depmod -ae -F System.map 2.6.35.6
make: *** [_modinst_post] Error 137
dmesg
[ 559.740746] 980 total pagecache pages
[ 559.740747] 908 pages in swap cache
[ 559.740749] Swap cache stats: add 260447, delete 259539, find 328/415
[ 559.740750] Free swap = 0kB
[ 559.740752] Total swap = 524284kB
[ 559.744075] 173040 pages RAM
[ 559.744077] 5932 pages reserved
[ 559.744078] 59 pages shared
[ 559.744080] 165489 pages non-shared
[ 559.744082] Out of memory: kill process 7911 (depmod) score 25685 or a child
[ 559.744305] Killed process 7911 (depmod) vsz:1643892kB, anon-rss:617784kB, file-rss:0kB
拷贝内核源码编译错误:
1 include/asm is a directory,a simgpol is expected
删除该目录即可。
2driver/watchdog/hpwdt.c:in funcition hpwdt_check_nmi_decoding
driver/watchdog/hpwdt.c::671: error:implicit declaration of function "nmi_watchdod_active"
查看函数是否定义,如果已经定义,包含该函数声明的头文件
安装新的内核镜像
详细查看make install的基本流程,耗时。
拷贝指令:cp arch/x86/linux/bzImage /boot/vmlinuz
转载于:https://blog.51cto.com/fengyuzaitu/1434865