0

嘿,下面的问题:我在工作中使用了一个相当奇怪的 linux 发行版(Centos 5),它似乎有一个较旧的内核(或至少内核中有一些差异),你不能简单地更新它。我需要安装的程序需要一个函数crypto_destro_tfm(还有更多问题,但这是目前唯一的错误),它包含在文件linux/crypto/api.c中 - 所以我假设它在内核模块crypto_api中。问题是:在我的发行版上,我什至没有crypto/api.c,即使我有一个模块crypto_api.ko,似乎这个函数也不在那里。

我的计划如下:从较新的 linux 发行版中获取 crypto_api,然后对其进行编译并将模块加载到我的 centos 中。

现在我希望你们中的一些人能告诉我我需要做什么来重建和替换那个模块。当然,我确实拥有来自较新内核的所有源文件。(只是提醒你:我不能简单地重新编译和使用更新的内核,b/c centos 就这样糟透了)谢谢

FWIW:这是确切的错误

警告:“crypto_destroy_tfm”[/home/Chris/digsig-patched/digsig_verif.ko] 未定义!

4

2 回答 2

0

There is a good chance backporting API change in an older kernel will lead to a cascade of problem. Let's suppose you backport crypto api of version 2.6.Y to your local version, 2.6.X

Now you have the following situation :

  • module crypto api export 2.6.Y functions
  • your external module might be Happy with that situation
  • all other module that depends on version 2.6.X of the crypto API will complain.

But wait, I can backport recent kernel code into all the modules that complain, and here we go... Oops, but then we have the former situation, but now each backported module might trigger a similar situation.

If you can't update the CentOS kernel, because the CentOS kernel has a lot of custom code you are afraid to loose when going with a "vanilla" kernel, then you may find that it is an easier task to "downgrade" your external module :

  • Look at the current crypto API (for example using lxr.linux.no)
  • Look at your kernel version of this API
  • Try to see how the new API could be replaced with call to the old API to provide a similar function.
  • Modify your external module to use the old API instead of the new one.

In any case, you may not be able to replace your kernel with a vanilla one, but you should at least be able to rebuild it, and then to patch it and rebuild it etc... If you can't do this simple task, then I don't think backporting anything will be successful.

于 2011-02-28T16:00:02.727 回答
0

尝试从具有该模块的较新版本的 CentOS 下载 SRC RPM,然后在 CentOS 5 上重新编译 RPM:

rpmbuild --rebuild kernel-X.XX-X.src.rpm

我没有 CentOS 的副本可供比较,因此您需要阅读 rpm/rpmbuild 上的手册页,但我发现重新编译包括内核及其所有模块的整个软件包比试图只是更安全从较新的内核移植一个模块。当我需要更新的软件包时,我偶尔会在 Debian/Ubuntu 上这样做。

于 2011-04-02T07:40:34.390 回答