1. 在 LINUX 3.5源代码目录下执行  yum install ncurses-devel     make menuconfig

2  打开内核跟踪事件,用于SYSTEMTAP跟踪

kernel hacking --->tracers(new)--->enable uprobes-based dynamic events

文件系统相关选项要打开

即为

CONFIG_SYSFS_DEPRECATED_V2=y

不这样设为出错,安装内核重起后就会出现如下状况

mount: could not find filesystem ‘/dev/root’
 setuproot: moving /dev failed: No such file or directory
 setuproot: error mounting /proc: No such file or directory
 setuproot: error mounting /sys: No such file or directory
 switchroot: mount failed: No such file or directory

3. 头文件出错

In file included from /usr/include/sys/time.h:31,
from /usr/include/linux/input.h:12,
from samples/hidraw/hid-example.c:14:
/usr/include/sys/select.h:78: error: conflicting types for 'fd_set'
/usr/include/linux/types.h:12: error: previous declaration of 'fd_set' was here
In file included from /usr/include/linux/input.h:14,
from samples/hidraw/hid-example.c:14:
/usr/include/sys/types.h:46: error: conflicting types for 'loff_t'
/usr/include/linux/types.h:30: error: previous declaration of 'loff_t' was here
/usr/include/sys/types.h:62: error: conflicting types for 'dev_t'
/usr/include/linux/types.h:13: error: previous declaration of 'dev_t' was here
In file included from /usr/include/sys/types.h:133,
from /usr/include/linux/input.h:14,
from samples/hidraw/hid-example.c:14:
/usr/include/time.h:105: error: conflicting types for 'timer_t'
/usr/include/linux/types.h:22: error: previous declaration of 'timer_t' was here
In file included from /usr/include/linux/input.h:14,
from samples/hidraw/hid-example.c:14:
/usr/include/sys/types.h:198: error: conflicting types for 'int64_t'
/usr/include/linux/types.h:98: error: previous declaration of 'int64_t' was here
/usr/include/sys/types.h:204: error: conflicting types for 'u_int64_t'
/usr/include/linux/types.h:97: error: previous declaration of 'u_int64_t' was here
In file included from /usr/include/linux/input.h:14,
from samples/hidraw/hid-example.c:14:
/usr/include/sys/types.h:235: error: conflicting types for 'blkcnt_t'
/usr/include/linux/types.h:114: error: previous declaration of 'blkcnt_t' was here

mples/hidraw/hid-example.c:35:26: error: linux/hidraw.h: No such file or directory
samples/hidraw/hid-example.c: In function ‘main’:
samples/hidraw/hid-example.c:50: error: storage size of ‘rpt_desc’ isn’t known
samples/hidraw/hid-example.c:51: error: storage size of ‘info’ isn’t known
samples/hidraw/hid-example.c:67: error: ‘HIDIOCGRDESCSIZE’ undeclared (first use in this function)
samples/hidraw/hid-example.c:67: error: (Each undeclared identifier is reported only once
samples/hidraw/hid-example.c:67: error: for each function it appears in.)
samples/hidraw/hid-example.c:75: error: ‘HIDIOCGRDESC’ undeclared (first use in this function)
samples/hidraw/hid-example.c:86: warning: implicit declaration of function ‘HIDIOCGRAWNAME’
samples/hidraw/hid-example.c:93: warning: implicit declaration of function ‘HIDIOCGRAWPHYS’
samples/hidraw/hid-example.c:100: error: ‘HIDIOCGRAWINFO’ undeclared (first use in this function)
samples/hidraw/hid-example.c:51: warning: unused variable ‘info’
samples/hidraw/hid-example.c:50: warning: unused variable ‘rpt_desc’
make[2]: *** [samples/hidraw/hid-example] Error 1
make[1]: *** [samples/hidraw] Error 2
make: *** [vmlinux] Error 2

处理方法:

[root@localhost linux-3.5]# cp include/linux/hidraw.h /usr/include/linux/
 [root@localhost linux-3.5]# cp include/linux/hid.h /usr/include/linux/

vi  samples/hidraw/hid-example.c

将13-15行的如下3行移动到33行以后。

/* Linux */
#include <linux/types.h>
#include <linux/input.h>
#include <linux/hidraw.h> /* Unix */
#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h> /* C */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>

