1.获取网卡驱动源码 点击跳转到realtek官网下载页面
2.升级内核(可选) 不确定这个网卡依赖还是不依赖内核,建议升级内核版本
2.1 检查是否安装ELRepo 1 2 3 4 yum --disablerepo="*" --enablerepo="elrepo-kernel" list available 已加载插件:fastestmirror Error getting repository data for elrepo-kernel, repository not found
2.2 升级安装ELRepo 1 2 3 4 5 6 7 8 yum -y update rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org yum -y update rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
2.3.查看可用安装包 1 2 3 4 yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
2.4 手动下载 1 2 3 4 5 6 7 8 9 10 wget http://linux-mirrors.fnal.gov/linux/elrepo/archive/kernel/el7/x86_64/RPMS/kernel-lt-headers-5.4.242-1.el7.elrepo.x86_64.rpm wget http://linux-mirrors.fnal.gov/linux/elrepo/archive/kernel/el7/x86_64/RPMS/kernel-lt-tools-libs-5.4.242-1.el7.elrepo.x86_64.rpm wget http://linux-mirrors.fnal.gov/linux/elrepo/archive/kernel/el7/x86_64/RPMS/kernel-lt-devel-5.4.242-1.el7.elrepo.x86_64.rpm wget http://linux-mirrors.fnal.gov/linux/elrepo/archive/kernel/el7/x86_64/RPMS/kernel-lt-tools-5.4.242-1.el7.elrepo.x86_64.rpm wget http://linux-mirrors.fnal.gov/linux/elrepo/archive/kernel/el7/x86_64/RPMS/kernel-lt-tools-5.4.242-1.el7.elrepo.x86_64.rpm rpm -qa | grep kernel grub2-mkconfig -o /boot/grub2/grub.cfg
2.5 查看内核启动顺序 1 2 3 4 5 6 awk -F\' ' $1 =="menuentry " {print i++ " : " $2 }' /boot/grub2/grub.cfg 0 : CentOS Linux (5.4.108-1.el7.elrepo.x86_64) 7 (Core) 1 : CentOS Linux (3.10.0-1160.11.1.el7.x86_64) 7 (Core) 2 : CentOS Linux (3.10.0-1160.el7.x86_64) 7 (Core) 3 : CentOS Linux (0-rescue-20210128140208453518997635111697) 7 (Core)
2.6 安装辅助工具 1 sudo yum install -y grub2-pc
2.7 设置内核启动顺序 1 sudo grub2-set-default 0
2.8 重新生成grub配置文件 1 sudo grub2-mkconfig -o /boot/grub2/grub.cfg
2.9 重启
3.更换gcc 1 2 3 4 5 6 7 8 9 wget https://mirrors.ustc.edu.cn/centos/7.9.2009/sclo/x86_64/rh/Packages/d/devtoolset-8-binutils-2.30-55.el7.1.x86_64.rpm wget https://mirrors.ustc.edu.cn/centos/7.9.2009/sclo/x86_64/rh/Packages/d/devtoolset-8-gcc-8.3.1-3.2.el7.x86_64.rpm wget https://mirrors.ustc.edu.cn/centos/7.9.2009/sclo/x86_64/rh/Packages/d/devtoolset-8-gcc-c%2B%2B-8.3.1-3.2.el7.x86_64.rpm wget https://mirrors.ustc.edu.cn/centos/7.9.2009/sclo/x86_64/rh/Packages/d/devtoolset-8-gcc-gdb-plugin-8.3.1-3.2.el7.x86_64.rpm wget https://mirrors.ustc.edu.cn/centos/7.9.2009/sclo/x86_64/rh/Packages/d/devtoolset-8-gcc-gfortran-8.3.1-3.2.el7.x86_64.rpm wget https://mirrors.ustc.edu.cn/centos/7.9.2009/sclo/x86_64/rh/Packages/d/devtoolset-8-gcc-plugin-devel-8.3.1-3.2.el7.x86_64.rpm wget https://mirrors.ustc.edu.cn/centos/7.9.2009/sclo/x86_64/rh/Packages/d/devtoolset-8-libquadmath-devel-8.3.1-3.2.el7.x86_64.rpm wget https://mirrors.ustc.edu.cn/centos/7.9.2009/sclo/x86_64/rh/Packages/d/devtoolset-8-libstdc%2B%2B-devel-8.3.1-3.2.el7.x86_64.rpm wget https://mirrors.ustc.edu.cn/centos/7.9.2009/sclo/x86_64/rh/Packages/d/devtoolset-8-runtime-8.1-1.el7.x86_64.rpm
将所有下载好的软件包安装完毕 激活toolchain
1 2 3 4 5 6 7 8 9 10 11 cd /opt/rh/devtoolset-8 ./enablemv /usr/bin/gcc /usr/bin/gcc-4.8.5 ln -s /opt/rh/devtoolset-8/root/bin/gcc /usr/bin/gcc mv /usr/bin/g++ /usr/bin/g++-4.8.5 ln -s /opt/rh/devtoolset-8/root/bin/g++ /usr/bin/g++ 查看gcc版本是否已经升级成功 gcc --version g++ --version
4.开始编译第一步下载驱动源码,并安装 1 2 cd r8125-9.011.01 ./autorun.sh