挂载 CentOS-7-x86_64-Everything-2003.iso
备份 yum 源
cd /etc/yum.repos.d/
mkdir bak
mv *.* bak/
echo "
[local_yum_source]
name=my_local_source
baseurl=file:///mnt/cdrom
gpgcheck=0
enabled=1
"> /etc/yum.repos.d/local.repo
mkdir -p /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
yum install gcc perl -y
umount /mnt/cdrom/
挂载
mount /dev/sr0 /mnt/
[root@sx-wx-baremetal-zm4-1 yum.repos.d]# cd /mnt/
[root@sx-wx-baremetal-zm4-1 mnt]# ll
total 264766
-r-xr-xr-x 1 root root 3291 Jun 12 09:35 4.4升级3408的驱动说明.txt
-r-xr-xr-x 1 root root 1721720 Jun 9 09:02 i40e-2.10.19.82-1.x86_64_by_xy.rpm
-r-xr-xr-x 1 root root 1721424 Jun 8 09:57 i40e-2.10.19.82-1.x86_64.rpm
-r-xr-xr-x 1 root root 0 Jun 8 10:07 i40e-2.10.19.82-1.x86_64.rpm 对应内核 4.4.197.txt
-r-xr-xr-x 1 root root 566983 Apr 29 03:27 i40e-2.10.19.82.tar.gz
-r-xr-xr-x 1 root root 9360 Jun 8 09:42 i40e.spec
-r-xr-xr-x 1 root root 41129388 Dec 19 09:47 kernel-lt-4.4.197-1.el7.elrepo.x86_64.rpm
-r-xr-xr-x 1 root root 48803201 Jun 11 08:32 kernel-lt-4.4.197.zip
-r-xr-xr-x 1 root root 10695096 Jun 8 09:53 kernel-lt-devel-4.4.197-1.el7.elrepo.x86_64.rpm
-r-xr-xr-x 1 root root 133382531 Jun 8 03:35 linux-4.4.197.tar.gz
-r-xr-xr-x 1 root root 32946372 Nov 20 2016 linux-firmware-20160830-49.git7534e19.el7.noarch.rpm
-r-xr-xr-x 1 root root 137533 Apr 17 11:34 megaraid_sas-07.712.02.00-src.tar.gz
-r-xr-xr-x 1 root root 136 Jun 8 10:34 readme.txt
[root@sx-wx-baremetal-zm4-1 mnt]#
[root@sx-wx-baremetal-zm4-1 mnt]# cp i40e-2.10.19.82-1.x86_64.rpm kernel-lt-4.4.197-1.el7.elrepo.x86_64.rpm kernel-lt-devel-4.4.197-1.el7.elrepo.x86_64.rpm linux-firmware-20160830-49.git7534e19.el7.noarch.rpm megaraid_sas-07.712.02.00-src.tar.gz /root/
[root@sx-wx-baremetal-zm4-1 mnt]# cd /root/
[root@sx-wx-baremetal-zm4-1 ~]# ll
total 84628
-rw-------. 1 root root 6921 Oct 5 2018 anaconda-ks.cfg
-r-xr-xr-x 1 root root 1721424 Jun 12 12:36 i40e-2.10.19.82-1.x86_64.rpm
-r-xr-xr-x 1 root root 41129388 Jun 12 12:37 kernel-lt-4.4.197-1.el7.elrepo.x86_64.rpm
-r-xr-xr-x 1 root root 10695096 Jun 12 12:37 kernel-lt-devel-4.4.197-1.el7.elrepo.x86_64.rpm
-r-xr-xr-x 1 root root 32946372 Jun 12 12:37 linux-firmware-20160830-49.git7534e19.el7.noarch.rpm
-r-xr-xr-x 1 root root 137533 Jun 12 12:37 megaraid_sas-07.712.02.00-src.tar.gz
-rw-------. 1 root root 6577 Oct 5 2018 original-ks.cfg
rpm -ivh linux-firmware-20160830-49.git7534e19.el7.noarch.rpm
rpm -ivh kernel-lt-*
#
tar zxvf megaraid_sas-07.712.02.00-src.tar.gz
chmod -R 775 megaraid_sas-07.712.02.00
cd megaraid_sas-07.712.02.00
# 据我猜测,应该是指定某个内核版本结合源码文件进行编译生成ko驱动文件
# build是内核文件,lib和/usr/lib一个位置
make -C /lib/modules/4.4.197-1.el7.elrepo.x86_64/build/ M=`pwd` modules
# 拷贝这个这个驱动文件到指定的
cp megaraid_sas.ko /usr/lib/modules/4.4.197-1.el7.elrepo.x86_64/kernel/drivers/scsi/megaraid
cd /boot/
ls -ltr
cp initramfs-4.4.197-1.el7.elrepo.x86_64.img initramfs-4.4.197-1.el7.elrepo.x86_64.img.bak
# mkinitrd命令建立要载入ramdisk的映像文件,以供Linux开机时载入ramdisk
mkinitrd -v -f /boot/initramfs-4.4.197-1.el7.elrepo.x86_64.img 4.4.197-1.el7.elrepo.x86_64 --force
# 查看grub启动项
awk -F\' '$1=="menuentry " {print i++ " : " $2} ' /etc/grub2.cfg
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-set-default 0
reboot
centos7.5 3.10升级内核4.4.197 说明
最新推荐文章于 2024-06-20 17:01:57 发布