zoukankan      html  css  js  c++  java
  • linux 内核代码精简

    #为了提高性能,文件系统一般都是以 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;
  • 相关阅读:
    is as运算符
    继承,多态
    封装等
    面向对象
    在JDBC中使用带参数的SQL语句
    我的程序库:HiCSDB
    我的程序库:HiCSUtil
    Java中,将ResultSet映射为对象和队列及其他辅助函数
    Java版的对象关系映射实现
    Java中的基本数据类型转换
  • 原文地址:https://www.cnblogs.com/dyllove98/p/3201149.html
Copyright © 2011-2022 走看看