vi /usr/include/linux/input.h

line
#define BUS_PCI 0x01
#define BUS_ISAPNP 0x02
#define BUS_USB 0x03
#define BUS_HIL 0x04
#define BUS_BLUETOOTH 0x05
/*以下一行为新增*/
#define BUS_VIRTUAL 0x06 #define BUS_ISA 0x10
#define BUS_I8042 0x11
#define BUS_XTKBD 0x12
#define BUS_RS232 0x13
#define BUS_GAMEPORT 0x14
#define BUS_PARPORT 0x15
#define BUS_AMIGA 0x16
#define BUS_ADB 0x17
#define BUS_I2C 0x18
#define BUS_HOST 0x19
#define BUS_GSC 0x1A
/*以下两行为新增*/
#define BUS_ATARI 0x1B
#define BUS_SPI 0x1C

4.确定参数设置 .config

[root@localhost linux-3.5]# cat .config | grep CONFIG_DEBUG_INFO
CONFIG_DEBUG_INFO=y
[root@localhost linux-3.5]# cat .config | grep CONFIG_KPROBES
CONFIG_KPROBES=y
[root@localhost linux-3.5]# cat .config | grep CONFIG_RELAY
CONFIG_RELAY=y
[root@localhost linux-3.5]# cat .config | grep CONFIG_DEBUG_FS
CONFIG_DEBUG_FS=y
[root@localhost linux-3.5]# cat .config | grep CONFIG_MODULES
CONFIG_MODULES=y
[root@localhost linux-3.5]# cat .config | grep CONFIG_MODULE_UNLOAD
CONFIG_MODULE_UNLOAD=y [root@localhost linux-3.5]#cat .config | grep CONFIG_UTRACE (linux 3.5 没有这个选项)
CONFIG_UTRACE=y [root@localhost linux-3.5]#cat .config | grep CONFIG_SYSFS_DEPRECATED_V2 CONFIG_SYSFS_DEPRECATED_V2=y

5.make CONFIG_DEBUG_SECTION_MISMATCH=y         编绎内核

故障问题:
  编译内核时出现“make CONFIG_DEBUG_SECTION_MISMATCH=y” 错误提示:
   root@localhost linux-3.5]#make modules
   CHK     include/linux/version.h
   CHK     include/generated/utsrelease.h
   CALL    scripts/checksyscalls.sh
   Building modules, stage 2.
   MODPOST 1106 modules
   WARNING: modpost: Found 2 section mismatch(es).
   To see full details build your kernel with:
   'make CONFIG_DEBUG_SECTION_MISMATCH=y'
   排错记录:
   编辑.config文件,加入:CONFIG_DEBUG_SECTION_MISMATCH=y重新编译,还是出错,于是直接

make CONFIG_DEBUG_SECTION_MISMATCH=y编译成功。
    root@localhost linux-3.5]#make CONFIG_DEBUG_SECTION_MISMATCH=y

6.make  modules_install

7.make install

8.make headers_install

