差異處
這裏顯示兩個版本的差異處。
linux:mixed:get_linux_k_src_centos [2013/02/24 22:26] tony |
linux:mixed:get_linux_k_src_centos [2023/06/25 09:48] |
||
---|---|---|---|
行 1: | 行 1: | ||
- | {{tag>Linux Linux-kernel}} | ||
- | ====== 如何取得CentOS6.0 kernel完整source code? ====== | ||
- | 在我們使用yum install kernel-headers kernel-devel之後,還是無法看到所有的kernel source code。根據Reference 1的文章,首先到http://vault.centos.org/下載對應的kernel-source rpm。要取得CentOS6.0的就要下載http://vault.centos.org/6.0/updates/SRPMS/kernel-2.6.32-71.29.1.el6.src.rpm。\\ | ||
- | 執行以下shell script去build rpm: | ||
- | <code bash> | ||
- | yum install rpm-build redhat-rpm-config unifdef | ||
- | wget http://vault.centos.org/6.0/updates/SRPMS/kernel-2.6.32-71.29.1.el6.src.rpm | ||
- | rpm -i kernel-2.6.32-71.29.1.el6.src.rpm 2>&1 | grep -v mockb | ||
- | |||
- | cd ~/rpmbuild/SPECS | ||
- | # kernel.spec according to the filename. | ||
- | rpmbuild -bp --target=`uname -m` kernel.spec 2> prep-err.log | tee prep-out.log | ||
- | </code> | ||
- | |||
- | 可以去cat prep-err.log確認缺少的package並安裝在重新build。\\ | ||
- | {{:linux:mixed:build_kernel_src.png|}}\\ | ||
- | 經過漫長的等待,執行ls ~/rpmbuild/BUILD/kernel-2.6.32-71.29.1.el6/就可以看到你想要的東西了! | ||
- | |||
- | ===== Reference ===== | ||
- | - [[http://wiki.centos.org/HowTos/I_need_the_Kernel_Source|I need the kernel source.]] | ||
- | |||
- | ===== ===== | ||
- | ---- | ||
- | \\ | ||
- | ~~DISQUS~~ |