Linux内核编译安装
1. .config
复制一份当前系统编译时的配置,在/usr/src目录下
$ ls /usr/src/
linux-headers-4.10.0-35 linux-headers-4.8.0-36
linux-headers-4.10.0-35-generic linux-headers-4.8.0-36-generic
其中,在 linux-headers-*-generic目录下存在 .config文件,复制一份到linux-4.14.14目录下
linux-4.14.14$ cp /usr/src/linux-headers-4.10.0-35-generic/.config .
2. 编译配置
可能出现的问题
$ make menuconfig
*** Unable to find the ncurses libraries or the
*** required header files.
*** 'make menuconfig' requires the ncurses libraries.
***
*** Install ncurses (ncurses-devel) and try again.
***
scripts/kconfig/Makefile:202: recipe for target 'scripts/kconfig/dochecklxdialog' failed
make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1
Makefile:543: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2
编译出了问题,提示缺少ncurses相关的库,安装就好
# 提示找不到ncurses-devel包
# sudo apt-get install ncurses-devel
sudo apt-get install libncurses5-dev
安装好之后,重新执行,选择[load]–>[OK]–>[Save]–>[OK]–>[EXIT]–>[EXIT]
$ make menuconfig
HOSTCC scripts/kconfig/mconf.o
HOSTCC scripts/kconfig/lxdialog/checklist.o
HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/inputbox.o
HOSTCC scripts/kconfig/lxdialog/textbox.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
HOSTCC scripts/kconfig/lxdialog/menubox.o
HOSTLD scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig
配置完结果
3. 编译内核
编译启动映像
编译的过程比较耗时,-jN部分, N一般设置为内核数量*2,编译速度越快,当然,不要超过自己机器的上限。设置为256,整个内核编译只需要花费大概10min左右。
make bzImage -j8
可能遇到的2个问题:
Makefile:942: *** "Cannot generate ORC metadata for CONFIG_UNWINDER_ORC=y, please install libelf-dev, libelf-devel or elfutils-libelf-devel". Stop.
缺少相应的库,安装即可:sudo apt-get install libelf-dev
fatal error: openssl/opensslv.h: No such file or directory
没有安装openssl的,需要先安装openssl: sudo apt-get install libssl-dev
编译模块
直接执行 make modules -j8
4. 安装内核
安装内核的过程就快的很多了,这和一般的软件安装包的安装软件 是相似的。
先安装模块
root # make modules_install
再安装内核
root # make install
完成安装之后,会在/boot内生成对应的内核相关文件,重启之后,在启动引导页面,会让我们选择启动的内核,这时我们可以选择是当前默认的4.10内核还是刚刚编译安装的更新的4.14内核。
5. 更改启动grub
grub就是管理Ubuntu系统启动的一个程序,我们编译好的内核要设置为缺省运行项,修改对应的grub,其实也很简单。
查看当前:
$ cat /proc/version
Linux version 4.10.0-35-generic (buildd@lcy01-33) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #39~16.04.1-Ubuntu SMP Wed Sep 13 09:02:42 UTC 2017
$cat /boot/grub/grub.cfg | grep 4.10
....
Linux内核编译安装的更多相关文章
- Linux内核编译与安装
2013-04-16 Linux内核介绍 Linux内核是一个用C语言写成的,符合POSIX标准的类Unix操作系统.内核是操作系统中最基本的一部分,提供了众多应用程序访问计算机硬件的机制.L ...
- Linux内核编译、安装流程
原文链接:https://blog.csdn.net/qq_28437139/article/details/83692907 此处只讲linux内核编译步骤至于安装虚拟机,安装ubuntu操作系统请 ...
- 学习笔记之Linux内核编译过程
准备工作 物理主机:win8(32位) 虚拟机工具:VirtualBox_4.3.16_Win32 虚拟主机:xubuntu-12.04.4 安装virtualBox功能增强包 设置好虚拟机与主机的共 ...
- 运行在TQ2440开发板上以及X86平台上的linux内核编译
一.运行在TQ2440开发板上的linux内核编译 1.获取源码并解压 直接使用天嵌移植好的“linux-2.6.30.4_20100531.tar.bz2”源码包. 解压(天嵌默认解压到/opt/E ...
- Linux下编译安装qemu和libvirt
目录 [hide] 1 安装qemu 1.1 qemu介绍 1.2 下载源文件 1.3 编译安装 2 安装libvirt 2.1 libvirt介绍 2.2 下载libvirt 2.3 编译安装 3 ...
- linux内核编译环境配置
linux内核编译环境配置 如果不是编译内核,只需要安装与内核相匹配的kernel-devel开发包即可.即是/lib/modules/`uname -r`/build -> /usr/src/ ...
- Linux下编译安装qemu和libvirt【转】
转自:http://www.cnblogs.com/findumars/p/5679742.html 目录 [hide] 1 安装qemu 1.1 qemu介绍 1.2 下载源文件 1.3 编译安装 ...
- linux内核编译与开发
一.Linux内核简介linux kernel map: linux 系统体系结构: linux kernel体系结构: arm有7种工作模式,x86也实现了4个不同级别RING0-RING3,RIN ...
- Lab1:Linux内核编译及添加系统调用(详细版)
实验一:Linux内核编译及添加系统调用(HDU) 花了一上午的时间来写这个,良心制作,发现自己刚学的时候没有找到很详细的,就是泛泛的说了下细节地方也没有,于是自己写了这个,有点长,如果你认真的看完了 ...
随机推荐
- dmsg命令使用
http://note.youdao.com/noteshare?id=6771284da9f10ac35652907898d63141
- Holm–Bonferroni method
sklearn实战-乳腺癌细胞数据挖掘(博主亲自录视频) https://study.163.com/course/introduction.htm?courseId=1005269003&u ...
- LINUX下时间类API
(1)常用的时间相关的API和C库函数有9个:time/ctime/localtime/gmtime/mktime/asctime/strftime/gettimeofday/settimeofday ...
- 网站访问日志User Agent对照表
percent useragent system user_agent_string_md5 8.9% Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleW ...
- 使用git上传项目到GitHub上
之前的博客有<使用git拉取GitHub上的项目>的文章,那么现在说一下,如何上传项目到GitHub上. 1. Git的.gitignore 文档配置 因为项目中可能有很多的图片还有nod ...
- Idea工具常用技巧总结
转自:https://www.jianshu.com/p/131c2deb3ecf Idea常用技巧总结 1.无处不在的跳转 注:这里的快捷键是自己定义的,并非大家的都一样,可以通过findActio ...
- CSS浏览器兼容问题集-第二部分
11.高度不适应 高度不适应是当内层对象的高度发生变化时外层高度不能自动进行调节,特别是当内层对象使用margin 或paddign 时. 例: #box {background-color:# ...
- Use JPath but not recursively loop a JObject to modify the values.
I am dealing with a Json file, I parsed it into jObject, I have another list which flattened the pro ...
- Spring Boot中对log4j进行多环境不同日志级别的控制
之前介绍了在<Spring boot中使用log4j记录日志>,仅通过log4j.properties对日志级别进行控制,对于需要多环境部署的环境不是很方便,可能我们在开发环境大部分模块需 ...
- Git其他的命令------(四)
git除了在工作当中可以进行对代码进行管理的设置之外,git的其他指令也偶尔会被用到~ 1:删除某一个文件: rm -rf node,然后按下tab 2:查看修改文件的修改的详细信息: git ...