{"id":1504,"date":"2011-08-31T10:50:00","date_gmt":"2011-08-31T02:50:00","guid":{"rendered":"http:\/\/www.jpuyy.com\/blog\/?p=1504"},"modified":"2013-06-08T19:52:06","modified_gmt":"2013-06-08T11:52:06","slug":"debian-compile-kernel","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=1504","title":{"rendered":"Debian\u64cd\u4f5c\u7cfb\u7edf\u7f16\u8bd1\u5185\u6838"},"content":{"rendered":"<p>\u8f6c\u81ea\uff1a<\/p>\n<p>\u60f3\u7528\u4e0a\u6700\u65b0\u7684\u5185\u6838\uff0c\u5c31\u9700\u8981\u6211\u4eec\u81ea\u5df1\u53bb\u7f16\u8bd1\u65b0\u5185\u6838\u4e86<\/p>\n<p>\u5b89\u88c5\u9700\u6c42\u8f6f\u4ef6\u5305<\/p>\n<pre>apt-get install kernel-package libncurses5-dev fakeroot wget build-essential<\/pre>\n<p>\u4e0b\u8f7d\u65b0\u5185\u6838<\/p>\n<p>\u4f60\u53ef\u4ee5\u5728\u8fd9\u91cc\u67e5\u770b\u53ef\u7528\u7684\u5185\u6838 \u76ee\u524d\u6700\u65b0\u7684\u4e3a2.6.x<\/p>\n<p>linux kernel \u5b98\u65b9\u7f51\u7ad9\uff1a<a title=\"linux kernel\" href=\"http:\/\/www.kernel.org\">http:\/\/www.kernel.org<\/a><\/p>\n<p>cd \/usr\/src<br \/>\nwget http:\/\/www.eu.kernel.org\/pub\/linux\/kernel\/v2.6\/linux-2.6.26.tar.gz<\/p>\n<p>\u89e3\u538b \u521b\u5efa\u8f6f\u94fe\u63a5\uff0c\u5207\u6362\u5230\u8f6f\u94fe\u63a5\u4e2d\u64cd\u4f5c<\/p>\n<p>tar zxvf linux-2.6.26.tar.gz<br \/>\nln -s linux-2.6.26 linux<br \/>\ncd \/usr\/src\/linux<\/p>\n<p>\u751f\u6210\u5185\u6838\u6587\u4ef6\uff0c\u9996\u5148\u8981\u590d\u5236\u65e7\u5185\u6838\u7684\u914d\u7f6e\u6587\u4ef6<\/p>\n<p>make clean &amp;&amp; make mrproper<br \/>\ncp \/boot\/config-`uname -r` .\/.config<br \/>\nmake menuconfig<\/p>\n<p>\u4f7f\u7528\u4e0b\u9762\u7684\u6b65\u9aa4\u6765\u8f7d\u5165\u65e7\u7684\u5185\u6838\u914d\u7f6e<br \/>\n1. Load an Alternate Configuration File<br \/>\n2. Type .config if not already in the textbox<br \/>\n3. Ok<br \/>\n4. Do any changes to the kernel modules<br \/>\n5. Click Exit<br \/>\n6. Click Yes when asked if you want to save<\/p>\n<p>\u7f16\u8bd1\u5185\u6838<\/p>\n<p>make-kpkg clean<br \/>\nfakeroot make-kpkg &#8211;initrd &#8211;append-to-version=-custom kernel_image kernel_headers<\/p>\n<p>\u8fd9\u4e2a\u8fc7\u7a0b\u9700\u8981\u5f88\u957f\u65f6\u95f4<\/p>\n<p>\u5b89\u88c5\u65b0\u5185\u6838<\/p>\n<p>ls -l \/usr\/src<\/p>\n<p>\u5230\u8fd9\u91cc\uff0c\u8fd8\u6ca1\u6709\u5b89\u88c5\u5185\u6838\uff0c<br \/>\ndpkg -i linux-headers-2.6.26-custom_2.6.26-custom-10.00.Custom_i386.deb<br \/>\ndpkg -i linux-image-2.6.26-custom_2.6.26-custom-10.00.Custom_i386.deb<\/p>\n<p>\u6700\u540e\u91cd\u65b0\u542f\u52a8\u670d\u52a1\u5668\u5373\u53ef<\/p>\n<p>reboot<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8f6c\u81ea\uff1a \u60f3\u7528\u4e0a\u6700\u65b0\u7684\u5185\u6838\uff0c\u5c31\u9700\u8981\u6211\u4eec\u81ea\u5df1\u53bb\u7f16\u8bd1\u65b0\u5185\u6838\u4e86 \u5b89\u88c5\u9700\u6c42\u8f6f\u4ef6\u5305 apt-get install kernel-package libncurses5-dev fakeroot wget build-essential \u4e0b\u8f7d\u65b0\u5185\u6838 \u4f60\u53ef\u4ee5\u5728\u8fd9\u91cc\u67e5\u770b\u53ef\u7528\u7684\u5185\u6838 \u76ee\u524d\u6700\u65b0\u7684\u4e3a2.6.x linux kernel \u5b98\u65b9\u7f51\u7ad9\uff1ahttp:\/\/www.kernel.org cd \/usr\/src wget http:\/\/www.eu.kernel.org\/pub\/linux\/kernel\/v2.6\/linux-2.6.26.tar.gz \u89e3\u538b \u521b\u5efa\u8f6f\u94fe\u63a5\uff0c\u5207\u6362\u5230\u8f6f\u94fe\u63a5\u4e2d\u64cd\u4f5c tar zxvf linux-2.6.26.tar.gz ln -s linux-2.6.26 linux cd \/usr\/src\/linux \u751f\u6210\u5185\u6838\u6587\u4ef6\uff0c\u9996\u5148\u8981\u590d\u5236\u65e7\u5185\u6838\u7684\u914d\u7f6e\u6587\u4ef6 make clean &amp;&amp; make mrproper cp \/boot\/config-`uname -r` .\/.config make menuconfig \u4f7f\u7528\u4e0b\u9762\u7684\u6b65\u9aa4\u6765\u8f7d\u5165\u65e7\u7684\u5185\u6838\u914d\u7f6e 1. Load an Alternate Configuration File 2. Type .config if not [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[23],"class_list":["post-1504","post","type-post","status-publish","format-standard","hentry","category-linux","tag-summary"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/1504","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1504"}],"version-history":[{"count":9,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/1504\/revisions"}],"predecessor-version":[{"id":5057,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/1504\/revisions\/5057"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}