免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2543 | 回复: 5

[系统管理] linux动态打补丁kpatch [复制链接]

论坛徽章:
0
发表于 2014-11-06 15:33 |显示全部楼层
之前看到linux动态打补丁的帖子,在ubuntu上尝试了下,发现了个问题,请教大神们:
在32位的ubuntu14.04.1LTS上从官网上下载kpatch源码包,然后按照README将依赖包都安装了,然后make,报错退出,log:
mildren@mildrengong-virtual-PC:~/Downloads/kpatch-master$ make
make -C kpatch-build
make[1]: Entering directory `/home/mildren/Downloads/kpatch-master/kpatch-build'
gcc -MMD -MP -I../kmod/patch -Iinsn -Wall -g -c -o create-diff-object.o create-diff-object.c
create-diff-object.c: In function ‘kpatch_create_symbol_list’:
create-diff-object.c:455:6: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 8 has type ‘Elf64_Addr’ [-Wformat=]
      ERROR("symbol %s at offset %lu within section %s, expected 0",
      ^
gcc -MMD -MP -I../kmod/patch -Iinsn -Wall -g -c -o lookup.o lookup.c
gcc -MMD -MP -I../kmod/patch -Iinsn -Wall -g -c -o insn/insn.o insn/insn.c
gcc -MMD -MP -I../kmod/patch -Iinsn -Wall -g -c -o insn/inat.o insn/inat.c
gcc -I../kmod/patch -Iinsn -Wall -g create-diff-object.o lookup.o insn/insn.o insn/inat.o -o create-diff-object -lelf
make[1]: Leaving directory `/home/mildren/Downloads/kpatch-master/kpatch-build'
make -C kpatch
make[1]: Entering directory `/home/mildren/Downloads/kpatch-master/kpatch'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/mildren/Downloads/kpatch-master/kpatch'
make -C kmod
make[1]: Entering directory `/home/mildren/Downloads/kpatch-master/kmod'
make -C core clean
make[2]: Entering directory `/home/mildren/Downloads/kpatch-master/kmod/core'
rm -f -Rf .*.o.cmd .*.ko.cmd .tmp_versions *.o *.ko *.mod.c \
        Module.symvers
make[2]: Leaving directory `/home/mildren/Downloads/kpatch-master/kmod/core'
make -C core
make[2]: Entering directory `/home/mildren/Downloads/kpatch-master/kmod/core'
make -C /lib/modules/3.13.0-36-generic/build M=/home/mildren/Downloads/kpatch-master/kmod/core kpatch.ko
make[3]: Entering directory `/usr/src/linux-headers-3.13.0-36-generic'
  CC [M]  /home/mildren/Downloads/kpatch-master/kmod/core/core.o
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:54:2: error: #error "CONFIG_FUNCTION_TRACER, CONFIG_HAVE_FENTRY, CONFIG_MODULES, CONFIG_SYSFS, CONFIG_KALLSYMS_ALL kernel config options are required"
#error "CONFIG_FUNCTION_TRACER, CONFIG_HAVE_FENTRY, CONFIG_MODULES, CONFIG_SYSFS, CONFIG_KALLSYMS_ALL kernel config options are required"
  ^
/home/mildren/Downloads/kpatch-master/kmod/core/core.c: In function ‘kpatch_write_relocations’:
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:614:8: error: ‘R_X86_64_NONE’ undeclared (first use in this function)
   case R_X86_64_NONE:
        ^
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:614:8: note: each undeclared identifier is reported only once for each function it appears in
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:616:8: error: ‘R_X86_64_PC32’ undeclared (first use in this function)
   case R_X86_64_PC32:
        ^
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:622:8: error: ‘R_X86_64_32S’ undeclared (first use in this function)
   case R_X86_64_32S:
        ^
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:627:8: error: ‘R_X86_64_64’ undeclared (first use in this function)
   case R_X86_64_64:
        ^
/home/mildren/Downloads/kpatch-master/kmod/core/core.c:654:28: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
   ret = probe_kernel_write((void *)loc, &val, size);
                            ^
make[4]: *** [/home/mildren/Downloads/kpatch-master/kmod/core/core.o] Error 1
make[3]: *** [kpatch.ko] Error 2
make[3]: Leaving directory `/usr/src/linux-headers-3.13.0-36-generic'
make[2]: *** [kpatch.ko] Error 2
make[2]: Leaving directory `/home/mildren/Downloads/kpatch-master/kmod/core'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/mildren/Downloads/kpatch-master/kmod'
make: *** [build-kmod] Error 2
mildren@mildrengong-virtual-PC:~/Downloads/kpatch-master$

求大神解答

论坛徽章:
0
发表于 2014-11-06 15:34 |显示全部楼层
另外在64位的ubuntu14.04.1LTS上,直接一次性编译通过,难道是kpatch不兼容32位系统???

论坛徽章:
13
技术图书徽章
日期:2014-04-29 14:15:42IT运维版块每日发帖之星
日期:2015-12-12 06:20:00IT运维版块每日发帖之星
日期:2015-08-30 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-08-02 06:20:002015年亚洲杯之澳大利亚
日期:2015-04-03 15:03:12申猴
日期:2015-03-20 09:00:292015年迎新春徽章
日期:2015-03-04 09:54:452015年辞旧岁徽章
日期:2015-03-03 16:54:15季节之章:冬
日期:2015-01-20 17:08:47双子座
日期:2014-11-21 16:30:31技术图书徽章
日期:2014-07-11 16:29:08
发表于 2014-11-06 15:48 |显示全部楼层
Capture.PNG

论坛徽章:
0
发表于 2014-11-06 17:00 |显示全部楼层
在他的README中没有看到这方面的说明啊

论坛徽章:
13
技术图书徽章
日期:2014-04-29 14:15:42IT运维版块每日发帖之星
日期:2015-12-12 06:20:00IT运维版块每日发帖之星
日期:2015-08-30 06:20:00IT运维版块每日发帖之星
日期:2015-08-24 06:20:00IT运维版块每日发帖之星
日期:2015-08-02 06:20:002015年亚洲杯之澳大利亚
日期:2015-04-03 15:03:12申猴
日期:2015-03-20 09:00:292015年迎新春徽章
日期:2015-03-04 09:54:452015年辞旧岁徽章
日期:2015-03-03 16:54:15季节之章:冬
日期:2015-01-20 17:08:47双子座
日期:2014-11-21 16:30:31技术图书徽章
日期:2014-07-11 16:29:08
发表于 2014-11-06 18:37 来自手机 |显示全部楼层
肯定别的地方有资料说明呢!

论坛徽章:
0
发表于 2014-11-13 17:23 |显示全部楼层
恩,我问了下kpatch的作者,他也明确说了只支持64位系统。谢谢你的回复。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP