kun@ubuntu:~$ cat /proc/version Linux version 4.15.0-45-generic (buildd@lcy01-amd64-027) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)) #48~16.04.1-Ubuntu SMP Tue Jan 29 18:03:48 UTC 2019
root@ubuntu:/usr/src/linux-4.6# make menuconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/mconf.o In file included from scripts/kconfig/mconf.c:23:0: scripts/kconfig/lxdialog/dialog.h:38:20: fatal error: curses.h: No such file or directory compilation terminated. scripts/Makefile.host:108: recipe for target 'scripts/kconfig/mconf.o' failed make[1]: *** [scripts/kconfig/mconf.o] Error 1 Makefile:538: recipe for target 'menuconfig' failed make: *** [menuconfig] Error 2
*** End of the configuration. *** Execute 'make' to start the build or try 'make help'.
如果出现仍错误,如下
1 2 3 4 5 6 7 8
scripts/kconfig/mconf Kconfig .config:4244:warning: symbol value 'm' invalid for GPIO_MB86S7X Your display is too small to run Menuconfig! It must be at least 19 lines by 80 columns. scripts/kconfig/Makefile:28: recipe for target 'menuconfig' failed make[1]: *** [menuconfig] Error 1 Makefile:538: recipe for target 'menuconfig' failed make: *** [menuconfig] Error 2
则只需要调大终端窗口大小重试即可。
其他的配置工具简介如下:
1 2 3 4
make config ;字符界面下 make gconfig ;基于gk+的图形工具 make defconfig ;基于默认配置 make oldconfig ;修改过配置文件后,或者用已有配置文件配置新的代码树的时候,应该执行
编译和安装内核
编译内核,仍然在你的linux-4.6/下执行,可能耗时数小时:
1
make
老版的编译方式会编译启动映像make bzImage。这里不使用,make就可以搞定。
可能出现错误:
1 2 3 4 5 6
scripts/sign-file.c:25:30: fatal error: openssl/opensslv.h: No such file or directory compilation terminated. scripts/Makefile.host:91: recipe for target 'scripts/sign-file' failed make[1]: *** [scripts/sign-file] Error 1 Makefile:552: recipe for target 'scripts' failed make: *** [scripts] Error 2
解决方法:
1
sudo apt-get install libssl-dev
重新尝试make,开始等待。结束结果如下:
1 2 3 4
Setup is 17404 bytes (padded to 17408 bytes). System is 6942 kB CRC f4cb1ce4 Kernel: arch/x86/boot/bzImage is ready (#1)