{"id":155,"date":"2013-12-02T20:44:25","date_gmt":"2013-12-02T12:44:25","guid":{"rendered":"http:\/\/www.datarelab.com\/blog\/?p=155"},"modified":"2013-12-02T20:44:25","modified_gmt":"2013-12-02T12:44:25","slug":"managing%20efi%20boot%20loaders%20for%20linux","status":"publish","type":"post","link":"https:\/\/www.datarelab.com\/blog\/Technical_literature\/155.html","title":{"rendered":"Managing EFI Boot Loaders for Linux"},"content":{"rendered":"<p class=\"MsoNormal\">\n\t\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t<span>2011<\/span>\u5e74\u5e95\uff0c<span>Linux<\/span>\u5185\u6838\u5f00\u53d1\u4eba\u5458\u5f00\u59cb\u7814\u7a76\u4e00\u79cd\u65b0\u65b9\u6cd5\uff0c\u7528\u4e8e\u542f\u52a8\u57fa\u4e8e<span>EFI<\/span>\u7cfb\u7edf\u7684<span>Linux<\/span>\u3002\u8be5\u65b9\u6cd5\u5c06<span>Linux<\/span>\u5185\u6838\u53d8\u6210\u4e00\u4e2a<span>EFI<\/span>\u5e94\u7528\u7a0b\u5e8f\u3002\u4e00\u65e6\u88ab\u52a0\u8f7d\u4e86\uff0c\u8be5\u5185\u6838\u5c06\u63a5\u7ba1\u8ba1\u7b97\u673a\uff0c\u5728\u4e25\u683c\u610f\u4e49\u4e0a\u6709\u6548\u679c\u5730\u7ed5\u5f00<span>\/<\/span>\u5ffd\u7565\u542f\u52a8\u52a0\u8f7d\u5668\uff08<span>boot loader<\/span>\uff09\u7684\u9700\u6c42\u3002\u8be5\u65b9\u6cd5\u6709\u5176\u72ec\u7279\u7684\u4f18\u7f3a\u70b9\uff0c\u8fd9\u4e9b\u4f18\u7f3a\u70b9\u5c06\u5728\u672c\u6587\u4e2d\u8be6\u7ec6\u9610\u8ff0\u3002\uff08\u5982\u679c\u4f60\u5bf9\u6280\u672f\u7684\u7ec6\u8282\u611f\u5174\u8da3\uff0c\u8bf7\u9605\u8bfb<span><a href=\"https:\/\/lkml.org\/lkml\/2011\/10\/17\/81\"> Linux Kernel Mailing<br \/>\nList thread on this topic.<\/a><\/span>\uff09<span><\/span>\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.1pt;\">\n\t<b>\u4ec0\u4e48\u65f6\u5019\u4f7f\u7528<\/b><b>Kernel's EFI Stub<br \/>\nLoader<\/b>\n<\/p>\n<p class=\"MsoNormal\">\n\t<span>Linux <\/span>\u5185\u6838\u7684<span>EFI stub loader<\/span>\u6709\u5f88\u591a\u7279\u6027\uff0c\u6709\u4e9b\u662f\u6b63\u9762\u7684\uff0c\u6709\u4e9b\u662f\u8d1f\u9762\u7684\uff1a<span><\/span>\n<\/p>\n<p class=\"MsoListParagraph\" style=\"margin-left:21.0pt;text-indent:-21.0pt;\">\n\t&nbsp; &nbsp;\u5728\u67d0\u79cd\u610f\u4e49\u4e0a\u8bb2\uff0c<span>EFI boot loader<\/span>\u662f\u5185\u7f6e\u4e8e\u5185\u6838\u4e2d\u7684\uff0c\u56e0\u6b64\u5185\u6838\u5fc5\u987b\u662f\u5728\u4e00\u4e2a<span>EFI<\/span>\u53ef\u4ee5\u8bfb\u53d6\u7684\u5206\u533a\u4e2d\uff0c\u901a\u5e38\u662f<span>EFI<\/span>\u7cfb\u7edf\u5206\u533a\uff08<span>ESP<\/span>\uff09\u3002\u5c31\u50cf\u4f60\u4f7f\u7528<span>ELILO<\/span>\u4e00\u6837\uff0c\u8fd9\u4f1a\u589e\u52a0<span>ESP<\/span>\u7684\u5c3a\u5bf8\u8981\u6c42\u3002\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u7b2c\u4e8c\u4e2a<span>FAT<\/span>\u5206\u533a\u6216<span>EFI filesystem drivers<\/span>\u6765\u53d8\u901a\u7684\u89e3\u51b3\u8be5\u95ee\u9898\u3002<span><\/span>\n<\/p>\n<p class=\"MsoListParagraph\" style=\"margin-left:21.0pt;text-indent:-21.0pt;\">\n\t&nbsp; &nbsp;\u5982\u679c\u60f3\u4f7f\u7528\u521d\u59cb\u5316\u7684<span>RAM<\/span>\u76d8\uff08<span>initrd<\/span>\uff09<span>,<\/span>\u5e76\u4e14\u8fd9\u4e2a\u76d8\u7684\u5185\u6838\u542f\u52a8\u6709\u81ea\u5df1\u7684<span>stub loader, <\/span>\u90a3\u4e48<span>EFi<\/span>\u5c31\u5fc5\u987b\u80fd\u591f\u8bfb\u53d6<span>stub loader <\/span>\u548c\u5185\u6838\u3002\u8fd9\u4e0e\u6b63\u5728\u4f7f\u7528<span>ELILO<\/span>\u4e00\u6837\uff0c\u4f1a\u589e\u52a0\u5bf9<span>ESP<\/span>\u7684\u5927\u5c0f\u8981\u6c42\u3002<span><\/span>\n<\/p>\n<p class=\"MsoListParagraph\" style=\"margin-left:21.0pt;text-indent:-21.0pt;\">\n\t&nbsp; &nbsp;\u4f60\u5fc5\u987b\u6709\u529e\u6cd5\u5c06\u5185\u6838\u53c2\u6570\u4f20\u9012\u7ed9\u5185\u6838\uff0c\u6bd4\u5982<span>initrd<\/span>\u7684\u540d\u5b57\u548croot filesystem\u7684\u4f4d\u7f6e\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u6cd5\u5b9e\u73b0\uff1a\u5728\u5efa\u7acb\u5185\u6838\u7684\u65f6\u5019\u5d4c\u5165\u53c2\u6570\uff1b\u6216\u8005\u5728<span>EFI <\/span>\u5916\u58f3\uff08<span>shell<\/span>\uff09\u7684\u547d\u4ee4\u884c\u4e2d\u8f93\u5165\u8be5\u9009\u9879\uff1b\u4e5f\u53ef\u4ee5\u901a\u8fc7\u542f\u52a8\u7ba1\u7406\u5668\uff08<span>boot manager<\/span>\uff09\u4f20\u9012\u3002\u4f46\u662f\uff0c\u5e76\u4e0d\u662f\u6240\u6709\u7684\u542f\u52a8\u7ba1\u7406\u5668\u90fd\u53ef\u4ee5\u4f20\u9012\u4efb\u610f\u9009\u9879\uff0c\u6bd4\u5982<span>&nbsp;<a href=\"http:\/\/www.rodsbooks.com\/efi-bootloaders\/refit.html\">rEFIt<\/a><\/span>\u5c31\u4e0d\u53ef\u4ee5\u3002<span><\/span>\n<\/p>\n<p class=\"MsoListParagraph\" style=\"margin-left:21.0pt;text-indent:-21.0pt;\">\n\t&nbsp; &nbsp;\u4ece\u7406\u8bba\u4e0a\u8bb2\uff0c\u8ba9\u5185\u6838\u76f4\u63a5\u4ece<span>EFI<\/span>\u542f\u52a8\u53ef\u4ee5\u6539\u5584\u5185\u6838\u521d\u59cb\u5316\u8ba1\u7b97\u673a\u786c\u76d8\u7684\u80fd\u529b\u3002\u81f3\u4e8e\u5b9e\u9645\u4e2d\u662f\u5426\u6709\u63d0\u9ad8\u5c31\u662f\u53e6\u5916\u4e00\u56de\u4e8b\u4e86\u3002<span><\/span>\n<\/p>\n<p class=\"MsoListParagraph\" style=\"margin-left:21.0pt;text-indent:-21.0pt;\">\n\t&nbsp; &nbsp;<span>EFI stub loader <\/span>\u88ab\u6dfb\u52a0\u5230\u5185\u6838<span>3.3.0<\/span>\uff0c\u6210\u4e3a<span>3.3.0<\/span>\u7279\u6027\u3002\u5982\u679c\u4f7f\u7528\u8f83\u65e7\u7248\u672c\u7684\u5185\u6838\uff0c \u5c31\u9700\u8981\u5c06\u5185\u6838\u505a\u4e0b\u4fee\u8865\u3002<span>2013<\/span>\u5e74\u521d\uff0c<span>Fedora 17<\/span>\uff0c<span>OpenSUSE<br \/>\n12.2 <\/span>\u548c<span>Ubuntu 12.10<\/span>\u90fd\u4f7f\u7528\u5305\u542b<span>EFI stub loader <\/span>\u7684\u5185\u6838\u3002\u6240\u4ee5\u6211\u76f8\u4fe1\u5176\u4ed6\u7684\u53d1\u884c\u7248\uff08<span>distribution<\/span>\uff09\u4e5f\u4f1a\u8fd9\u6837\uff0c\u4f46\u662f\uff0c\u4f9d\u7136\u4f1a\u6709\u4e00\u4e9b\u7248\u672c\uff08\u5bf9\u5347\u7ea7\u5185\u6838\u6301\u4fdd\u5b88\u6001\u5ea6\u7684\uff09\u4f1a\u7ee7\u7eed\u4f7f\u7528<span>3.3.0<\/span>\u4e4b\u524d\u7684\u5185\u6838\u3002\u5f53\u7136\u4e86\uff0c\u8be5\u60c5\u51b5\u4f1a\u968f\u7740\u65f6\u95f4\u7684\u53d8\u5316\u6709\u6240\u6539\u5584\u7684\u3002<span><\/span>\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t\u63d0\u793a\uff1a\u5982\u679c\u5c06\u65e5\u5fd7\uff08journaling\uff09\u7981\u7528\u4e86\uff0c\u5c31\u53ef\u4ee5\u5c06Linux\/boot \u5206\u533a\u653e\u5230HFS+\u4e0a\u3002\u4e5f\u53ef\u4ee5\u5728Mac\u7684ESP\u4e0a\u4f7f\u7528HFS+\uff0c\u8fd9\u65f6\uff0c\u5c06\u65e5\u5fd7\uff08journaling\uff09\u7981\u7528\u4e86\uff0c\u4eceLINUX\u8bfb\u53d6filesystem\u4f1a\u66f4\u7b80\u5355\u3002\u8fd9\u4e2a\u4e24\u79cd\u4e0d\u592a\u5bfb\u5e38\u7684\u65b9\u5f0f\u90fd\u53ef\u4ee5\u66f4\u7b80\u5355\u7684\u5347\u7ea7\u548c\u5f15\u5bfcEFI<br \/>\nstub\u652f\u6301\u7684\u5185\u6838\u3002\u4f46\u662f\uff0c\u7edd\u5927\u591a\u6570\u7248\u672c\uff08distribution\uff09\u7684\u5b89\u88c5\u7a0b\u5e8f\u4e0d\u652f\u6301\u8fd9\u4e2a\u914d\u7f6e\uff0c\u6240\u4ee5\u5fc5\u987b\u5728\u4f7f\u7528\u4f20\u7edf\u7684\u5b89\u88c5\u65b9\u6cd5\u540e\u518d\u5efa\u7acb\u3002\n<\/p>\n<p class=\"MsoListParagraph\" style=\"margin-left:21.0pt;text-indent:-21.0pt;\">\n\t&nbsp; &nbsp;\u8be5\u65b9\u6cd5\u7684\u53ef\u9760\u6027\u8fd8\u5c1a\u4e0d\u786e\u5b9a\uff0c\u4f46\u662f\u6211\u7684\u6700\u59cb\u6d4b\u8bd5\u7ed3\u679c\u662f\u5f88\u4e50\u89c2\u7684<span>-----<\/span>\u8fdb\u884c\u4e86<span>7<\/span>\u6b21\u6d4b\u8bd5\uff0c\u90fd\u53ef\u4ee5\u6210\u529f\u542f\u52a8\uff0c\u5176\u4e2d\u53ea\u6709\u4e00\u6b21\u51fa\u73b0\u5947\u602a\u7684\uff08\u4e5f\u53ef\u80fd\u662f\u5f88\u91cd\u8981\u7684\uff09\u8b66\u544a\uff0c\u53d1\u751f\u5728<span>32<\/span>\u4f4d\u7684<span>Mac Mini<\/span>\u4e0a\u3002\u53ef\u4ee5\u4ece<span>Mac OS X HFS+<\/span>\u5206\u533a\u4e0a\u542f\u52a8<span>LINUX kernel EFI stub loader<\/span>\uff0c\u4f46\u662f\u5728<span>F ESP's FAT32<br \/>\nfilesystem<\/span>\u4e0a\u4e0d\u80fd\u542f\u52a8\u3002\u4f7f\u7528<span>ext2fs<\/span>\u548c<span>ReiserFS<\/span>\uff08\u91c7\u7528\u7684\u662f<span>rEFIt <\/span>\u548c<span>rEFInd<\/span>\uff09\uff0c\u53ef\u4ee5\u6210\u529f\u542f\u52a8\u8fd9\u4e24\u79cd\u6587\u4ef6\u7cfb\u7edf\u3002\u5c3d\u7ba1\u5982\u6b64\uff0c\u4ece<span>FAT ESP<\/span>\u662f\u4e0d\u80fd\u542f\u52a8\u7684\uff0c\u8fd9\u4f7f\u8bbe\u7f6e\u53d8\u5f97\u590d\u6742\u5316\u3002\u5c40\u9650\u4f9d\u7136\u5b58\u5728\uff0c\u4f46\u7528\u5185\u6838<span>stub loader<\/span>\u7684\u6210\u529f\u7387\u8fdc\u9ad8\u4e8e\u4efb\u4f55\u5176\u4ed6\u7684<span>EFI boot loader, <\/span>\u4e0e\u4e4b\u6210\u529f\u7387\u63a5\u8fd1\u7684\u662f<span>ELILO<\/span>\u548c<span>GRUB Legacy<\/span>\u3002\u53e6\u4e00\u4e2a\u5173\u4e8e\u53ef\u9760\u6027\u7684\u95ee\u9898\u662f\uff0c\u5bf9\u521d\u59cb<span>Ram<\/span>\u76d8\u7684\u89c4\u683c\u8981\u6c42\u5f88\u9ad8\u3002<span><\/span>\n<\/p>\n<p class=\"MsoListParagraph\" style=\"margin-left:21.0pt;text-indent:-21.0pt;\">\n\t&nbsp; &nbsp;\u5173\u4e8e\u4e0a\u4e00\u70b9\u63d0\u5230\u7684\u8b66\u544a\uff08\u5e0c\u671b\u662f\u6682\u65f6\u7684\uff09\uff0c\u6709\u7528\u6237\u62a5\u544a\u4e86<span>some3.7x<\/span>\u548c<span>3.8x<\/span>\u5185\u6838<span>EFIstub loader <\/span>\u7684\u95ee\u9898\u3002\u8be5\u95ee\u9898\u51fa\u73b0\u65f6\uff0c\u5185\u6838\u5c31\u505c\u6b62\u5f15\u5bfc\u3002<span>Mac <\/span>\u548c\u8054\u60f3\u7684\u7528\u6237\u4f3c\u4e4e\u66f4\u5bb9\u6613\u51fa\u73b0\u8fd9\u4e2a\u95ee\u9898\uff0c<span>Arch Linux<\/span>\u7528\u6237\u53d7\u6b64\u95ee\u9898\u5f71\u54cd\u6700\u5927\u3002\u56e0\u4e3a\u4ed6\u4eec\u90fd\u503e\u5411\u4e8e\u4f7f\u7528\u6700\u524d\u6cbf\u7684\u5185\u6838\u5e76\u4e14\u6bd4\u5176\u4ed6\u7248\u672c\uff08<span>distribution<\/span>\uff09\u7684\u7528\u6237\u66f4\u613f\u610f\u4f7f\u7528<span>EFI stub loader. <\/span>\u53ef\u4ee5\u70b9\u51fb\u8fd9\u91cc&nbsp;<span><a href=\"https:\/\/bbs.archlinux.org\/viewtopic.php?id=156670\">this thread<\/a><\/span>\u67e5\u770b\u66f4\u591a\u5173\u4e8e\u6b64\u95ee\u9898\u7684\u8ba8\u8bba\u3002\u4ee4\u4eba\u5947\u602a\u7684\u662f\uff0c\u4e00\u4e2a\u7248\u672c\u51fa\u73b0\u8fd9\u4e2a\u95ee\u9898\u540e\uff0c\u4e0b\u4e2a\u7248\u672c\u5c31\u4e0d\u4f1a\u51fa\u73b0\uff1b\u4e00\u4e9b\u7528\u6237\uff08\u5e76\u4e0d\u662f\u6240\u6709\u7684\u7528\u6237\uff09\u53ef\u4ee5\u901a\u8fc7\u8f6c\u6362\u5f15\u5bfc\u7ba1\u7406\u5668\u6216\u8005\u5f15\u5bfc\u7ba1\u7406\u5668\u7684\u7f16\u8bd1\u65b9\u5f0f\u6765\u8df3\u8fc7\u6b64\u95ee\u9898\u3002\u8fd9\u662f\u4e2a\u975e\u5e38\u4ee4\u4eba\u56f0\u60d1\u7684\u95ee\u9898\uff0c<span>EFI stub loader <\/span>\u7684\u4e3b\u8981\u5f00\u53d1\u4eba\u5458\u90fd\u77e5\u9053\u8fd9\u4e2a\u60c5\u51b5\u3002<span><\/span>\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t\u5c3d\u7ba1\u4e00\u4e9b3.7x \u548c3.8x\u5185\u6838\u4f9d\u7136\u53d7\u6b64\u95ee\u9898\u56f0\u6270\uff0c\u4f46\u662f\u8be5\u65b9\u6cd5\u5728\u6700\u8fd1\u53d1\u5e03\u7684\u7248\u672c\u4e0a\u90fd\u8fd0\u884c\u6b63\u5e38\u3002EFI stub loader \u5728\u4e0e&nbsp;<a href=\"http:\/\/www.rodsbooks.com\/efi-bootloaders\/refind.html\">rEFInd<\/a>&nbsp;\u6216&nbsp;<a href=\"http:\/\/www.rodsbooks.com\/efi-bootloaders\/gummiboot.html\">gummiboot<\/a>\u5728\u4e00\u8d77\u4f7f\u7528\u65f6\u6548\u679c\u6700\u597d\uff0c\u56e0\u4e3a\u5728\u7528\u8fd9\u79cd\u65b9\u5f0f\u5f15\u5bfc\uff0c\u53ef\u4ee5\u6307\u5b9aLinus\u5185\u6838\u9700\u8981\u7684\u989d\u5916\u9009\u9879\uff0c\u514d\u53bb\u4e86\u6bcf\u6b21\u5f15\u5bfc\u65f6\u90fd\u9700\u8981\u8f93\u5165\u9009\u9879\u7684\u4e0d\u8db3\u3002\u5b9e\u9645\u4e0a\u5462\uff0c\u6b63\u5982<span><a href=\"http:\/\/www.rodsbooks.com\/efi-bootloaders\/refind.html\">rEFInd page,<\/a><\/span>&nbsp;\u4e2d\u6240\u63cf\u8ff0\u7684\uff0crEFInd \u4e0e EFI stub loader\u7684\u7ed3\u5408\u5141\u8bb8\u901a\u8fc7\u62d6\u653e\u65b9\u5f0f\u5347\u7ea7\u5185\u6838\uff0c\u800c\u4e0d\u5fc5\u7f16\u8f91\u4efb\u4f55\u914d\u7f6e\u6587\u4ef6\uff01\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.1pt;\">\n\t<b>\u5b89\u88c5<\/b><b>EFI Stub Loader<\/b>\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t\u6ce8\u610f\uff1a\u8fd9\u90e8\u5206\u662f\u5173\u4e8e\u7f16\u8bd1\u5185\u6838\u7684\u3002\u5982\u679c\u4f60\u6b63\u5728\u4f7f\u7528\u7684\u662f3.3.0 \u6216\u8005\u662f\u66f4\u65b0\u7684\u652f\u6301EFI stub loader\u7684\u5185\u6838\uff0c\u90a3\u4e48\u4f60\u9700\u8981\u505a\u7684\u5c31\u662f\u5c06\u5185\u6838\u4ee5\u53ca\u5b83\u7684\u521d\u59cbRAM disk \u590d\u5236\u5230 ESP\u6216\u662f\u5728ESP\u4e0a\u7684\u5b89\u88c5\u9a71\u52a8\uff08driver\uff09(\u4ee5\u4fbf\u5185\u6838\u53ef\u4ee5\u4eceEFI\u88ab\u8bfb\u53d6)\u3002\u4f46\u662f\uff0c\u4f60\u5fc5\u987b\u77e5\u9053\u5982\u4f55\u8fd0\u884c\uff08launch\uff09\u5185\u6838\uff0c<a href=\"http:\/\/www.rodsbooks.com\/efi-bootloaders\/efistub.html#using\">\"Configuring and Using the EFI Stub<br \/>\nLoader.\"<\/a>\u8fd9\u91cc\u6709\u7b80\u5355\u4ecb\u7ecd\u3002\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t\u5b89\u88c5EFI stub loader \u9700\u8981\u914d\u7f6e\u4f60\u76843.3.0\u5185\u6838 \uff08\u6216\u8005\u66f4\u65b0\u7684\u5185\u6838\uff09\u5e76\u5bf9\u5176\u8fdb\u884c\u7f16\u8bd1\uff08\u4e5f\u53ef\u4ee5\u7528\u9002\u5408\u7684\u9884\u914d\u7f6e\u597d\u7684\u5185\u6838\uff09\uff0c\u7136\u540e\u5c06\u5185\u6838\u5b89\u88c5\u5230ESP\uff08\u6216\u67d0\u4e9bEFI\u53ef\u4ee5\u8bfb\u53d6\u7684\u5206\u533a\uff09\u3002\u5982\u679c\u5728\u7f16\u8bd1\u5185\u6838\u65f6\u4e0d\u80fd\u72ec\u7acb\u5b8c\u6210\uff0c\u53ef\u4ee5\u6d4f\u89c8\u4e0b\u76f8\u5173\u7684\u7f51\u9875\uff0c\u6bd4\u5982<span><a href=\"http:\/\/www.cyberciti.biz\/tips\/compiling-linux-kernel-26.html\">How to: Compile Linux Kernel<br \/>\n2.6<\/a><\/span>&nbsp;\u548c&nbsp;<span><a href=\"http:\/\/linuxgazette.net\/111\/krishnakumar.html\">Compiling the Linux Kernel<\/a><\/span>\u3002\u5982\u679c\u4f60\u4e4b\u524d\u6ca1\u6709\u505a\u8be5\u9879\u5de5\u4f5c\uff0c\u90a3\u5c31\u5f97\u4ece\u6570\u5343\u4e2a\u9009\u9879\u4e2d\u9009\u51fa\u4f60\u6240\u9700\u8981\u7684\u9009\u9879\u3002\u901a\u7528\u578b\u7684\u5185\u6838\u6bd4\u8f83\u65b9\u4fbf\uff0c\u56e0\u4e3a\u5b83\u7684\u9009\u9879\u53ef\u4ee5\u9002\u5e94\u51e0\u4e4e\u6240\u6709\u7684\u8ba1\u7b97\u673a\uff0c\u8fd9\u4e0e\u7248\u672c\u63d0\u4f9b\u8005\uff08<span>distribution provideer<\/span>\uff09\u4f7f\u7528\u7684\u76f8\u4f3c\u3002\u4f46\u662f\uff0c\u4f60\u9700\u8981\u7559\u610f\u4e00\u4e24\u4e2a\u5185\u6838\u914d\u7f6e\u9009\u9879\uff1a<span><\/span>\n<\/p>\n<p class=\"MsoListParagraph\" style=\"margin-left:21.0pt;text-indent:-21.0pt;\">\n\t&nbsp;&nbsp;<b>CONFIG_EFI_STUB--- <\/b>\u8be5\u9009\u9879\u7684\u4f4d\u7f6e\u5728\u8fd9\u91cc\uff1aaccessible as Processor Type and Features<br \/>\n-&gt; EFI Runtime Service Support -&gt; EFI Stub Support\u3002\u8fd9\u4e2a\u9009\u9879\u662f\u5c06EFI stub loader\u6dfb\u52a0\u5230\u5185\u6838\u7684\u91cd\u8981\u9009\u9879\uff0c\u5982\u679c\u60f3\u4f7f\u7528\u8be5\u529f\u80fd\u5c31\u5fc5\u987b\u52fe\u9009\u5b83\u3002\n<\/p>\n<p class=\"MsoListParagraph\" style=\"margin-left:21.0pt;text-indent:0cm;\">\n\t&nbsp;&nbsp;<b>CONFIG_CMDLINE_BOOL&nbsp;<\/b><b>\u548c<\/b><b>&nbsp;CONFIG_CMDLINE-----<\/b>\u867d\u7136\u7b2c\u4e00\u4e2a\u9009\u9879\u4f7f\u7b2c\u4e8c\u4e2a\u751f\u6548\uff0c\u4f46\u662f\u6211\u5c06\u4ed6\u4eec\u770b\u505a\u4e00\u4e2a\u9009\u9879\u3002\u901a\u8fc7\u5bf9\u547d\u4ee4\u884c\u8bbe\u7f6eCONFIG_CMDLINE\uff0c\u9700\u8981\u5728EFI\u5916\u58f3\u63d0\u793a\u7b26\u952e\u5165\u6216\u901a\u8fc7\u5f15\u5bfc\u7ba1\u7406\u5668\u4f20\u9012\uff0c\u5982\u679c\u6ca1\u6709\u8fd9\u4e2a\u9700\u8981\u53ef\u4ee5\u8df3\u8fc7\u6b64\u9009\u9879\u3002\u5982\u679c\u60f3\u901a\u8fc7EFI\u5f15\u5bfc\u7ba1\u7406\u5668\u6765\u8fd0\u884c\u5185\u6838\uff0c\u5e76\u4e14\u8be5\u5f15\u5bfc\u7ba1\u7406\u5668\u4e0d\u5141\u8bb8\u5c06\u4efb\u610f\u53c2\u6570\u4f20\u9012\u7ed9\u4f60\u7684boot loader, \u6bd4\u5982EFI\u548crEFIt\u4e2d\u529f\u80fd\u4e0d\u5168\u7684\u5f15\u5bfc\u7ba1\u7406\u5668\uff0c\u8fd9\u65f6\u5019\u8fd9\u4e2a\u9009\u62e9\u5c31\u53d1\u6325\u4f5c\u7528\u4e86\u3002\u5982\u679c\u4f60\u6253\u7b97\u4f7f\u7528rEFInd\u6216\u8005\u5176\u4ed6\u7684\u652f\u6301\u4f20\u9012\u4efb\u610f\u9009\u9879\u5230boot loader \u7684\u5f15\u5bfc\u7ba1\u7406\u5668\uff0c\u5c31\u4e0d\u518d\u9700\u8981\u8bbe\u7f6e\u8be5\u9009\u9879\u4e86\u3002\n<\/p>\n<p class=\"MsoNormal\">\n\t\u5982\u4e0b\u56fe\uff1a\n<\/p>\n<p class=\"MsoNormal\" style=\"text-align:center;\">\n\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.datarelab.com\/blog\/content\/uploadfile\/201312\/285e1385988428.png\" width=\"500\" height=\"345\" alt=\"\" \/>\n<\/p>\n<p class=\"MsoNormal\">\n\t<span><\/span>\n<\/p>\n<p class=\"MsoNormal\">\n\t&nbsp;\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t\u5185\u6838\u7f16\u8bd1\u5b8c\u6210\u540e\uff0c\u9700\u8981\u7528\u6b63\u5e38\u65b9\u5f0f\u5b89\u88c5\u6a21\u5757\uff08\u952e\u5165<b>make<br \/>\nmodules_install<\/b>\uff09\u5e76\u4e14\u51c6\u5907\u4e00\u4e2a\u521d\u59cb\u7684RAM\u76d8\uff08\u4f7f\u7528&nbsp;mkinitrd&nbsp;\u6216&nbsp;mkinitramfs,<br \/>\n\u4e0d\u540c\u7684distribution\u7684\u64cd\u4f5c\u7ec6\u8282\u4f1a\u6709\u5dee\u522b\uff09\u3002\u5c06\u5185\u6838\u6587\u4ef6\u548c\u521d\u59cb\u7684RAM\u76d8\u590d\u5236\u5230Linux&nbsp;\/boot\u76ee\u5f55\u548cESP\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u80fd\u4f1a\u4f7f\u7528ESP\u4e0a\u7684EFI\/linux\u5b50\u76ee\u5f55\u6765\u5b58\u653e\u8fd9\u4e9b\u6587\u4ef6\u3002\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.1pt;\">\n\t<b>\u914d\u7f6e\u548c\u4f7f\u7528<\/b><b>EFI Stub Loader<\/b>\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t\u5185\u6838\u7684stub loader \u672c\u8eab\u4e0d\u9700\u8981\u914d\u7f6e\uff0c\u4f46\u662f\u6709\u65f6\u5019\uff0c\u5728\u4ece\u5b83\u91cc\u9762\u5efa\u7acb\u9009\u9879\u7684\u65f6\u5019\u4f1a\u9700\u8981\u3002\u5982\u679c\u7f16\u8bd1\u7684\u5185\u6838stub loader\u6ca1\u6709\u8fd9\u4e9b\u9009\u9879\u7684\u65f6\u5019\uff0c\u4f60\u9700\u8981\u77e5\u9053\u5982\u4f55\u5c06\u9009\u9879\u4f20\u9012\u7ed9\u5b83\uff0c\u8fd9\u53ef\u4ee5\u5728boot loader\u4e2d\u7684\u9009\u9879\u884c\u4e2d\u4f20\u9012\u3002\u6b64\u5916\uff0c\u5982\u679c\u4f7f\u7528\u521d\u59cbRAM\u76d8\u4e86\uff0c\u5c31\u9700\u8981\u5c06\u521d\u59cbRAM\u76d8\u7684\u540d\u5b57\u4e5f\u4f20\u9012\u7ed9\u5b83\u3002\u5728EFI shell\u8f93\u5165\u540e\uff0c\u4f1a\u6709\u5982\u4e0b\u751f\u6210\u7684\u547d\u4ee4\uff1a\n<\/p>\n<div style=\"border:solid windowtext 1.0pt;padding:5.0pt 5.0pt 5.0pt 5.0pt;background:#EEEEEE;\">\n<p class=\"MsoNormal\">\n\t\tfs0:&gt; <b>bzImage.efi<br \/>\nroot=\/dev\/sda4 ro initrd=\\EFI\\linux\\initrd.img<\/b>\n\t<\/p>\n<\/div>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t\u8fd9\u662f\u4e2a\u5c0f\u4f8b\u5b50\uff0c\u5176\u4e2d\u5c06\u5185\u6838\u547d\u540d\u4e3abzImage.efi\uff0croot Linux<br \/>\nfilesystem\u5728\/dev\/sda4\uff0c\u521d\u59cbRAM\u76d8\u662f\u5b89\u88c5\u5728\u4e86ESP EFI\u7684\/linux\/initrd.img\u8fd9\u4e2a\u6587\u4ef6\u3002 ro\u8fd9\u4e2a\u9009\u9879\u4f7fLinux\u4ee5\u53ea\u8bfb\u65b9\u5f0f\u6302\u8f7droot filesystem\u3002\uff08\u8fd9\u4e2a\u662f\u6807\u51c6\u7684\uff1b\u521d\u59cb\u5316\u811a\u672c\u540e\u6765\u91cd\u65b0\u6302\u8f7dfilesystem read\/write\uff09\u3002\u9700\u8981\u6ce8\u610f\u7684\u662froot=\u8fd9\u4e2a\u9009\u9879\u8bc6\u522bLinux root<br \/>\nfilesystem, \u4f7f\u7528Linux\u6837\u5f0f\u7684\u5411\u524d\u503e\u7684\u659c\u7ebf\uff08\/\uff09\u6765\u5206\u9694\u76ee\u5f55\u5143\u7d20\uff0c\u4e0eLinux root(\/)filesystem\u76f8\u5bf9; \u4f46\u662f\uff0cinitrd=&nbsp;\u4f7f\u7528\u7684\u662fEFI\u98ce\u683c\u7684\u53cd\u659c\u6760\uff08\\\uff09\u7528\u6765\u8bc6\u522b\u521d\u59cb\u7684RAM\u76d8\uff0c\u8fd9\u4e0eESP's root\u76f8\u5bf9\u3002\u8fd9\u5f88\u91cd\u8981\uff0c\u56e0\u4e3a\u4e0d\u6b63\u786e\u7684&nbsp;initrd=\u89c4\u8303\u4f1a\u4f7f\u5185\u6838\u505c\u6b62\u3002\u8f83\u65e7\u7248\u672c\u7684EFIstub loader\uff083.3.0,\u81f3\u5c11\u662f3.4.0\uff09\u4e0d\u4f1a\u62a5\u9519\u3002\u518d\u65b0\u4e00\u70b9\u7684\u7248\u672c\uff08\u6bd4\u59823.6.0\uff0c\u6216\u80053.5x\u5185\u6838\uff09\u5728\u4e0d\u80fd\u8bfb\u53d6\u5b83\u7684initrd\u6587\u4ef6\u65f6 \u4f1a\u62a5\u9519\u3002\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\tEFI\u6709\u81ea\u5df1\u7684\u5f15\u5bfc\u7ba1\u7406\u5668\uff0c\u4f46\u662f\u901a\u5e38\u6bd4\u8f83\u7b80\u5355\u539f\u59cb\u3002\u7136\u800c\uff0c\u5982\u679c\u4f60\u7684\u5f15\u5bfc\u7ba1\u7406\u5668\u53ef\u4ee5\u8ba9\u4f60\u9009\u62e9boot loader, \u6216\u8005\u662f\u4f60\u613f\u610f\u53ea\u4ece\u4e00\u4e2a\u5185\u6838\u4e2d\u5f15\u5bfc\uff0c\u4f60\u53ef\u4ee5\u5728Linux\u901a\u8fc7&nbsp;efibootmgr\u7a0b\u5e8f\u8fdb\u884c\u8bbe\u7f6e\u3002\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u884c\u5b9e\u73b0\uff1a\n<\/p>\n<div style=\"border:solid windowtext 1.0pt;padding:5.0pt 5.0pt 5.0pt 5.0pt;background:#EEEEEE;\">\n<p class=\"MsoNormal\">\n\t\t# <b>efibootmgr -c<br \/>\n-d \/dev\/sda -p 1 -L \"Arch Linux\" -l '\\EFI\\arch\\vmlinuz-arch.efi' -u<br \/>\nroot=\/dev\/sda3 ro initrd=EFI\/arch\/initramfs-arch.img<\/b>\n\t<\/p>\n<\/div>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t\u8be5\u547d\u4ee4\u662f\u4f7f\u7528\u6307\u5b9a\u7684&nbsp;\u2013u\u540e\u9762\u7684\u51fd\u6570\u6765\u8ba9EFI\u5f15\u5bfc&nbsp;\\EFI\\arch\\vmlinuz-arch.efi\u8fd9\u4e2a\u6587\u4ef6\u3002\u7406\u8bba\u4e0a\uff0c\u5982\u679c\u4f7f\u7528\/dev\/sda1\u4f5c\u4e3aESP\uff0c-d\u548c-p\u8fd9\u4e24\u4e2a\u9009\u9879\u5c31\u6ca1\u6709\u5fc5\u8981\u4e86\uff1b\u8fd9\u91cc\u5c06\u8fd9\u4e24\u4e2a\u9009\u9879\u52a0\u4e0a\uff0c\u662f\u4ee5\u9632\u4f60\u4e0d\u662f\u4f7f\u7528\u8fd9\u6837\u7684ESP\uff1b\u6b64\u5904\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u4f5c\u6539\u52a8\u3002 \u5982\u679c\u4f60\u7684EFI\u6267\u884c\/\u5b9e\u65bd\u6709\u4e2a\u4e0d\u9519\u7684\u542f\u52a8\u83dc\u5355\uff0c\u4f60\u53ef\u4ee5\u7528\u591a\u4e2a\u547d\u4ee4\uff08multiple commands\uff09\u5efa\u7acb\u66ff\u4ee3\u542f\u52a8\u9009\u9879\uff08alternative boot<br \/>\noptions\uff09\uff0c\u6bd4\u5982\u5f15\u5bfc\u4e0d\u540c\u7684\u5185\u6838\u3001\u591a\u91cd\u7248\u672c\uff08multiple<br \/>\ndistributions\uff09\u4ee5\u53ca\u4f7f\u7528\u5907\u7528\u9009\u9879\uff08using alternate options\uff09\u3002\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t\u5982\u679c\u4f60\u4f7f\u7528\u7684\u662f\u5206\u5f00\u7684\uff08\u5355\u72ec\u7684\uff1b\u5206\u5f00\u7684\uff1b\u4e0d\u540c\u7684\uff1b\u5404\u81ea\u7684\uff09EFI\u5f15\u5bfc\u7ba1\u7406\u7a0b\u5e8f\uff0c\u6bd4\u5982rEFInd \u6216 <span>gummiboot<\/span>\uff0c\u5c31\u53ef\u4ee5\u901a\u8fc7\u6d4f\u89c8\u914d\u7f6e\u5c06\u5fc5\u9700\u7684\u9009\u9879\u4f20\u9012\u7ed9\u5185\u6838\u3002\u521a\u624d\u63d0\u5230\u8fc7\uff0crEFIt\u4e0d\u53ef\u4ee5\u3002rEFIt\u548c&nbsp;<u>rEFInd <\/u>\u53ef\u901a\u8fc7\u4e0b\u9762\u4e24\u79cd\u65b9\u5f0f\u5c06\u9009\u9879\u4f20\u9012\u7ed9EFI stub loader: \u5728\u4e3b\u8981\u7684refind.conffile\u4e2d\u5199boot loader\u8282\u5b9a\u4e49\uff1b\u6216\u8005\u662f\u4f9d\u9760&nbsp;refind_linux.conf\u8fd9\u4e2a\u6587\u4ef6\u7684\u534a\u81ea\u52a8\u67e5\u627e\u65b9\u5f0f\uff0c\u53ef\u4ee5\u5728\u76ee\u5f55\u4e2d\u7684&nbsp;refind_linux.conf\u6587\u4ef6\u4e3a\u6240\u6709\u7684\u5185\u6838\u8bfb\u53d6\u9009\u9879\u3002\u4efb\u4f55\u4e00\u79cd\u65b9\u5f0f\u90fd\u53ef\u5c06\u5185\u6838\u652f\u6301\u4e0erEFInd\u7ed3\u5408\uff0c\u8fd9\u4e2a\u7ed3\u5408\u5728\u591a\u5f15\u5bfc\u73af\u5883\u4e2d\u6bd4\u8f83\u7075\u6d3b\u5e76\u4e14\u76f8\u5bf9\u6765\u8bf4\u5bb9\u6613\u7ef4\u6301\u3002\u4f46\u662f\u7248\u672c\uff08distribution\uff09\u811a\u672c\u4e0d\u652f\u6301rEFInd\uff0c\u6240\u4ee5\u4e0d\u5f97\u4e0d\u505a\u4e00\u4e9b\u624b\u5de5\u7ef4\u62a4\u3002<span><a href=\"http:\/\/www.rodsbooks.com\/efi-bootloaders\/gummiboot.html\">gummiboot<\/a><\/span> \u7684\u6bcf\u4e2a\u4e3b\u83dc\u5355\u9009\u9879\u90fd\u9700\u8981\u4e00\u4e2a\u72ec\u7acb\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u4e14\u6240\u6709\u7684\u7248\u672c\uff08distribution\uff09\u7684\u7ef4\u62a4\u811a\u672c\u90fd\u4e0d\u652f\u6301\uff0c\u9700\u8981\u624b\u5de5\u7ef4\u62a4\u3002\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t\u7406\u8bba\u4e0a\u8bb2\uff0c\u5728\u4f7f\u7528chainloader\uff08\u800c\u4e0d\u662f\u4f7f\u7528\u5185\u6838\u6216linux\u9009\u9879\uff09\u7684GRUB Legacy\u6216GRUB 2\u4e0a\u8fd0\u884c\u7f16\u8bd1\u597d\u7684\u652f\u6301EFI stub\u7684Linux\u5185\u6838\u662f\u5b8c\u5168\u6709\u53ef\u80fd\u7684\u3002\uff08\u4f46\u6211\u8fd8\u6ca1\u8bd5\u8fc7\uff09\u3002\u5982\u679c\u4f60\u7528\u5e38\u89c4\u7684\u65b9\u5f0f\u8fd0\u884c\u9047\u5230\u786c\u4ef6\u521d\u59cb\u5316\u7684\u6587\u4ef6\uff0c\u90a3\u4e48\u4f7f\u7528chainloader\u5c31\u53ef\u80fd\u4f1a\u65b9\u4fbf\u4e00\u4e9b\uff0c\u4f46\u662f\u8fd9\u4e00\u70b9\u6211\u8fd8\u4e0d\u662f\u975e\u5e38\u786e\u5b9a\u3002\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\text2fs\/ext3fs, ext4fs \u4ee5\u53caReiserFS\u7684EFI\u9a71\u52a8\u7a0b\u5e8f\uff08drivers\uff09\u662f\u53ef\u7528\u7684\uff0c\u8fd9\u53e6\u4eceLinux filesystem \u52a0\u8f7d\u652f\u6301EFI stub\u7684Linux\u5185\u6838\u6210\u4e3a\u53ef\u80fd\u3002\u5c3d\u7ba1\u6709\u65f6\u5019\u4f60\u53ef\u80fd\u9700\u8981\u7ed9\u5185\u6838\u91cd\u547d\u540d\u6216\u4f7f\u7528.efi\u8fd9\u4e2a\u6269\u5c55\u540d\u5efa\u7acb\u8fde\u63a5\uff0c\u4f46\u662f\u8be5\u65b9\u6cd5\u53ef\u4ee5\u7b80\u5316\u914d\u7f6e\uff0c\u56e0\u4e3a\u4f60\u4e0d\u5fc5\u5c06\u5185\u6838\u590d\u5236\u5230ESP\u3002<u><a href=\"http:\/\/www.rodsbooks.com\/refind\/drivers.html\">http:\/\/www.rodsbooks.com\/refind\/drivers.html<\/a>&nbsp; <\/u>\u8fd9\u91cc\u4ecb\u7ecdEFI drivers\u7684\u4f7f\u7528\uff0c\u5e76\u91cd\u70b9\u4ecb\u7ecd\u914d\u7f6erEFInd\u548c\u52a0\u8f7dEFI drivers\u3002\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.1pt;\">\n\t<b>\u7ef4\u62a4<\/b><b>Kernel's EFI Stub<br \/>\nLoader<\/b>\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.0pt;\">\n\t\u56e0\u4e3a\u76ee\u524d\u5927\u591a\u6570\u7248\u672c\uff08distribution\uff09\u90fd\u4e0d\u652f\u6301\u5185\u6838\u7684EFI stub loader\uff0c\u6240\u4ee5\u53ea\u80fd\u81ea\u5df1\u8fdb\u884c\u7ef4\u62a4\u3002\u5c06\u6765\uff0c\u5404\u4e2a\u7248\u672c\u5c06\u6709\u53ef\u80fd\u4f7f\u7528&nbsp;efibootmgr\u6216\u5176\u4ed6\u5de5\u5177\u6765\u5e2e\u52a9\u7ef4\u62a4\u90a3\u4e9b\u4f7f\u7528\u8be5\u65b9\u6cd5\u7684\u8bbe\u5907\uff0c\u518d\u6216\u8005\u901a\u8fc7\u7ef4\u62a4GRUB, rEFInd, \u6216 gummiboot\u7684\u914d\u7f6e\u6587\u4ef6\u65f6\u652f\u6301Kernel's EFI Stub Loader<b>\u3002<\/b><b><\/b>\n<\/p>\n<p class=\"MsoNormal\" style=\"text-indent:21.1pt;\">\n\t<b>&nbsp;<\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2011\u5e74\u5e95\uff0cLinux\u5185\u6838\u5f00\u53d1\u4eba\u5458\u5f00\u59cb\u7814\u7a76\u4e00\u79cd\u65b0\u65b9\u6cd5\uff0c\u7528\u4e8e\u542f\u52a8\u57fa\u4e8eEFI\u7cfb\u7edf\u7684Linux\u3002\u8be5\u65b9\u6cd5\u5c06Linux [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[23,14],"class_list":["post-155","post","type-post","status-publish","format-standard","hentry","category-Technical_literature","tag-efi","tag-linux"],"views":1730,"_links":{"self":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/comments?post=155"}],"version-history":[{"count":0,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/155\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/media?parent=155"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/categories?post=155"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/tags?post=155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}