有2 中方法 添加驱动, 1 种单独编译ko,将ko打包成rpm安装,这种方法比较麻烦,后面介绍,好处是不需要每次编译整个内核。 2编译整个内核,编译时勾选ocfs2选项。好处时方便,但耗时;下面介绍编译整个内核加ocfs2选项。
一 环境准备
1 安装 centos8 最新版
下载路径: https://www.centos.org/
使用最小安装, 配置好源
注意: / 目录空间要足够大
2 下载内核源码
使用 5.4 内核
下载路径: https://github.com/torvalds/linux/releases
二 编译5.4内核ocfs2驱动
1 安装 开发环境
yum groups install development -y
yum install bc ncurses-devel openssl-devel elfutils-libelf-devel rsync -y
如果需要编译 某些特殊的特性, 参考文件
linux-5.4/Documentation/process/changes.rst
里面介绍了 安装某些特性需要的工具和工具下载地址