How to?在我們使用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:
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
可以去cat prep-err.log確認缺少的package並安裝在重新build。
經過漫長的等待,執行ls ~/rpmbuild/BUILD/kernel-2.6.32-71.29.1.el6/就可以看到你想要的東西了!
留言
張貼留言