redhat server 5.3内核升极2.6.18 升级到 3.5 装systemtap 原创的更多相关文章

  1. 内核升极2.6.18 升级到 2.6.32 装systemtap 原创

    系统: redhat serever 5.3  linux 2.6.18 现在要升级到 LINUX 内核 2.6.32 安装步骤: 1.下载装源代码: https://www.kernel.org/ ...

  2. Ubuntu中升极下载4.2内核

    http://tech.hexun.com/2015-09-11/179027013.html 从这段话中所表达出的意思可以了解,Linux Kernel 4.3版本已经开始进行,Linus Torv ...

  3. CentOS6.0/RedHat Server 6.4安装配置过程 详细图解!

    1.准备安装 1.1 系统简介 CentOS 是什么? CentOS是一个基于Red Hat 企业级 Linux 提供的可自由使用的源代码企业级的 Linux 发行版本.每个版本的 CentOS 都会 ...

  4. CentOS和Redhat发行版linux内核版本的对应关系

    由于Redhat和CentOS的发行版本现在众多,所以我们应该知道CentOS和Redhat及linux内核之间版本的对应关系对维护系统还是很有帮助的.对应的列表如下: Redhat 9.0————— ...

  5. Redhat Server 5.7 安装配置PHP

    PHP的简介 PHP于1994年由Rasmus Lerdorf创建,刚刚开始是Rasmus Lerdorf 为了要维护个人网页而制作的一个简单的用Perl语言编写的程序.这些工具程序用来显示 Rasm ...

  6. Windows Server 2012 R2里十个极好的新功能

    Windows Server 2012 R2具备的众多新特点大大的增强了操作系统的功能性,同时也是在Windows Server 2012原有功能上的拓展.这里整理出Windows Server 20 ...

  7. 【转帖】如何在redhat单机服务器上运行postgresql的多个实例(howto run multiple postgresql instance on one redhat server)

    Running multiple PostgreSQL 9.2 Instances on one server in CentOS 6/RHEL 6/Fedora 原帖网站速度很慢,故转帖在此 Thi ...

  8. RedHat Server Enterprise 6安装G++

    RedHat 6默认是安装有GCC,而没有安装G++编译 要安装G++前最好先查看下GCC的版本号,通常GCC的版本和G++的版本是相同的,知道GCC的版本再去找G++的安装文件就容易些,版本号有在安 ...

  9. EPOLL内核原理极简图文解读(转)

    预备知识:内核poll钩子原理内核函数poll_wait把当前进程加入到驱动里自定义的等待队列上 当驱动事件就绪后,就可以在驱动里自定义的等待队列上唤醒调用poll的进程 故poll_wait作用:可 ...

随机推荐

  1. 洛谷P3088 挤奶牛

    传送门啦 这个题也是一个单调队列来优化的 $ dp $ ,我们考虑这个题,这个题让我们求出有多少奶牛会觉得拥挤,如果我们还像琪露诺那个题那样单纯用一次单调队列肯定是不行的,因为牛觉不觉得拥挤是受左右的 ...

  2. 使用JS实现2048小游戏

    JS实现2048小游戏源码 效果图: 代码如下,复制即可使用: (适用浏览器:360.FireFox.Chrome.Opera.傲游.搜狗.世界之窗. 不支持Safari.IE8及以下浏览器.) &l ...

  3. HttpRunner接口自动化测试框架

    简介 2018年python开发者大会上,了解到HttpRuuner开源自动化测试框架,采用YAML/JSON格式管理用例,能录制和转换生成用例功能,充分做到用例与测试代码分离,相比excel维护测试 ...

  4. VFS,super_block,inode,dentry—结构体图解

    总结: VFS只存在于内存中,它在系统启动时被创建,系统关闭时注销. VFS的作用就是屏蔽各类文件系统的差异,给用户.应用程序.甚至Linux其他管理模块提供统一的接口集合. 管理VFS数据结构的组成 ...

  5. ld 脚本浅析-LD手册粗糙翻译

    本文乃转载, 我在其基础上做了少量修改. 原作者的E-mail是zhanglei@sict.ac.cn. 完成于2005.11.5-2005.11.8 0. Contents 1. 概论2. 基本概念 ...

  6. RabbitMQ系列之RabbitMQ集群

    本文的集群是RabbitMq 自身的Cluster搭建 . #hosts准备: vim /etc/hosts #172.16.3.79 s1 #172.16.3.105 s2 172.16.2.10 ...

  7. 跟我一起学WPF(0):初识WPF

    WPF是什么 WPF是微软的新一代图形引擎系统,全称为Windows Presentation Foundation,从.NET3.0版本开始引入,为用户界面.2D/3D 图形.文档和媒体提供了统一的 ...

  8. PCA(Principal Component Analysis)主成分分析

    PCA的数学原理(非常值得阅读)!!!!   PCA(Principal Component Analysis)是一种常用的数据分析方法.PCA通过线性变换将原始数据变换为一组各维度线性无关的表示,可 ...

  9. 记录移动端html界面中底部输入框触发焦点时键盘会把输入框遮挡的问题

      //浏览器当前的高度 var oHeight = $(document).height(); //监听窗口大小的时候动态改变底部输入框控制器的定位 $(window).resize(functio ...

  10. Data时间格式化

    //时间戳转时间 function timeStamp2String(time) { var datetime = new Date(); datetime.setTime(time); var ye ...