在Centos上打Preempt-rt实时补丁(续)

经过上一篇,发现2.6.31版本的补丁不能正常运行(还未找到原因),现改用2.6.33版本:

kernel:linux-2.6.33.9
patch:patch-2.6.33.9-rt

解压并打好补丁后,按照如下步骤进行:

1.配置内核

make mrprobe //清除环境变量,即清除配置文件
make menuconfig

  (1)进入菜单networking support -> networking options -> network packet filtering framework(netfilter)

    A.    core netfilter configuration

              勾中”Netfilter connection tracking support”

              将netbios name service protocal support(new) 编译成模块(状态用空格切换为“M”)

              勾中“Netfilter Xtables support (required for ip_tables)”

         B.    IP: Netfilter Configuration

              将“IPv4 connection tracking support (require for NAT)” 编译成模块(状态用空格切换为“M”)

              勾中IP tables support (required for filtering/masq/NAT)

              将“Full NAT” 下的 “MASQUERADE target support” 和 “REDIRECT target support” 编译成模块(状态用空格切换为“M”)

  (2)进入Processor type and features -> Preemption Mode

         A.    选中“Complete Preemption(Real-Time)”

         B.    选中“Thread Softirqs”和“Thread Hardirqs”

  (3)进入Device Drivers,去掉“Staging Drivers”

  (4)进入Device Drivers -> Network device support -> Network device support ->

    A. Intel(R) PRO/1000 Gigabit Ethernet support

    B. Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support

  (5)退出并保存

2.编译模块

make clean     // 确保所有东西均保持最新状态
make bzImage    // 生成内核文件
make modules     // 编译模块

3.安装

make modules_install  //  安装模块
make install  //   安装

此处,第二部会报错,形式如下:

[root@gdyang linux-2.6.33.9]# make install
sh /usr/src/linux-2.6.33.9/arch/x86/boot/install.sh 2.6.33.9-rt31 arch/x86/boot/bzImage 
        System.map "/boot"
ERROR: modinfo: could not find module aesni_intel
ERROR: modinfo: could not find module ablk_helper
ERROR: modinfo: could not find module xt_CHECKSUM
ERROR: modinfo: could not find module mperf
ERROR: modinfo: could not find module ip_tables
ERROR: modinfo: could not find module nf_defrag_ipv6
ERROR: modinfo: could not find module nf_conntrack
ERROR: modinfo: could not find module iwldvm
ERROR: modinfo: could not find module iwlwifi
ERROR: modinfo: could not find module lpc_ich
ERROR: modinfo: could not find module e1000e
ERROR: modinfo: could not find module ptp
ERROR: modinfo: could not find module xhci_hcd
ERROR: modinfo: could not find module i915
ERROR: modinfo: could not find module nouveau
ERROR: modinfo: could not find module mxm_wmi

但不影响系统启动。

4.后续处理

mkinitrd /boot/initrd-2.6.33.9-rt31.img 2.6.33.9-rt31 
cp arch/x86/boot/bzImage /boot/vmlinuz-2.6.33.9-rt31
cp /usr/src/linux-2.6.33.9/System.map /boot/System.map-2.6.33.9-rt31
机器人、自动化、控制
原文地址:https://www.cnblogs.com/okstill/p/4537216.html