升级Linux内核的操作已经变得很简单,基本的几个命令即可搞定:make menuconfig、make、make modules、make modules_install、make install。除了这几个常用选项,make命令还有另外的几个选项对于我们也是十分有帮助,在内核源码树目录下执行make help可以看到这些选项,不过下面还是介绍几个我认为比较有用的选项:

1,make V=1,这个选项能显示出编译过程中的详细信息,即是verbose编译模式,在之前的《显示make编译信息》文章里曾介绍过修改makefile来达到这个目的,但make V=1更简单方便,而make V=0或直接make(V=0是默认值)则是quiet编译模式,只会显示出简单的编译信息。

[root@localhost linux-2.6.30]# make V=1

2,make dir/:指定编译目标,编译指定的某个目录:

[root@localhost linux-2.6.30]# make drivers/scsi/

3,make dir/file.ko:指定编译目标,编译指定的某个模块:

[root@localhost linux-2.6.30]# make drivers/net/igb/igb.ko

4,make dir/file.[ois]:指定编译目标,编译指定的某个文件为目标文件、头文件展开文件、汇编文件:

[root@localhost linux-2.6.30]# make drivers/net/igb/igb_main.o

[root@localhost linux-2.6.30]# make drivers/net/igb/igb_main.i

[root@localhost linux-2.6.30]# make drivers/net/igb/igb_main.s

5,make checkstack:函数栈静态检查

6,make includecheck:头文件重复静态检查

最后看下命令make help执行的显示信息:

[root@localhost linux-2.6.30]# make help

Cleaning targets:

clean - Remove most generated files but keep the config and

enough build support to build external modules

mrproper - Remove all generated files + config + various backup files

distclean - mrproper + remove editor backup and patch files

Configuration targets:

config - Update current config utilising a line-oriented program

menuconfig - Update current config utilising a menu based program

xconfig - Update current config utilising a QT based front-end

gconfig - Update current config utilising a GTK based front-end

oldconfig - Update current config utilising a provided .config as base

silentoldconfig - Same as oldconfig, but quietly

randconfig - New config with random answer to all options

defconfig - New config with default answer to all options

allmodconfig - New config selecting modules when possible

allyesconfig - New config where all options are accepted with yes

allnoconfig - New config where all options are answered with no

Other generic targets:

all - Build all targets marked with [*]

* vmlinux - Build the bare kernel

* modules - Build all modules

modules_install - Install all modules to INSTALL_MOD_PATH (default: /)

firmware_install- Install all firmware to INSTALL_FW_PATH

(default: $(INSTALL_MOD_PATH)/lib/firmware)

dir/ - Build all files in dir and below

dir/file.[ois] - Build specified target only

dir/file.ko - Build module including final link

modules_prepare - Set up for building external modules

tags/TAGS - Generate tags file for editors

cscope - Generate cscope index

kernelrelease - Output the release version string

kernelversion - Output the version stored in Makefile

headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH

(default: /usr/src/linux-2.6.30/usr)

Static analysers

checkstack - Generate a list of stack hogs

namespacecheck - Name space analysis on compiled kernel

versioncheck - Sanity check on version.h usage

includecheck - Check for duplicate included header files

export_report - List the usages of all exported symbols

headers_check - Sanity check on exported headers

headerdep - Detect inclusion cycles in headers

Kernel packaging:

rpm-pkg - Build both source and binary RPM kernel packages

binrpm-pkg - Build only the binary kernel package

deb-pkg - Build the kernel as an deb package

tar-pkg - Build the kernel as an uncompressed tarball

targz-pkg - Build the kernel as a gzip compressed tarball

tarbz2-pkg - Build the kernel as a bzip2 compressed tarball

Documentation targets:

Linux kernel internal documentation in different formats:

htmldocs - HTML

pdfdocs - PDF

psdocs - Postscript

xmldocs - XML DocBook

mandocs - man pages

installmandocs - install man pages generated by mandocs

cleandocs - clean all generated DocBook files

Architecture specific targets (x86):

* bzImage - Compressed kernel image (arch/x86/boot/bzImage)

install - Install kernel using

(your) ~/bin/installkernel or

(distribution) /sbin/installkernel or

install to $(INSTALL_PATH) and run lilo

fdimage - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)

fdimage144 - Create 1.4MB boot floppy image (arch/x86/boot/fdimage)

fdimage288 - Create 2.8MB boot floppy image (arch/x86/boot/fdimage)

isoimage - Create a boot CD-ROM image (arch/x86/boot/image.iso)

bzdisk/fdimage*/isoimage also accept:

FDARGS="..." arguments for the booted kernel

FDINITRD=file initrd for the booted kernel

i386_defconfig - Build for i386

x86_64_defconfig - Build for x86_64

make V=0|1 [targets] 0 => quiet build (default), 1 => verbose build

make V=2 [targets] 2 => give reason for rebuild of target

make O=dir [targets] Locate all output files in "dir", including .config

make C=1 [targets] Check all c source with $CHECK (sparse by default)

make C=2 [targets] Force check of all c source with $CHECK

Execute "make" or "make all" to build all targets marked with [*]

For further info see the ./README file

[root@localhost linux-2.6.30]#

备注:如无特殊说明,文章内容均出自Lenky个人的真实理解而并非存心妄自揣测来故意愚人耳目。由于个人水平有限,虽力求内容正确无误,但仍然难免出错,请勿见怪,如果可以则请留言告之,并欢迎来信讨论。另外值得说明的是,Lenky的部分文章以及部分内容参考借鉴了网络上各位网友的热心分享,特别是一些带有完全参考的文章,其后附带的链接内容也许更直接、更丰富,而我只是做了一下归纳&转述,在此也一并表示感谢。关于本站的所有技术文章,欢迎转载,但请遵从CC创作共享协议,而一些私人性质较强的心情随笔,建议不要转载。

法律:根据最新颁布的《信息网络传播权保护条例》,如果您认为本文章的任何内容侵犯了您的权利,请以Email或书面等方式告知,本站将及时删除相关内容或链接。

linux选择内核命令,Lenky个人站点相关推荐

  1. 镜像安装linux选择内核版本,在CentOS和Ubuntu中安装Linux Kernel 4.13.10

    Linus Torvalds 在 10 月 17 日星期五正式发布了稳定版 Linux Kernel 4.13.10,这个最新版本发布了新功能,进行了诸多修复和问题改进.下面将向大家介绍在 CentO ...

  2. linux卸载内核命令,ubuntu内核升级及卸载

    很多用户一般都会选择Windows + Ubuntu的双系统.用得时间久了,随着Ubuntu内核的不断升级,开机启动菜单会变得越来越臃肿.下面简单介绍一下如何删除开机启动菜单多余的内核(旧版本),以及 ...

  3. linux关闭内核命令,Linux内核关闭IPv6协议的方式

    在Linux禁用IPv6可以使用下面的几种方式: 第一种方式: 在/etc/modprobe.d/dist.conf文件中添加install ipv6 /bin/true,在reboot后使用使用ls ...

  4. linux关闭内核命令,CentOS 7关闭/开启SELinux内核简单方法

    在使用Centos7系统时,可能经常都需要设置SELinux内核.SELinux内核是提供支持访问控制安全策略的机制,在Centos7系统上面安装一些应用软件时,SELinux内核开启的话可能会造成软 ...

  5. Linux 查看内核 系统 等软件版本命令

    内核版本:uname -a   || cat /proc/version 当前操作系统版本:lsb_release -a    ||     cat /etc/redhat-release || ca ...

  6. Linux源码研究-用户管理员手册-内核命令行参数

    下面的列表是__setup(), core_param()和module_param()宏实现的内核参数,内核从命令-开始解析参数,如果参数不被识别,也不包含".",参数会被用来启 ...

  7. 【Linux 内核】进程管理 ( 进程特殊形式 | 内核线程 | 用户线程 | C 标准库与 Linux 内核中进程相关概念 | Linux 查看进程命令及输出字段解析 )

    文章目录 一.进程特殊形式 ( 内核线程 | 用户线程 ) 二.C 标准库与 Linux 内核中进程相关概念 三.Linux 查看进程命令及输出字段解析 一.进程特殊形式 ( 内核线程 | 用户线程 ...

  8. 使用 Linux 系统调用的内核命令图解

    http://www.ibm.com/developerworks/cn/linux/l-system-calls/ 使用 Linux 系统调用的内核命令

  9. 使用Linux的alternatives命令替换选择软件的版本

    上周在安装搜索引擎Elasticsearch时,要求安装比较新的java 版本,我选择了java 1.8.0,安装java 成功后使用java -version 发现使用的版本仍旧是1.6.0, 查询 ...

  10. linux切换软件版本,使用Linux的alternatives命令替换选择软件的版本方法

    上周在安装搜索引擎Elasticsearch时,要求安装比较新的java 版本,我选择了java 1.8.0,安装java 成功后使用java -version 发现使用的版本仍旧是1.6.0, 查询 ...

最新文章

  1. Reddit高赞:机器学习领域「八宗罪」!同行评审变味,盲目崇拜盛行
  2. HTML5表单元素禁用,禁用HTML5表单元素的验证
  3. C# WINFORM ListView用法详解(转)
  4. 【机器听觉】初探语音识别技术
  5. 获取http请求响应头
  6. 2021 年 CNCF 和开源速度的年终报告
  7. PL/SQL之JOB用法 (定时跑数据)
  8. 【离散数学中的数据结构与算法】二 欧几里得算法与裴蜀等式
  9. C++(13)--函数的进阶:内联、传递引用、参数默认值、重载、函数模板
  10. 狗窝里的小日子- 4 ...
  11. 《京华烟云》—— 读后总结
  12. tushare调用API获取金融相关数据
  13. 慢雾安全工程师:安全审计是目前保护 DeFi 项目安全最高性价比的方式
  14. 面试题32.从1到n整数中1出现的次数
  15. 1405 奶牛的旅行
  16. VMware中的Fedora9下安装VMtool后图形界面无法启动
  17. imagenet标签
  18. windows bat脚本 启动和停止程序
  19. 技术管理进阶——团队合并、解散怎么办?
  20. UML建模,用EA画机票预订系统类图和对象图

热门文章

  1. 【手势识别】基于matlab PCA+LDA手语检测识别【含Matlab源码 1551期】
  2. 毕设题目:Matlab瑕疵检测
  3. 【图像处理】基于matlab GUI图像形态学处理【含Matlab源码 1287期】
  4. 【图像去噪】基于matlab高通+低通+带通+方向滤波器图像滤波【含Matlab源码 1209期】
  5. 【雷达通信】基于matlab GUI多算法雷达一维恒虚警检测CFAR【含Matlab源码 874期】
  6. pip 加速_如何将Numpy加速700倍?用 CuPy 呀
  7. 深度学习后向算法的直观理解_强化学习的直观介绍
  8. 如何识别媒体偏见_面部识别软件:宝贵资产,还是社会偏见的体现?
  9. 算法偏见是什么_人工智能中的偏见有什么作用?
  10. Mongodb新手看这一篇就够了