{"id":1467,"date":"2025-07-13T15:31:06","date_gmt":"2025-07-13T15:31:06","guid":{"rendered":"https:\/\/robinluo.top\/?p=1467"},"modified":"2025-07-13T15:31:06","modified_gmt":"2025-07-13T15:31:06","slug":"uboot-kernel-rootfs-%e5%85%b3%e7%b3%bb","status":"publish","type":"post","link":"https:\/\/robinluo.top\/?p=1467","title":{"rendered":"uboot kernel rootfs \u5173\u7cfb"},"content":{"rendered":"\n<p>\u5728\u5d4c\u5165\u5f0fLinux\u7cfb\u7edf\u4e2d\uff0c<strong>U-Boot\u3001Kernel\uff08\u5185\u6838\uff09\u548cRootfs\uff08\u6839\u6587\u4ef6\u7cfb\u7edf\uff09<\/strong>&nbsp;\u662f\u4e09\u4e2a\u6838\u5fc3\u7ec4\u4ef6\uff0c\u5b83\u4eec\u5206\u5de5\u534f\u4f5c\uff0c\u5171\u540c\u5b8c\u6210\u7cfb\u7edf\u542f\u52a8\u548c\u8fd0\u884c\u3002\u4ee5\u4e0b\u662f\u5b83\u4eec\u7684\u76f8\u4e92\u5173\u7cfb\u548c\u4f5c\u7528\uff1a<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3>1.&nbsp;<strong>U-Boot\uff08Bootloader\uff09<\/strong><\/h3>\n\n\n\n<ul><li><strong>\u4f5c\u7528<\/strong>\uff1a\u786c\u4ef6\u521d\u59cb\u5316\u3001\u5f15\u5bfc\u52a0\u8f7d\u5185\u6838\u3002<\/li><li><strong>\u529f\u80fd<\/strong>\uff1a<ul><li>\u521d\u59cb\u5316CPU\u3001\u5185\u5b58\u3001\u65f6\u949f\u7b49\u786c\u4ef6\u3002<\/li><li>\u63d0\u4f9b\u4ea4\u4e92\u5f0f\u547d\u4ee4\u884c\uff08\u53ef\u9009\uff09\uff0c\u7528\u4e8e\u8c03\u8bd5\u6216\u914d\u7f6e\u542f\u52a8\u53c2\u6570\u3002<\/li><li>\u4ece\u5b58\u50a8\u8bbe\u5907\uff08\u5982eMMC\u3001SD\u5361\u3001Flash\uff09\u52a0\u8f7d\u5185\u6838\u955c\u50cf\uff08<code>zImage<\/code>\u6216<code>uImage<\/code>\uff09\u548c\u8bbe\u5907\u6811\uff08<code>dtb<\/code>\uff09\u5230\u5185\u5b58\u3002<\/li><li>\u4f20\u9012\u542f\u52a8\u53c2\u6570\uff08\u5982\u6839\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3001\u63a7\u5236\u53f0\u8bbe\u5907\u7b49\uff09\u7ed9\u5185\u6838\u3002<\/li><\/ul><\/li><li><strong>\u8f93\u51fa<\/strong>\uff1a\u5c06\u63a7\u5236\u6743\u79fb\u4ea4\u5185\u6838\u3002<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3>2.&nbsp;<strong>Kernel\uff08Linux\u5185\u6838\uff09<\/strong><\/h3>\n\n\n\n<ul><li><strong>\u4f5c\u7528<\/strong>\uff1a\u7ba1\u7406\u7cfb\u7edf\u786c\u4ef6\u8d44\u6e90\u3001\u63d0\u4f9b\u6838\u5fc3\u670d\u52a1\u3002<\/li><li><strong>\u529f\u80fd<\/strong>\uff1a<ul><li>\u8fdb\u4e00\u6b65\u521d\u59cb\u5316\u786c\u4ef6\uff08\u5982\u9a71\u52a8\u52a0\u8f7d\u3001\u4e2d\u65ad\u7ba1\u7406\uff09\u3002<\/li><li>\u6302\u8f7d\u6839\u6587\u4ef6\u7cfb\u7edf\uff08Rootfs\uff09\u5230&nbsp;<code>\/<\/code>&nbsp;\u76ee\u5f55\u3002<\/li><li>\u542f\u52a8\u7528\u6237\u7a7a\u95f4\u7684\u7b2c\u4e00\u4e2a\u8fdb\u7a0b\uff08\u901a\u5e38\u662f&nbsp;<code>init<\/code>&nbsp;\u6216&nbsp;<code>systemd<\/code>\uff0cPID=1\uff09\u3002<\/li><\/ul><\/li><li><strong>\u4f9d\u8d56<\/strong>\uff1a\u9700\u8981U-Boot\u6b63\u786e\u52a0\u8f7d\u5185\u6838\u955c\u50cf\uff0c\u5e76\u4f20\u9012\u6b63\u786e\u7684\u542f\u52a8\u53c2\u6570\uff08\u5982<code>root=<\/code>&nbsp;\u6307\u5b9aRootfs\u4f4d\u7f6e\uff09\u3002<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3>3.&nbsp;<strong>Rootfs\uff08\u6839\u6587\u4ef6\u7cfb\u7edf\uff09<\/strong><\/h3>\n\n\n\n<ul><li><strong>\u4f5c\u7528<\/strong>\uff1a\u63d0\u4f9b\u7528\u6237\u7a7a\u95f4\u73af\u5883\u548c\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u57fa\u7840\u3002<\/li><li><strong>\u5185\u5bb9<\/strong>\uff1a<ul><li>\u7cfb\u7edf\u5de5\u5177\uff08\u5982<code>\/bin<\/code>\u3001<code>\/sbin<\/code>\uff09\u3002<\/li><li>\u914d\u7f6e\u6587\u4ef6\uff08\u5982<code>\/etc<\/code>\uff09\u3002<\/li><li>\u5e93\u6587\u4ef6\uff08\u5982<code>\/lib<\/code>\uff09\u3002<\/li><li>\u7528\u6237\u7a0b\u5e8f\uff08\u5982<code>\/usr<\/code>\uff09\u3002<\/li><\/ul><\/li><li><strong>\u6302\u8f7d\u65f6\u673a<\/strong>\uff1a\u7531\u5185\u6838\u6839\u636e\u542f\u52a8\u53c2\u6570\uff08\u5982<code>root=\/dev\/mmcblk0p2<\/code>\uff09\u6302\u8f7d\u3002<\/li><li><strong>\u5173\u952e\u6587\u4ef6<\/strong>\uff1a<code>\/sbin\/init<\/code>&nbsp;\u6216&nbsp;<code>\/lib\/systemd\/systemd<\/code>\uff08\u7b2c\u4e00\u4e2a\u7528\u6237\u8fdb\u7a0b\uff09\u3002<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3>\u4e09\u8005\u7684\u534f\u4f5c\u6d41\u7a0b<\/h3>\n\n\n\n<ol><li><strong>\u786c\u4ef6\u4e0a\u7535<\/strong>&nbsp;\u2192 U-Boot\u6267\u884c\uff0c\u521d\u59cb\u5316\u786c\u4ef6\u3002<\/li><li><strong>U-Boot<\/strong>&nbsp;\u52a0\u8f7d\u5185\u6838\u955c\u50cf\u548c\u8bbe\u5907\u6811\u5230\u5185\u5b58\uff0c\u4f20\u9012\u53c2\u6570\uff08\u5982<code>console=ttyS0 root=\/dev\/nfs<\/code>\uff09\u3002<\/li><li><strong>\u5185\u6838<\/strong>&nbsp;\u542f\u52a8\uff0c\u89e3\u538b\u81ea\u8eab\u5e76\u521d\u59cb\u5316\u5b50\u7cfb\u7edf\uff08\u8fdb\u7a0b\u8c03\u5ea6\u3001\u9a71\u52a8\u7b49\uff09\u3002<\/li><li><strong>\u5185\u6838<\/strong>&nbsp;\u6302\u8f7dRootfs\uff08\u4eceFlash\u3001NFS\u3001RAM\u7b49\u8bbe\u5907\uff09\u3002<\/li><li><strong>\u5185\u6838<\/strong>&nbsp;\u542f\u52a8Rootfs\u4e2d\u7684<code>init<\/code>\u8fdb\u7a0b\uff0c\u8fdb\u5165\u7528\u6237\u7a7a\u95f4\uff0c\u5b8c\u6210\u7cfb\u7edf\u542f\u52a8\u3002<\/li><\/ol>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3>\u5173\u952e\u4f9d\u8d56\u5173\u7cfb<\/h3>\n\n\n\n<ul><li><strong>U-Boot\u4f9d\u8d56<\/strong>\uff1a\u9700\u9002\u914d\u786c\u4ef6\uff08\u5982DDR\u521d\u59cb\u5316\u4ee3\u7801\u3001\u5b58\u50a8\u9a71\u52a8\uff09\u3002<\/li><li><strong>\u5185\u6838\u4f9d\u8d56<\/strong>\uff1a\u9700\u5339\u914d\u786c\u4ef6\u67b6\u6784\uff08\u5982ARM\/X86\uff09\u548cU-Boot\u4f20\u9012\u7684\u53c2\u6570\u3002<\/li><li><strong>Rootfs\u4f9d\u8d56<\/strong>\uff1a\u9700\u5305\u542b\u5185\u6838\u9a71\u52a8\u7684\u5bf9\u5e94\u6a21\u5757\uff08\u5982\u6587\u4ef6\u7cfb\u7edf\u9a71\u52a8\u3001\u8bbe\u5907\u8282\u70b9\uff09\u3002<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3>\u5e38\u89c1\u95ee\u9898<\/h3>\n\n\n\n<ul><li><strong>\u542f\u52a8\u5931\u8d25<\/strong>\uff1a\u82e5U-Boot\u672a\u6b63\u786e\u52a0\u8f7d\u5185\u6838\uff0c\u7cfb\u7edf\u65e0\u6cd5\u542f\u52a8\u3002<\/li><li><strong>\u5185\u6838\u6050\u614c\uff08Kernel Panic\uff09<\/strong>\uff1a\u901a\u5e38\u56e0\u627e\u4e0d\u5230\u6216\u65e0\u6cd5\u6302\u8f7dRootfs\u3002<\/li><li><strong>Rootfs\u635f\u574f<\/strong>\uff1a\u7cfb\u7edf\u53ef\u80fd\u542f\u52a8\u4f46\u65e0\u6cd5\u8fdb\u5165\u7528\u6237\u7a7a\u95f4\uff08\u5982<code>\/bin\/sh<\/code>\u7f3a\u5931\uff09\u3002<\/li><\/ul>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h3>\u7c7b\u6bd4\u7406\u89e3<\/h3>\n\n\n\n<ul><li><strong>U-Boot<\/strong>\uff1a\u50cf\u7535\u8111\u7684BIOS\uff0c\u8d1f\u8d23\u201c\u5524\u9192\u201d\u786c\u4ef6\u3002<\/li><li><strong>Kernel<\/strong>\uff1a\u50cf\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\uff0c\u7ba1\u7406\u786c\u4ef6\u548c\u8d44\u6e90\u3002<\/li><li><strong>Rootfs<\/strong>\uff1a\u50cfC\u76d8\u7684Windows\u7cfb\u7edf\u6587\u4ef6\uff0c\u63d0\u4f9b\u8fd0\u884c\u73af\u5883\u3002<\/li><\/ul>\n\n\n\n<p>\u901a\u8fc7\u4e09\u8005\u534f\u540c\uff0c\u5d4c\u5165\u5f0f\u7cfb\u7edf\u4ece\u786c\u4ef6\u4e0a\u7535\u5230\u5b8c\u6574\u542f\u52a8\uff0c\u6700\u7ec8\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5d4c\u5165\u5f0fLinux\u7cfb\u7edf\u4e2d\uff0cU-Boot\u3001Kernel\uff08\u5185\u6838\uff09\u548cRootfs\uff08\u6839\u6587\u4ef6\u7cfb\u7edf\uff09&nbsp;\u662f\u4e09\u4e2a\u6838\u5fc3\u7ec4\u4ef6\uff0c\u5b83\u4eec\u5206\u5de5\u534f\u4f5c\uff0c\u5171\u540c\u5b8c\u6210\u7cfb\u7edf\u542f\u52a8\u548c\u8fd0\u884c\u3002\u4ee5\u4e0b\u662f\u5b83\u4eec\u7684\u76f8\u4e92\u5173\u7cfb\u548c\u4f5c\u7528\uff1a 1.&nbsp;U-Boot\uff08Bootloader\uff09 \u4f5c\u7528\uff1a\u786c\u4ef6\u521d\u59cb\u5316\u3001\u5f15\u5bfc\u52a0\u8f7d\u5185\u6838\u3002 \u529f\u80fd\uff1a \u521d\u59cb\u5316CPU\u3001\u5185\u5b58\u3001\u65f6\u949f\u7b49\u786c\u4ef6\u3002 \u63d0\u4f9b\u4ea4\u4e92\u5f0f\u547d\u4ee4\u884c\uff08\u53ef\u9009\uff09\uff0c\u7528\u4e8e\u8c03\u8bd5\u6216\u914d\u7f6e\u542f\u52a8\u53c2\u6570\u3002 \u4ece\u5b58\u50a8\u8bbe\u5907\uff08\u5982eMMC\u3001SD\u5361\u3001Flash\uff09\u52a0\u8f7d\u5185\u6838\u955c\u50cf\uff08zImage\u6216uImage\uff09\u548c\u8bbe\u5907\u6811\uff08dtb\uff09\u5230\u5185\u5b58\u3002 \u4f20\u9012\u542f\u52a8\u53c2\u6570\uff08\u5982\u6839\u6587\u4ef6\u7cfb\u7edf\u4f4d\u7f6e\u3001\u63a7\u5236\u53f0\u8bbe\u5907\u7b49\uff09\u7ed9\u5185\u6838\u3002 \u8f93\u51fa\uff1a\u5c06\u63a7\u5236\u6743\u79fb\u4ea4\u5185\u6838\u3002 2.&nbsp;Kernel\uff08Linux\u5185\u6838\uff09 \u4f5c\u7528\uff1a\u7ba1\u7406\u7cfb\u7edf\u786c\u4ef6\u8d44\u6e90\u3001\u63d0\u4f9b\u6838\u5fc3\u670d\u52a1\u3002 \u529f\u80fd\uff1a \u8fdb\u4e00\u6b65\u521d\u59cb\u5316\u786c\u4ef6\uff08\u5982\u9a71\u52a8\u52a0\u8f7d\u3001\u4e2d\u65ad\u7ba1\u7406\uff09\u3002 \u6302\u8f7d\u6839\u6587\u4ef6\u7cfb\u7edf\uff08Rootfs\uff09\u5230&nbsp;\/&nbsp;\u76ee\u5f55\u3002 \u542f\u52a8\u7528\u6237\u7a7a\u95f4\u7684\u7b2c\u4e00\u4e2a\u8fdb\u7a0b\uff08\u901a\u5e38\u662f&nbsp;init&nbsp;\u6216&nbsp;systemd\uff0cPID=1\uff09\u3002 \u4f9d\u8d56\uff1a\u9700\u8981U-Boot\u6b63\u786e\u52a0\u8f7d\u5185\u6838\u955c\u50cf\uff0c\u5e76\u4f20\u9012\u6b63\u786e\u7684\u542f\u52a8\u53c2\u6570\uff08\u5982root=&nbsp;\u6307\u5b9aRootfs\u4f4d\u7f6e\uff09\u3002 3.&nbsp;Rootfs\uff08\u6839\u6587\u4ef6\u7cfb\u7edf\uff09 \u4f5c\u7528\uff1a\u63d0\u4f9b\u7528\u6237\u7a7a\u95f4\u73af\u5883\u548c\u5e94\u7528\u7a0b\u5e8f\u8fd0\u884c\u57fa\u7840\u3002 \u5185\u5bb9\uff1a \u7cfb\u7edf\u5de5\u5177\uff08\u5982\/bin\u3001\/sbin\uff09\u3002 \u914d\u7f6e\u6587\u4ef6\uff08\u5982\/etc\uff09\u3002 \u5e93\u6587\u4ef6\uff08\u5982\/lib\uff09\u3002 \u7528\u6237\u7a0b\u5e8f\uff08\u5982\/usr\uff09\u3002 \u6302\u8f7d\u65f6\u673a\uff1a\u7531\u5185\u6838\u6839\u636e\u542f\u52a8\u53c2\u6570\uff08\u5982root=\/dev\/mmcblk0p2\uff09\u6302\u8f7d\u3002 \u5173\u952e\u6587\u4ef6\uff1a\/sbin\/init&nbsp;\u6216&nbsp;\/lib\/systemd\/systemd\uff08\u7b2c\u4e00\u4e2a\u7528\u6237\u8fdb\u7a0b\uff09\u3002 \u4e09\u8005\u7684\u534f\u4f5c\u6d41\u7a0b \u786c\u4ef6\u4e0a\u7535&nbsp;\u2192 U-Boot\u6267\u884c\uff0c\u521d\u59cb\u5316\u786c\u4ef6\u3002 U-Boot&nbsp;\u52a0\u8f7d\u5185\u6838\u955c\u50cf\u548c\u8bbe\u5907\u6811\u5230\u5185\u5b58\uff0c\u4f20\u9012\u53c2\u6570\uff08\u5982console=ttyS0 root=\/dev\/nfs\uff09\u3002 \u5185\u6838&nbsp;\u542f\u52a8\uff0c\u89e3\u538b\u81ea\u8eab\u5e76\u521d\u59cb\u5316\u5b50\u7cfb\u7edf\uff08\u8fdb\u7a0b\u8c03\u5ea6\u3001\u9a71\u52a8\u7b49\uff09\u3002 \u5185\u6838&nbsp;\u6302\u8f7dRootfs\uff08\u4eceFlash\u3001NFS\u3001RAM\u7b49\u8bbe\u5907\uff09\u3002 \u5185\u6838&nbsp;\u542f\u52a8Rootfs\u4e2d\u7684init\u8fdb\u7a0b\uff0c\u8fdb\u5165\u7528\u6237\u7a7a\u95f4\uff0c\u5b8c\u6210\u7cfb\u7edf\u542f\u52a8\u3002 \u5173\u952e\u4f9d\u8d56\u5173\u7cfb U-Boot\u4f9d\u8d56\uff1a\u9700\u9002\u914d\u786c\u4ef6\uff08\u5982DDR\u521d\u59cb\u5316\u4ee3\u7801\u3001\u5b58\u50a8\u9a71\u52a8\uff09\u3002 \u5185\u6838\u4f9d\u8d56\uff1a\u9700\u5339\u914d\u786c\u4ef6\u67b6\u6784\uff08\u5982ARM\/X86\uff09\u548cU-Boot\u4f20\u9012\u7684\u53c2\u6570\u3002 Rootfs\u4f9d\u8d56\uff1a\u9700\u5305\u542b\u5185\u6838\u9a71\u52a8\u7684\u5bf9\u5e94\u6a21\u5757\uff08\u5982\u6587\u4ef6\u7cfb\u7edf\u9a71\u52a8\u3001\u8bbe\u5907\u8282\u70b9\uff09\u3002 \u5e38\u89c1\u95ee\u9898 \u542f\u52a8\u5931\u8d25\uff1a\u82e5U-Boot\u672a\u6b63\u786e\u52a0\u8f7d\u5185\u6838\uff0c\u7cfb\u7edf\u65e0\u6cd5\u542f\u52a8\u3002 \u5185\u6838\u6050\u614c\uff08Kernel Panic\uff09\uff1a\u901a\u5e38\u56e0\u627e\u4e0d\u5230\u6216\u65e0\u6cd5\u6302\u8f7dRootfs\u3002 Rootfs\u635f\u574f\uff1a\u7cfb\u7edf\u53ef\u80fd\u542f\u52a8\u4f46\u65e0\u6cd5\u8fdb\u5165\u7528\u6237\u7a7a\u95f4\uff08\u5982\/bin\/sh\u7f3a\u5931\uff09\u3002 \u7c7b\u6bd4\u7406\u89e3 U-Boot\uff1a\u50cf\u7535\u8111\u7684BIOS\uff0c\u8d1f\u8d23\u201c\u5524\u9192\u201d\u786c\u4ef6\u3002 Kernel\uff1a\u50cf\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\uff0c\u7ba1\u7406\u786c\u4ef6\u548c\u8d44\u6e90\u3002 Rootfs\uff1a\u50cfC\u76d8\u7684Windows\u7cfb\u7edf\u6587\u4ef6\uff0c\u63d0\u4f9b\u8fd0\u884c\u73af\u5883\u3002 \u901a\u8fc7\u4e09\u8005\u534f\u540c\uff0c\u5d4c\u5165\u5f0f\u7cfb\u7edf\u4ece\u786c\u4ef6\u4e0a\u7535\u5230\u5b8c\u6574\u542f\u52a8\uff0c\u6700\u7ec8\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[113],"tags":[160,129,229,230],"_links":{"self":[{"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/posts\/1467"}],"collection":[{"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/robinluo.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1467"}],"version-history":[{"count":2,"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/posts\/1467\/revisions"}],"predecessor-version":[{"id":1469,"href":"https:\/\/robinluo.top\/index.php?rest_route=\/wp\/v2\/posts\/1467\/revisions\/1469"}],"wp:attachment":[{"href":"https:\/\/robinluo.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/robinluo.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/robinluo.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}