diff --git a/README.md b/README.md index c993a79582509d9626b3f62e3b684ef88b6f7b3d..0c29d4fa47d0a127027ecfd6b7c1a27485744f8d 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,75 @@ # kpatch-build #### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} +kpatch-build 是一款热补丁制作工具,可在不重启系统和中断业务的情况下对操作系统内核进行CVE和Bug修复。 + +支持架构: +X86,ARM64 + +上游社区:https://github.com/dynup/kpatch #### 软件架构 软件架构说明 - +![输入图片说明](image.png) #### 安装教程 -1. xxxx -2. xxxx -3. xxxx +教程以龙蜥操作系统Anolis OS 8.6,内核版本4.19.91-26.4.an8.x86_64为例说明热补丁制作全流程。 + +1.安装软件包 + +yum install -y make gcc patch bison flex openssl-devel elfutils elfutils-devel dwarves + +在制作热补丁过程中出现命令或头文件找不到,可以根据出错提示安装对应软件包即可。 + +2.下载kernel-debuginfo,kernel-devel,kernel source + +源代码下载地址: https://anas.openanolis.cn/errata/detail/ANSA-2022:0692 + +debuginfo地址:https://mirrors.aliyun.com/anolis/8.6/Plus/x86_64/debug/Packages/?spm=a2c6h.25603864.0.0.3b5a47ca8f4z6h + +kernel-devel: https://anas.openanolis.cn/errata/detail/ANSA-2022:0692 + +分别解压三个软件包(rpm2cpio xxx.rpm | cpio -div),依次提取出vmlinux, .config和kernel source,并放置在同一个目录。 + +3.下载kpatch-build + +wget https://gitee.com/anolis/kpatch-build/repository/archive/master.zip + +4.编译kpatch-build + +解压master.zip,并编译安装kpatch-build + make BUILDMOD=no + make install + +5.制作热补丁 + +kpatch-build -n kpatch-test -s /root/hotfix/linux-4.19.91-26.4.an7 -c /root/hotfix/.config -v /root/hotfix/vmlinux -o /root/hotfix/output/ -dddddd -R /root/hotfix/test-livepatch.patch + +其中: +-s:指向源代码目录 +-c: config目录 +-v:vmlinux目 +-o:产物输出目录 +test-livepatch.patch 补丁文件 #### 使用说明 -1. xxxx -2. xxxx -3. xxxx +加载: + +kpatch load kpatch-test.ko + +卸载: + +kpatch unload kpatch-test.ko + +查看热补丁列表: + +kpatch list #### 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +4. 新建 Pull Request \ No newline at end of file diff --git a/image.png b/image.png new file mode 100644 index 0000000000000000000000000000000000000000..f4dcf0e7eabb47beaf861ea22c5065a0a057d919 Binary files /dev/null and b/image.png differ