﻿{"id":140,"date":"2018-06-06T11:10:01","date_gmt":"2018-06-06T03:10:01","guid":{"rendered":"http:\/\/www.cloudy.pub\/?p=140"},"modified":"2018-06-06T11:29:26","modified_gmt":"2018-06-06T03:29:26","slug":"centos-7-%e5%ae%89%e8%a3%85%e6%ba%90%e7%a0%81kernel-source%ef%bc%88%e6%ba%90%e7%a0%81%e6%a0%91%ef%bc%89%e7%bc%96%e8%af%91%e9%a9%b1%e5%8a%a8%ef%bc%88%e8%bd%ac%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.0moon.com\/?p=140","title":{"rendered":"centos 7 kernel\u7f16\u8bd1\u5b89\u88c5\uff08\u8f6c\uff09"},"content":{"rendered":"<div class=\"article-title-box\"><\/div>\n<div class=\"article-info-box\">\n<div class=\"article-bar-top d-flex\">\n<div class=\"float-right\"><\/div>\n<\/div>\n<\/div>\n<article>\n<div id=\"article_content\" class=\"article_content clearfix csdn-tracking-statistics\" data-pid=\"blog\" data-mod=\"popu_307\" data-dsm=\"post\">\n<div class=\"markdown_views\">\n<h3 id=\"1\u5b89\u88c5\u6e90\u7801\u7f16\u8bd1\u9a71\u52a8\"><a name=\"t0\"><\/a>1,\u5b89\u88c5\u6e90\u7801\uff0c\u7f16\u8bd1\u9a71\u52a8<\/h3>\n<p><a href=\"https:\/\/wiki.centos.org\/HowTos\/I_need_the_Kernel_Source\" target=\"_blank\" rel=\"noopener\">https:\/\/wiki.centos.org\/HowTos\/I_need_the_Kernel_Source<\/a><\/p>\n<h3 id=\"2\u5728\u8fd9\u91cc\u53ef\u4ee5\u627e\u5230\u4f60\u8981\u7684kernel-\u6e90\u4ee3\u7801\"><a name=\"t1\"><\/a>2,\u5728\u8fd9\u91cc\u53ef\u4ee5\u627e\u5230\u4f60\u8981\u7684kernel \u6e90\u4ee3\u7801<\/h3>\n<p><a href=\"http:\/\/vault.centos.org\/7.0.1406\/os\/Source\/SPackages\/\" target=\"_blank\" rel=\"noopener\">http:\/\/vault.centos.org\/7.0.1406\/os\/Source\/SPackages\/<\/a><\/p>\n<h3 id=\"3\u5b89\u88c5\u5fc5\u8981\u7684\u5de5\u5177\"><a name=\"t2\"><\/a>3,\u5b89\u88c5\u5fc5\u8981\u7684\u5de5\u5177<\/h3>\n<pre class=\"prettyprint\"><code class=\"hljs lasso has-numbering\">yum install rng<span class=\"hljs-attribute\">-tools<\/span> \r\nyum install rpm<span class=\"hljs-attribute\">-build<\/span> redhat<span class=\"hljs-attribute\">-rpm<\/span><span class=\"hljs-attribute\">-config<\/span> unifdef \r\n<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<li>2<\/li>\n<li>3<\/li>\n<\/ul>\n<h3 id=\"4\u5b89\u88c5\u6e90\u7801\"><a name=\"t3\"><\/a>4,\u5b89\u88c5\u6e90\u7801<\/h3>\n<pre class=\"prettyprint\"><code class=\"hljs avrasm has-numbering\">rpm -i http:\/\/vault<span class=\"hljs-preprocessor\">.centos<\/span><span class=\"hljs-preprocessor\">.org<\/span>\/<span class=\"hljs-number\">6.7<\/span>\/updates\/Source\/SPackages\/kernel-<span class=\"hljs-number\">2.6<\/span><span class=\"hljs-number\">.32<\/span>-<span class=\"hljs-number\">573.8<\/span><span class=\"hljs-number\">.1<\/span><span class=\"hljs-preprocessor\">.el<\/span>6<span class=\"hljs-preprocessor\">.src<\/span><span class=\"hljs-preprocessor\">.rpm<\/span> <span class=\"hljs-number\">2<\/span>&gt;&amp;<span class=\"hljs-number\">1<\/span> | grep -v exist<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<\/ul>\n<h3 id=\"5\u7f16\u8bd1\u5de5\u5177\"><a name=\"t4\"><\/a>5,\u7f16\u8bd1\u5de5\u5177<\/h3>\n<pre class=\"prettyprint\"><code class=\"hljs lasso has-numbering\">yum install rpm<span class=\"hljs-attribute\">-build<\/span> redhat<span class=\"hljs-attribute\">-rpm<\/span><span class=\"hljs-attribute\">-config<\/span> asciidoc bison hmaccalc patchutils perl<span class=\"hljs-attribute\">-ExtUtils<\/span><span class=\"hljs-attribute\">-Embed<\/span> xmlto \r\n\r\nyum install audit<span class=\"hljs-attribute\">-libs<\/span><span class=\"hljs-attribute\">-devel<\/span> binutils<span class=\"hljs-attribute\">-devel<\/span> elfutils<span class=\"hljs-attribute\">-devel<\/span> elfutils<span class=\"hljs-attribute\">-libelf<\/span><span class=\"hljs-attribute\">-devel<\/span>\r\n\r\n yum install newt<span class=\"hljs-attribute\">-devel<\/span> python<span class=\"hljs-attribute\">-devel<\/span> zlib<span class=\"hljs-attribute\">-devel<\/span>\r\n\r\nyum install gcc bc bison<\/code><\/pre>\n<ul class=\"pre-numbering\">\n<li>1<\/li>\n<li>2<\/li>\n<li>3<\/li>\n<li>4<\/li>\n<li>5<\/li>\n<li>6<\/li>\n<li>7<\/li>\n<\/ul>\n<h3 id=\"6\u7f16\u8bd1\"><a name=\"t5\"><\/a>6,\u7f16\u8bd1<\/h3>\n<pre class=\"prettyprint\"><code class=\"hljs ruby has-numbering\">cd ~<span class=\"hljs-regexp\">\/rpmbuild\/<\/span><span class=\"hljs-constant\">SPECS<\/span>\r\nrpmbuild -bp --target=<span class=\"hljs-variable\">$(<\/span>uname -m) kernel.spec\r\n<\/code><\/pre>\n<p><strong>\u8bbe\u7f6e\u5185\u6838\u7f16\u8bd1\u9009\u9879<\/strong><br \/>\n\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n<div class=\"wp_syntax\">\n<div class=\"code_title\"><\/div>\n<div class=\"code_tb\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n2\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"bash\">cp \/boot\/config-`uname -r` .config\r\nmake menuconfig<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u6267\u884c\u8be5\u547d\u4ee4\u9700\u8981ncurses\u5e93\uff0c\u5982\u679c\u6267\u884c\u51fa\u9519\u5219\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u5b89\u88c5ncurses\uff1a<\/p>\n<div class=\"wp_syntax\">\n<div class=\"code_title\"><\/div>\n<div class=\"code_tb\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"bash\">yum install ncurses-devel<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><strong>\u7f16\u8bd1\u5185\u6838\u538b\u7f29\u955c\u50cf<\/strong><\/p>\n<div class=\"wp_syntax\">\n<div class=\"code_title\"><\/div>\n<div class=\"code_tb\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"bash\">make bzImage<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u7f16\u8bd1\u4f1a\u751f\u6210bzImage\u6587\u4ef6\uff0c\u5bf9\u5e94\u4e8e\/boot\u76ee\u5f55\u4e0b\u7684vmlinuz\u6587\u4ef6\uff0c\u662f\u538b\u7f29\u8fc7\u7684\u5185\u6838\u6587\u4ef6\u3002\u542f\u52a8\u52a0\u8f7d\u65f6\u5c06\u8be5\u6587\u4ef6\u89e3\u538b\u7f29\u5230\u5185\u5b58\u4e2d\u4e4b\u540e\u624d\u80fd\u6267\u884c\u64cd\u4f5c\u7cfb\u7edf\u3002<br \/>\n<strong>\u7f16\u8bd1\u5185\u6838\u6a21\u5757<\/strong><\/p>\n<div class=\"wp_syntax\">\n<div class=\"code_title\"><\/div>\n<div class=\"code_tb\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"bash\">make modules<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u5185\u6838\u5728\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff0c\u9664\u9700\u8981\u5185\u6838\u6587\u4ef6\u4e4b\u5916\uff0c\u8fd8\u9700\u8981\u52a0\u8f7d\u4e00\u4e9b\u5916\u56f4\u6a21\u5757\uff08\u4f8b\u5982\u9a71\u52a8\u7a0b\u5e8f\uff09\u7b49\u624d\u80fd\u8fd0\u884c\u3002<br \/>\n<strong>\u00a0\u5b89\u88c5\u5185\u6838\u6a21\u5757<\/strong><\/p>\n<div class=\"wp_syntax\">\n<div class=\"code_title\"><\/div>\n<div class=\"code_tb\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"bash\">make modules_install<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u5b89\u88c5\u4e0a\u4e00\u6b65\u4e2d\u7f16\u8bd1\u7684\u5185\u6838\u6a21\u5757\uff0c\u4e00\u822c\u90fd\u4f1a\u5b89\u88c5\u5230\/lib\/modules\u76ee\u5f55\u4e0b\u3002<br \/>\n<strong>\u5b89\u88c5\u5185\u6838<\/strong><\/p>\n<div class=\"wp_syntax\">\n<div class=\"code_title\"><\/div>\n<div class=\"code_tb\">\n<table>\n<tbody>\n<tr>\n<td class=\"line_numbers\">\n<pre>1\r\n<\/pre>\n<\/td>\n<td class=\"code\">\n<pre class=\"bash\">make install<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u8fd9\u53e5\u547d\u4ee4\u5f88\u7b80\u5355\uff0c\u5b83\u4f1a\u5728\/boot\u76ee\u5f55\u4e0b\u751f\u6210vmlinux\/System.map\u4e24\u4e2a\u6587\u4ef6\uff0c\u5e76\u4e14\u5728\/boot\/grub\u76ee\u5f55\u4e2d\u751f\u6210menu.lst\u6587\u4ef6\u3002\u6709\u5173menu.lst\u6587\u4ef6\u7684\u4fee\u6539\u65b9\u6cd5\u8bf7Google\u4e00\u4e0b\u3002<\/p>\n<p>\u6ce8\uff1a\u8981\u662f\u9047\u5230\u627e\u4e0d\u5230\u5185\u6838\u6a21\u5757\u7684\u9519\u8bef\uff0c\u6267\u884c\u4ee5\u4e0b\u4e24\u4e2a\u547d\u4ee4<\/p>\n<p>cp arch\/i386\/boot\/bzImage \/boot\/vmlinuz-2.6.29.1<\/p>\n<p>cp System.map \/boot\/System.map-2.6.29.1<\/p>\n<p><strong>\u542f\u52a8\u65b0\u7684\u5185\u6838<\/strong><br \/>\n\u4fee\u6539\/boot\/grub\/menu.lst\u6587\u4ef6\uff0c\u5c06\u65b0\u751f\u6210\u7684\u9ed8\u8ba4\u542f\u52a8\u9879\u4fee\u6539\u4e3a\u521a\u751f\u6210\u7684\u542f\u52a8\u9879\uff0c\u91cd\u542f\u5373\u53ef<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>1,\u5b89\u88c5\u6e90\u7801\uff0c\u7f16\u8bd1\u9a71\u52a8 https:\/\/wiki.centos.org\/HowTos\/I_need_the_K [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,13],"tags":[],"class_list":["post-140","post","type-post","status-publish","format-standard","hentry","category-linux","category-study"],"_links":{"self":[{"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.0moon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=140"}],"version-history":[{"count":5,"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":145,"href":"https:\/\/www.0moon.com\/index.php?rest_route=\/wp\/v2\/posts\/140\/revisions\/145"}],"wp:attachment":[{"href":"https:\/\/www.0moon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.0moon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.0moon.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}