简体   繁体   English

CentOS:将内核打包到RPM中

[英]CentOS : Packing Kernel into RPM

I'm currently using CentOS 6 as a KVM host and will need to customise the kernel to suppport vfio-pci. 我目前正在使用CentOS 6作为KVM主机,并且需要自定义内核以支持vfio-pci。

Where can I get the spec file for kernel 3.10+ or is there a src.rpm I can download that'll support this feature? 在哪里可以获取内核3.10+的规范文件,或者可以下载支持该功能的src.rpm吗?

Additionally, I'll also need to patch the kernel with acs override patch and i915 vga arbiter fixes as mentioned in this article: https://bbs.archlinux.org/viewtopic.php?id=162768 此外,我还需要使用本文中提到的acs覆盖补丁和i915 vga仲裁程序补丁来修补内核: https ://bbs.archlinux.org/viewtopic.php?id=162768

Here's a thread for the ACS override patch: https://lkml.org/lkml/2013/5/30/513 and for the i915 vga arbiter fix: https://lkml.org/lkml/2014/5/9/517 这是ACS覆盖补丁程序的线程: https : //lkml.org/lkml/2013/5/30/513和i915 vga仲裁程序修复程序的线程: https : //lkml.org/lkml/2014/5/9/ 517

How to I apply these patches to the kernel? 如何将这些补丁应用到内核? Thanks. 谢谢。

I've decided to move to Fedora as they're more focussed on leading and advancement. 我决定搬到Fedora,因为他们更加专注于领导和进步。 I think it's more suited for the system I'm building. 我认为它更适合我正在构建的系统。

Anyway, if you still interested in building the kernel on CentOS system, here's some of the things you can do. 无论如何,如果您仍然对在CentOS系统上构建内核感兴趣,可以执行以下操作。

SRPM of the kernel can be downloaded from ELRepo via the following link: http://elrepo.org/people/ajb/tmp/ 可以通过以下链接从ELRepo下载内核的SRPM: http ://elrepo.org/people/ajb/tmp/

However, it doesn't include the source file. 但是,它不包含源文件。 You'll need to download this separately at: https://www.kernel.org/ 您需要在以下位置单独下载该文件: https : //www.kernel.org/

For the patch files, it's the difference between the source and target files. 对于补丁文件,这是源文件和目标文件之间的区别。 Save these differences as files. 将这些差异另存为文件。 eg I would save the code below as a file called doc_kernel_param_patch: 例如,我将以下代码另存为一个名为doc_kernel_param_patch的文件:

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 47bb23c..a60e6ad 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -2349,6 +2349,16 @@ bytes respectively. Such letter suffixes can also be entirely omitted. nomsi Do not use MSI for native PCIe PME signaling (this makes all PCIe root ports use INTx for all services).

+ pcie_acs_override = + [PCIE] Override missing PCIe ACS support for: + downstream + All downstream ports - full ACS capabilties + multifunction + All multifunction devices - multifunction ACS subset + id:nnnn:nnnn + Specfic device - full ACS capabilities + Specified as vid:did (vendor/device ID) in hex + pcmv= [HW,PCMCIA] BadgePAD 4

`pd.        [PARIDE]`

You'll also need to update the specs file to refer to the patch files created: 您还需要更新规格文件以引用创建的补丁文件:

Patch0 doc_kernel_param_patch

You can now start the build process. 现在,您可以开始构建过程。 For more information refer to the following post: https://www.centos.org/forums/viewtopic.php?f=14&t=50512 有关更多信息,请参见以下文章: https : //www.centos.org/forums/viewtopic.php?f=14&t=50512

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM