centos 下centos源码下载安装
来源:互联网 发布:linux recvfrom 编辑:程序博客网 时间:2024/06/05 11:32
I Need the Kernel Source
Created by JohnnyHughes. Currently maintained byAlanBartlett andAkemiYagi.
Contents
- Maybe you do not need the full kernel source
- If you really need the full kernel source
1. Maybe you do not need the full kernel source
If you need to compile a kernel driver module, the chances are youdo not really need thefull kernel source tree. You might just need thekernel-devel package. (If, however, you are certain that the full source tree is required, please follow the instructions in Section 2.)
In CentOS 6, there is just one kernel-devel package available:
kernel-devel (both 32- & 64-bit architectures)
In CentOS 5, there are three kernel-devel packages available:
kernel-devel (both 32- & 64-bit architectures)
kernel-xen-devel (both 32- & 64-bit architectures)
- kernel-PAE-devel (32-bit architecture only)
If you are running the standard kernel (for example), you can install the kernel-devel package by:
[root@host]# yum install kernel-devel
You can use this command to determine the version of your running kernel:
[root@host]# uname -r
The result will look similar to this:
2.6.18-308.11.1.el5xen
In this case, the xen kernel is installed and the way to install this specific kernel-devel package is:
[root@host]# yum install kernel-xen-devel
Please ensure that you install thekernel-devel package thatmatches your running kernel. Seethis FAQ for details.
If your kernel is not listed by yum because it is in an older tree, you can download it manually from the CentOS Vault. Pick the version of CentOS you are interested in and then, for thearch, look in either theos/arch/CentOS/RPMS/ or theupdates/arch/RPMS/ directories for thekernel[-type]-devel-version.arch.rpm
Once you have the proper kernel[-type]-devel-version.arch.rpm installed, try to compile your module. It should work this way. If it does not, please provide feedback to the module's developer as this is the way all new kernel modules should be designed to be built.
2. If you really need the full kernel source
If you really must have the kernel source tree, for whatever reason, it is obtainable.
As an ordinary user, not root, create a build tree based on a ~/rpmbuild/ directory:
[user@host]$ mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}[user@host]$ echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
You arestrongly advisedagainst package building as root. (See:Building Source RPM as non-root under CentOS)
To install the source package and tools for CentOS 6:
As root, install the rpm-build, redhat-rpm-config, asciidoc, hmaccalc, binutils-devel, elfutils-libelf-devel, newt-devel and zlib-devel packages:
[root@host]# yum install rpm-build redhat-rpm-config asciidoc hmaccalc[root@host]# yum install binutils-devel elfutils-libelf-devel newt-devel zlib-devel
Find the kernel source rpm package in:
http://vault.centos.org/6.N/os/Source/SPackages/
http://vault.centos.org/6.N/updates/Source/SPackages/
(Replace the "N" with the relevant update version number.)
As an ordinary user, not root, install the source package by executing:
[user@host]$ rpm -i http://vault.centos.org/6.2/updates/Source/SPackages/kernel-2.6.32-279.2.1.el6.src.rpm 2>&1 | grep -v mock
To install the source package and tools for CentOS 5:
As root, install the rpm-build, redhat-rpm-config and unifdef packages:
[root@host]# yum install rpm-build redhat-rpm-config unifdef
Find the kernel source rpm package in:
http://vault.centos.org/5.N/os/SRPMS/
http://vault.centos.org/5.N/updates/SRPMS/
(Replace the "N" with the relevant update version number.)
As an ordinary user, not root, install the source package by executing:
[user@host]$ rpm -i http://vault.centos.org/5.8/updates/SRPMS/kernel-2.6.18-308.11.1.el5.src.rpm 2>&1 | grep -v mock
Now that the source package and tools are installed, unpack and prepare the source files:
[user@host]$ cd ~/rpmbuild/SPECS[user@host SPECS]$ rpmbuild -bp --target=$(uname -m) kernel.spec
The value of $(uname -m) sets the target to the architecture of your current kernel. This is generally accepted, as most people will need either i686 or x86_64 as the target.
The kernel source tree will now be found under the ~/rpmbuild/BUILD/kernel*/linux*/ directory.
先创建mockbuild用户与组,然后在编译
[root@houyi-vm33 ~]# groupadd mockbuild
[root@houyi-vm33 ~]# useradd mockbuild -g mockbuild
- centos 下centos源码下载安装
- centos下git源码安装
- centos 下postgres源码安装
- CentOS下源码安装mongodb
- centos 下postgres源码安装
- centos下源码安装mysql
- CentOS 下源码安装php
- CentOS下源码安装PostgreSQL
- centOS下,源码安装erlang
- centos下源码安装mysql
- Centos 下源码安装MySQL
- centos下源码安装lamp
- Centos下源码安装mysql
- CentOS 7下LAMP源码安装(2)设置及源码下载
- centos源码下载网址
- centos源码下载地址
- centos源码下载网址
- CentOS下SVN简介、下载、安装
- iphone中GPS精确定位及反向获取地址信息
- OpenGl纹理映射
- qt 背景随窗口变化
- jvm hotspot 源码分析 RandomAccessfile vs FileChannel 写文件
- DM365软件环境搭建步骤
- centos 下centos源码下载安装
- 数据库出现 enq: TX - row lock contention
- Linux mannual page to txt
- Shadowmap
- linux启动流程
- RSA 学习
- SVM百家争鸣之多分类超球支持向量机
- 机器学习——深度学习(Deep Learning)
- C++著名程序库的比较和学习经验