#为了提高性能,文件系统一般都是以 relatime形式挂载进来的,见:/etc/fstab
#更新一下mtime,这样,编译过程中用到的文件的atime都会被更新
find . -exec touch -m {} \; && touch ../tag
make mrproper && make allnoconfig && make menuconfig
#在allnoconfig的基础下,通过menuconfig加入如下配置,以方便调试
************************************************************
General setup
  --Initial RAM filesystem and RAM disk (initramfs/initrd) support
Executable file formats / Enulations
  --Kernel support for ELF binaries
Networking support
Kernel hacking
  --Kernel debugging
  --Compile the kernel with debug info
  --Compile the kernel with frame pointers
************************************************************

make #编译,大约需要10分钟

#删除编译过程中没有用到的文件 
find . -type f ! -anewer ../tag | grep -v '/\.svn' | xargs rm

#删除所有空目录
loop=found; while [ ! -z $loop ]; do loop=$(find . -type d | grep -v '/\.svn' | while read dirname; do cnt=$(ls $dirname | wc -l); if [ 0 -eq $cnt ]; then rm -rf $dirname; echo -n found; fi; done;); done;

结果上面处理的代码可以再次变量

清理不包含源文件和头文件的目录:
find . -type d | while read dirname; do cnt=`find $dirname -name '*.[cSh]' | wc -l`; if [ 0 -eq $cnt ]; then rm -rf $dirname; fi; done;

linux 内核代码精简的更多相关文章

  1. [转] Linux内核代码风格 CodingStyle [CH]

    from:http://blog.csdn.net/jiang_dlut/article/details/8163731 中文版维护者: 张乐 Zhang Le <r0bertz@gentoo. ...

  2. 从linux内核代码分析操作系统启动过程

    朱宇轲 + 原创作品转载请注明出处 + <Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 在本次的实验中, ...

  3. 第三次阅读赵炯博士的《linux内核代码完全注释》:序

    这是我第三次阅读linux内核代码完全注释了,当然前两次也没有读完,第一次读到第五章,第二次第七章. 所以说,赵炯博士对我最大的帮助时介绍了intel386的结构,以及内核编程的方法. 至于真正的内核 ...

  4. 使用QEMU调试Linux内核代码

    http://blog.chinaunix.net/uid-20729583-id-1884617.html http://www.linuxidc.com/Linux/2014-08/105510. ...

  5. win7 变WIFI热点 & 在线Linux 内核代码

    https://daniel.haxx.se/docs/sshproxy.html netsh wlan set hostednetwork mode=allow ssid=mywifi  key=1 ...

  6. linux内核代码的编写初步以及makefile的配置

    在linux内核代码开发中,头文件不能包含标准C头文件,只能采用GNC标准 而且内核开发中没有main函数,只有init 和 exit ,这是每个内核模块中必须要包含的函数模块. 在GNU C标准中, ...

  7. Linux学习笔记:【004】Linux内核代码风格

    Chinese translated version of Documentation/CodingStyle   If you have any comment or update to the c ...

  8. Linux内核代码

    全局描述符表GDT(Global Descriptor Table): (1)在整个系统中,全局描述符表(注意这里是表,表只有一张)GDT只有一张(一个处理器对应一个GDT). (2)GDT可以被放在 ...

  9. linux内核代码注释 赵炯 第三章引导启动程序

    linux内核代码注释 第三章引导启动程序 boot目录中的三个汇编代码文件   bootsect.s和setup.s采用近似intel的汇编语法,需要8086汇编器连接器as86和ld86 head ...

随机推荐

  1. JS中window.document对象

    小知识点注:外面双引号,里面的双引号改为单引号:                  在div里面行高设置和整个外面高度一样,才能用竖直居中,居中是行居中                  文本框取出来 ...

  2. CSS的display、hover、overflow、&copy(版权符号)、borer-radius(边框圆角)

    一.display: none 隐藏 block显示     visibility:hidden隐藏 visible显示 display:none和visibility:hidden这两个属性对应的值 ...

  3. Name lookup

    Name lookup Types of lookup Argument-dependent lookup Template argument deduction overload resolutio ...

  4. [LeetCode]题解(python):018-4Sum

    题目来源: https://leetcode.com/problems/4sum/ 题意分析: 这道题目和3Sum的题目类似,找出所有的4个数,使得这4个数等于target. 题目思路: 这道题做法和 ...

  5. bash: ./configure: 权限不够

    linux下运行一个文件时 提示权限不够,说明这个文件没有可执行权限 我们可以在属性里面手动为这个文件加上可执行权限也可以使用命令的方式 命令方式: 例如:   bash: ./configure: ...

  6. Tomcat7 + JRebel6.3.0 + IntelliJ idea 热部署配置过程+错误分析

    以前使用Tomcat的时候直接就可以热部署,现在换了一个使用Spring框架的项目突然就不能热部署了. 网上说在tomcat里conf/context.xml中加入 <Context antiJ ...

  7. Linux android studio :'tools.jar' seems to be not in Android Studio classpath.

    问题: 'tools.jar' seems to be not in Android Studio classpath.Please ensure JAVA_HOME points to JDK ra ...

  8. ACM高精度加减乘除模板

    [转]#include <iostream> #include <string> using namespace std; inline int compare(string ...

  9. Linux UDEV和为MySQL InnoDB共享表空间配置裸设备

    ⑴ UDEV 基础         udev 可管理保存在/dev 目录下的文件.文件只有在接入相应设备后才会生成.设备被拔出后自动删除     它还允许用户添加规则.以便修改/dev中默认的名称和权 ...

  10. 【LeetCode】【Python题解】Single Number &amp; Maximum Depth of Binary Tree

    今天做了三道LeetCode上的简单题目,每道题都是用c++和Python两种语言写的.由于c++版的代码网上比較多.所以就仅仅分享一下Python的代码吧,刚学完Python的基本的语法,做做Lee ...