{"id":10413,"date":"2023-09-16T10:35:37","date_gmt":"2023-09-16T02:35:37","guid":{"rendered":"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413"},"modified":"2024-06-21T17:19:51","modified_gmt":"2024-06-21T09:19:51","slug":"android-%e7%b3%bb%e7%bb%9f%e9%95%9c%e5%83%8f%e6%96%87%e4%bb%b6%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413","title":{"rendered":"Android \u7cfb\u7edf\u955c\u50cf\u6587\u4ef6\u4ecb\u7ecd"},"content":{"rendered":"<p><a href=\"https:\/\/blog.csdn.net\/z755924843\/article\/details\/132190581\">https:\/\/blog.csdn.net\/z755924843\/article\/details\/132190581<\/a><\/p>\n<p><a href=\"https:\/\/www.cnblogs.com\/sjjg\/p\/6071847.html\">https:\/\/www.cnblogs.com\/sjjg\/p\/6071847.html<\/a><br \/>\n<a href=\"https:\/\/betheme.net\/news\/txtlist_i148637v.html?action=onClick\">https:\/\/betheme.net\/news\/txtlist_i148637v.html?action=onClick<\/a> \uff08\u5bf9\u5206\u533a\u53ca\u5206\u533a\u4e0b\u7684\u6587\u4ef6\u4f5c\u4e86\u8be6\u7ec6\u7684\u4ecb\u7ecd\uff09<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_16 counter-hierarchy counter-decimal ez-toc-grey\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" style=\"display: none;\"><i class=\"ez-toc-glyphicon ez-toc-icon-toggle\"><\/i><\/a><\/span><\/div>\n<nav><ul class=\"ez-toc-list ez-toc-list-level-1\"><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#%E4%BC%A0%E7%BB%9F%E5%88%86%E5%8C%BA%E9%95%9C%E5%83%8F%E6%96%87%E4%BB%B6\" title=\"\u4f20\u7edf\u5206\u533a\u955c\u50cf\u6587\u4ef6\">\u4f20\u7edf\u5206\u533a\u955c\u50cf\u6587\u4ef6<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#Android10%E5%8A%A8%E6%80%81%E5%88%86%E5%8C%BA%E9%95%9C%E5%83%8F%E6%96%87%E4%BB%B6\" title=\"Android10\u52a8\u6001\u5206\u533a\u955c\u50cf\u6587\u4ef6\">Android10\u52a8\u6001\u5206\u533a\u955c\u50cf\u6587\u4ef6<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#%E4%B8%80%E3%80%81%E8%A7%A3%E5%8C%85%E5%B7%A5%E5%85%B7\" title=\"\u4e00\u3001\u89e3\u5305\u5de5\u5177\">\u4e00\u3001\u89e3\u5305\u5de5\u5177<\/a><ul class=\"ez-toc-list-level-4\"><li class=\"ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#11_simg2img\" title=\"1.1 simg2img\">1.1 simg2img<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#12_lpunpack\" title=\"1.2 lpunpack\">1.2 lpunpack<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#13_unpack_bootimg\" title=\"1.3 unpack_bootimg\">1.3 unpack_bootimg<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-7\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#14_mkdtimg\" title=\"1.4 mkdtimg\">1.4 mkdtimg<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-8\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#15_dtc\" title=\"1.5 dtc\">1.5 dtc<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-9\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#%E4%BA%8C%E3%80%81%E9%95%9C%E5%83%8F%E6%96%87%E4%BB%B6\" title=\"\u4e8c\u3001\u955c\u50cf\u6587\u4ef6\">\u4e8c\u3001\u955c\u50cf\u6587\u4ef6<\/a><ul class=\"ez-toc-list-level-4\"><li class=\"ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-10\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#systemimg\" title=\"system.img\">system.img<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-11\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#bootimg\" title=\"boot.img\">boot.img<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-12\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#dtboimg\" title=\"dtbo.img\">dtbo.img<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-13\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#recoveryimg\" title=\"recovery.img\">recovery.img<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-14\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#vbmetaimg\" title=\"vbmeta.img\">vbmeta.img<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-15\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#superimg\" title=\"super.img\">super.img<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-16\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#metadataimg\" title=\"metadata.img\">metadata.img<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-17\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=10413\/#persistimg\" title=\"persist.img\">persist.img<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E4%BC%A0%E7%BB%9F%E5%88%86%E5%8C%BA%E9%95%9C%E5%83%8F%E6%96%87%E4%BB%B6\"><\/span>\u4f20\u7edf\u5206\u533a\u955c\u50cf\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>ramdisk.img :<br \/>\nandroid\u542f\u52a8\u65f6 \u9996\u5148\u52a0\u8f7dramdisk.img\u955c\u50cf\uff0c\u5e76\u6302\u8f7d\u5230\/\u76ee\u5f55\u4e0b\uff0c\u5e76\u8fdb\u884c\u4e86\u4e00\u7cfb\u5217\u7684\u521d\u59cb\u5316\u52a8\u4f5c\uff0c\u5305\u62ec\u521b\u5efa\u5404\u79cd\u9700\u8981\u7684\u76ee\u5f55\uff0c\u521d\u59cb\u5316console\uff0c\u5f00\u542f\u670d\u52a1\u7b49\u3002<\/li>\n<\/ul>\n<blockquote>\n<p>\u89e3\u538b\uff1a<\/p>\n<\/blockquote>\n<p>\u5982\u4f55\u89e3\u538bramdisk.img\uff1a<a href=\"https:\/\/blog.csdn.net\/nullzxy\/article\/details\/9995203\">https:\/\/blog.csdn.net\/nullzxy\/article\/details\/9995203<\/a><br \/>\nramdisk.img\u662f\u4e00\u4e2agzip\u683c\u5f0f\u7684\u6587\u4ef6\uff0c\u6211\u4eec\u53ea\u9700\u8981\u8fdb\u884c\u6807\u51c6\u7684\u89e3\u538b\u7f29\u64cd\u4f5c\u3002<br \/>\n<code>gunzip -c your-ramdisk-file | cpio -i<\/code><\/p>\n<blockquote>\n<p>\u538b\u7f29\uff1a<\/p>\n<\/blockquote>\n<p>\u4f7f\u7528\u538b\u7f29\u683c\u5f0f<br \/>\nmkbootfs -f ..\/config.txt . | minigzip &gt; ..\/ramdisk.img<br \/>\n\u4e0d\u4f7f\u7528\u538b\u7f29\u683c\u5f0f<br \/>\nmkbootfs -f ..\/config.txt . &gt; ..\/ramdisk.cpio<\/p>\n<p>\u5982\u679c\u662f\u538b\u7f29\u76ee\u5f55\uff0c\u4e0d\u5e26-f\u53c2\u6570\u3002<\/p>\n<ul>\n<li>system.img :<br \/>\nSystem.img\u662f\u5728init.rc\u4e2d\u6307\u5b9a\u4e00\u4e9b\u811a\u672c\u547d\u4ee4\uff0c\u901a\u8fc7init.c\u8fdb\u884c\u89e3\u6790\u5e76\u6302\u8f7d\u5230\u6839\u76ee\u5f55\u4e0b\u7684\/system\u76ee\u5f55\u4e0b\u7684\u3002<\/li>\n<\/ul>\n<p>\u4fee\u6539system.img\u5e76\u91cd\u65b0\u6253\u5305\uff1a<a href=\"https:\/\/blog.csdn.net\/u012851408\/article\/details\/88720278\">https:\/\/blog.csdn.net\/u012851408\/article\/details\/88720278<\/a><br \/>\n<a href=\"https:\/\/blog.csdn.net\/tabactivity\/article\/details\/125993855\">https:\/\/blog.csdn.net\/tabactivity\/article\/details\/125993855<\/a><\/p>\n<p>\u5982\u679c\u6302\u8f7d\u5931\u8d25\uff0c\u8bf7\u5c1d\u8bd5\u4f7f\u7528\u53ea\u8bfb\u65b9\u5f0f\u6302\u8f7d\uff1a<code>mount -o ro system_raw.img \/system_mount_test\/<\/code><\/p>\n<ul>\n<li>userdata.img :<br \/>\n\u7528\u6237\u6570\u636e<\/li>\n<\/ul>\n<h2><span class=\"ez-toc-section\" id=\"Android10%E5%8A%A8%E6%80%81%E5%88%86%E5%8C%BA%E9%95%9C%E5%83%8F%E6%96%87%E4%BB%B6\"><\/span>Android10\u52a8\u6001\u5206\u533a\u955c\u50cf\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/blog.51cto.com\/u_15243273\/5284126\">https:\/\/blog.51cto.com\/u_15243273\/5284126<\/a><br \/>\n<a href=\"https:\/\/source.android.google.cn\/docs\/core\/architecture\/bootloader\/system-as-root?hl=zh-cn\">https:\/\/source.android.google.cn\/docs\/core\/architecture\/bootloader\/system-as-root?hl=zh-cn<\/a><br \/>\n<a href=\"https:\/\/blog.csdn.net\/qq_45698138\/article\/details\/135079440\">https:\/\/blog.csdn.net\/qq_45698138\/article\/details\/135079440<\/a><br \/>\n<a href=\"http:\/\/www.licqi.com\/artikel\/15578.html\">http:\/\/www.licqi.com\/artikel\/15578.html<\/a><br \/>\n<a href=\"https:\/\/blog.csdn.net\/vviccc\/article\/details\/120264902\">https:\/\/blog.csdn.net\/vviccc\/article\/details\/120264902<\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E4%B8%80%E3%80%81%E8%A7%A3%E5%8C%85%E5%B7%A5%E5%85%B7\"><\/span>\u4e00\u3001\u89e3\u5305\u5de5\u5177<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"https:\/\/blog.csdn.net\/In_engineer\/article\/details\/126507288\">https:\/\/blog.csdn.net\/In_engineer\/article\/details\/126507288<\/a> \uff08\u955c\u50cf\u6587\u4ef6\u89e3\u5305\uff09<\/p>\n<h4><span class=\"ez-toc-section\" id=\"11_simg2img\"><\/span>1.1 simg2img<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u7b80\u8ff0\uff1a<br \/>\n\u5c06sparse\u683c\u5f0f\u7684image\u6587\u4ef6\u8f6c\u5316\u4e3araw\u683c\u5f0f\u7684image\u6587\u4ef6\u3002<br \/>\n\u7f16\u8bd1android\u6e90\u7801\u9ed8\u8ba4\u4f1a\u751f\u6210\u3002<\/p>\n<p>\u8def\u5f84\uff1a<br \/>\n<code>out\/host\/linux-x86\/bin\/simg2img<\/code><\/p>\n<h4><span class=\"ez-toc-section\" id=\"12_lpunpack\"><\/span>1.2 lpunpack<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u7b80\u8ff0\uff1a<br \/>\n\u8fd9\u4e2a\u5de5\u5177\u53ef\u4ee5\u5c06system.img\uff0cproduct.img\uff0cvendor.img\u7b49\u6587\u4ef6\u4ecesuper.img\u89e3\u6790\u51fa\u6765\u3002<\/p>\n<p>\u6e90\u7801\u76ee\u5f55\uff1a<code>system\/core\/mkbootimg<\/code><\/p>\n<p>\u8def\u5f84\uff1a<br \/>\n<code>out\/host\/linux-x86\/bin\/lpunpack<\/code><\/p>\n<p>\u7f16\u8bd1\u6307\u4ee4\uff1a<\/p>\n<pre><code class=\"language-bash\">source build\/envsetup.sh\nlunch\nmake lpunpack<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"13_unpack_bootimg\"><\/span>1.3 unpack_bootimg<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u7b80\u8ff0\uff1a<br \/>\n\u4e13\u95e8\u7528\u4e8e\u89e3\u6790boot.img\u7684\u5de5\u5177\u3002<\/p>\n<p>\u8def\u5f84\uff1a<\/p>\n<pre><code class=\"language-bash\">out\/host\/linux-x86\/bin\/unpack_bootimg\nsystem\/core\/mkbootimg\/unpack_bootimg.py<\/code><\/pre>\n<p>\u7f16\u8bd1\u6307\u4ee4\uff1a<\/p>\n<pre><code class=\"language-bash\">source build\/envsetup.sh\nlunch\nmake unpack_bootimg<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"14_mkdtimg\"><\/span>1.4 mkdtimg<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u7b80\u8ff0\uff1a<br \/>\n\u5c06dtbo.img\u6587\u4ef6\u8f6c\u5316\u4e3adtb\u6587\u4ef6\uff0c\u4e00\u4e2adtbo.img\u4f1a\u5305\u542b\u591a\u4e2adtb\u6587\u4ef6\uff1b<br \/>\n\u7f16\u8bd1android\u6e90\u7801\u9ed8\u8ba4\u4f1a\u751f\u6210\u3002<\/p>\n<p>\u8def\u5f84\uff1a<br \/>\n<code>out\/host\/linux-x86\/bin\/mkdtimg<\/code><\/p>\n<h4><span class=\"ez-toc-section\" id=\"15_dtc\"><\/span>1.5 dtc<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u7b80\u8ff0\uff1a<br \/>\n\u5c06dtb\u6587\u4ef6\u8f6c\u5316\u4e3a\u53ef\u9605\u8bfb\u7684dts\u6587\u4ef6\uff1b<br \/>\n\u7f16\u8bd1android\u6e90\u7801\u9ed8\u8ba4\u4f1a\u751f\u6210\u3002<\/p>\n<p>\u8def\u5f84\uff1a<br \/>\n<code>out\/host\/linux-x86\/bin\/dtc<\/code><\/p>\n<h3><span class=\"ez-toc-section\" id=\"%E4%BA%8C%E3%80%81%E9%95%9C%E5%83%8F%E6%96%87%E4%BB%B6\"><\/span>\u4e8c\u3001\u955c\u50cf\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"systemimg\"><\/span>system.img<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li>\u89e3\u5305<br \/>\n<a href=\"https:\/\/blog.csdn.net\/u012851408\/article\/details\/88720278\">https:\/\/blog.csdn.net\/u012851408\/article\/details\/88720278<\/a><\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"bootimg\"><\/span>boot.img<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u955c\u50cf\u57fa\u672c\u6784\u6210\u4e3a\uff1a\u5934\u90e8\uff0c\u3000\u5185\u6838\uff0c\u3000ramdisk\u955c\u50cf<\/p>\n<ul>\n<li>boot.img\u62c6\u5305<br \/>\n<code>unpack_bootimg --boot_img boot.img --out boot<\/code><\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"dtboimg\"><\/span>dtbo.img<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u8bbe\u5907\u6811\u589e\u91cf\u7f16\u8bd1\uff08Device Tree Overlay\uff09\u7684\u955c\u50cf\u6587\u4ef6\u3002\u5b83\u5305\u542b\u4e86\u8bbe\u5907\u6811\u7684\u589e\u91cf\u4fe1\u606f\uff0c\u7528\u4e8e\u5728\u8fd0\u884c\u65f6\u4fee\u6539\u8bbe\u5907\u6811\uff0c\u4ee5\u652f\u6301\u52a8\u6001\u786c\u4ef6\u914d\u7f6e\u3002<\/p>\n<ul>\n<li>\u62c6\u5305<\/li>\n<\/ul>\n<p>(1) \u5148\u4ecedtbo.img\u89e3\u6790\u51fadtb\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash\">#\u521b\u5efadtbo\u76ee\u5f55\uff0c\u7136\u540e\u4f7f\u7528mkdtimg\u5de5\u5177\u89e3\u6790dtbo.img\uff0c-b\u540e\u8fb9\u662f\u8f93\u51fa\u8def\u5f84(dtb\u662f\u81ea\u5b9a\u4e49\u7684\u6587\u4ef6\u540d\u524d\u7f00)\nsun@sun-pc:~\/android\/imgs$ mkdir dtbo &amp;&amp; ..\/out\/host\/linux-x86\/bin\/mkdtimg dump dtbo.img -b dtbo\/dtb\nsun@sun-pc:~\/android\/imgs$ ls dtbo\ndtb.0  dtb.1  dtb.10  dtb.11  dtb.12  dtb.13  dtb.14  dtb.15  dtb.16  dtb.17  ...  dtb.6  dtb.7  dtb.8  dtb.9\n\n#\u67e5\u770b\u4e00\u4e0b\u6587\u4ef6\u4fe1\u606f\uff0c\u7684\u786e\u662fdtb(Device Tree Blob)\u6587\u4ef6\nsun@sun-pc:~\/android\/imgs$ file dtbo\/dtb.0\ndtbo\/dtb.0: Device Tree Blob version 17, size=110367, boot CPU=0, string block size=7979, DT structure block size=102332\n<\/code><\/pre>\n<p>(2) \u518d\u5c06\u4e0a\u4e00\u6b65\u7684dtb\u6587\u4ef6\u8f6c\u5316\u4e3a\u53ef\u4ee5\u9605\u8bfb\u7684dts\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash\">#\u5c06dtb.0\u8f6c\u5316\u4e3a0.dts\nsun@sun-pc:~\/android\/imgs$ ..\/out\/host\/linux-x86\/bin\/dtc dtbo\/dtb.0 dtbo\/0.dts\n\n#\u5982\u679c\u89c9\u5f97\u4e00\u4e2a\u4e2a\u6587\u4ef6\u8f6c\u5316\u6bd4\u8f83\u9ebb\u70e6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\nfind .\/dtbo -name &#039;dtb.*&#039; | xargs -n1 sh -c &#039;..\/out\/host\/linux-x86\/bin\/dtc $1 -o $1.dts &amp;&amp; rename &quot;s\/dtb\\.\/\/&quot; $1.dts&#039; sh\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"recoveryimg\"><\/span>recovery.img<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u7528\u4e8eAndroid\u7cfb\u7edf\u6062\u590d\u6a21\u5f0f\uff08Recovery Mode\uff09\u7684\u955c\u50cf\u6587\u4ef6\u3002\u5728\u6062\u590d\u6a21\u5f0f\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528recovery.img\u4e2d\u7684\u529f\u80fd\u6765\u6267\u884c\u7cfb\u7edf\u6062\u590d\u3001\u5237\u5165OTA\u66f4\u65b0\u7b49\u64cd\u4f5c\u3002<\/p>\n<ul>\n<li>\u62c6\u5305<br \/>\n\u4e0eboot.img\u4e00\u6837\uff0c\u90fd\u662fAndroid bootimg\u683c\u5f0f\uff0c\u89e3\u5305\u65b9\u5f0f\u4e00\u6837\uff1a<code>unpack_bootimg --boot_img recovery.img --out recovery<\/code><\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"vbmetaimg\"><\/span>vbmeta.img<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u4e0e\u9a8c\u8bc1\u542f\u52a8\uff08Verified Boot\uff09\u76f8\u5173\u7684\u955c\u50cf\u6587\u4ef6\u3002<\/p>\n<h4><span class=\"ez-toc-section\" id=\"superimg\"><\/span>super.img<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><a href=\"https:\/\/www.lsjlt.com\/news\/371844.html\">https:\/\/www.lsjlt.com\/news\/371844.html<\/a><br \/>\nAndroid10\u5f00\u59cb\u4f7f\u7528\u52a8\u6001\u5206\u533a\uff0csystem\u3001vendor\u3001 odm\u7b49\u90fd\u5305\u542b\u5728super.img\u91cc\u9762\uff0c\u53ef\u4ee5\u6309\u5982\u4e0b\u65b9\u5f0f\u5bf9super.img\u8fdb\u884c\u89e3\u5305\u548c\u7ec4\u5305\u3002<\/p>\n<ul>\n<li>super.img\u89e3\u5305<\/li>\n<\/ul>\n<p>super\u7684\u89e3\u5305\u9700\u8981\u5de5\u5177lpunpack\uff0c\u4f46\u662f\u9ed8\u8ba4\u6ca1\u6709\u7f16\u8bd1\uff0c\u6e90\u7801\u76ee\u5f55\u4f4d\u4e8e\uff1asystem\/extras\/partition_tools\/ \uff0c\u9700\u8981\u624b\u52a8\u7f16\u8bd1\u751f\u6210\uff1b<br \/>\n\u5728android\u6839\u76ee\u5f55\u4e0b\u6267\u884c<\/p>\n<p><code>make lpunpack<\/code><br \/>\n\u7f16\u8bd1\u540e\u751f\u6210 <code>out\/host\/linux-86\/bin\/lpunpack<\/code><\/p>\n<p>\u5f00\u59cb\u89e3\u5305\uff1a<br \/>\n\u7b2c\u4e00\u6b65\uff0c\u683c\u5f0f\u8f6c\u6362\uff0c\u8f6c\u5316\u4e3aext4<\/p>\n<p><code>simg2img super.img super_ext4.img<\/code><br \/>\n\u7b2c\u4e8c\u6b65\uff0c\u521b\u5efa\u76ee\u5f55super_ext4\/ \u5b58\u653e\u89e3\u5305\u540e\u7684\u6587\u4ef6<\/p>\n<p>mkdir super_ext4<br \/>\n\u7b2c\u4e09\u6b65\uff0c\u89e3\u5305super_ext4.img<\/p>\n<p><code>out\/host\/linux-86\/bin\/lpunpack       super_ext4.img   super_ext4\/<\/code><br \/>\n\u89e3\u5305\u540e\u5728super_ext4\/\u5b58\u653e\u7740\u662f\u54ea\u4e2a\u5b8c\u6574\u7684system.img vendor.img product.img \u662fext4\u683c\u5f0f\u7684\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7mount\u6302\u8f7d\u4e3a\u6587\u4ef6\u76ee\u5f55<\/p>\n<ul>\n<li>\u6253\u5305super.img<\/li>\n<\/ul>\n<p>\u6253\u5305\u9700\u8981\u7684\u5de5\u5177lpmake\uff0c\u5de5\u5177\u5728<code>out\/host\/linux-86\/bin\/lpmake<\/code><br \/>\n\u7b2c\u4e00\u6b65\uff0c\u786e\u8ba4\u5404\u4e2aimg\u7684\u5927\u5c0f<br \/>\n\u4e0a\u9762\u89e3\u5305\u51fa\u6765super_ext4\u76ee\u5f55\u4e0b\u7684img\u6587\u4ef6\uff0c\u9700\u8981\u91cd\u65b0\u6253\u5305\u6210super.img\uff0c\u5728super_ext4\/\u76ee\u5f55\u4e0b\u6267\u884c<\/p>\n<pre><code class=\"language-bash\">@sys2_206:~\/5_Android11_sdk_78\/rockdev\/Image-rk3568_r\/super_ext4$ stat -c &#039;%n %s&#039; *odm.img 626688product.img 213348352system_ext.img 123666432system.img 980586496vendor.img 315723776<\/code><\/pre>\n<p>\u7b2c\u4e8c\u6b65\uff0c\u5f00\u59cb\u6253\u5305super.img<br \/>\n\u6309\u5982\u4e0b\u547d\u4ee4\u6253\u5305<\/p>\n<pre><code class=\"language-bash\">out\/host\/linux-86\/bin\/lpmake \\--metadata-size 65536 --super-name super \\--metadata-slots 2 \\--device super:3263168512 \\--group rockchip_dynamic_partitions:3258974208 \\--partition system:readonly:980586496:rockchip_dynamic_partitions --image system=out\/target\/product\/rk3568_r\/system.img \\--partition system_ext:readonly:123666432:rockchip_dynamic_partitions --image system_ext=out\/target\/product\/rk3568_r\/system_ext.img \\--partition vendor:readonly:315723776:rockchip_dynamic_partitions --image vendor=out\/target\/product\/rk3568_r\/vendor.img \\--partition product:readonly:213348352:rockchip_dynamic_partitions --image product=out\/target\/product\/rk3568_r\/product.img \\--partition odm:readonly:626688:rockchip_dynamic_partitions --image odm=out\/target\/product\/rk3568_r\/odm.img \\--sparse \\--output out\/target\/product\/rk3568_r\/super.img<\/code><\/pre>\n<p>\u8fd9\u4e2a\u547d\u4ee4\u53ef\u4ee5\u5728\u7f16\u8bd1android\u7684\u65f6\u5019\u901a\u8fc7\u7f16\u8bd1log\u83b7\u53d6\uff0clog\u4fdd\u5b58\u5728out\/verbose.log.gz\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u663e\u793a\u6240\u6709log\uff0c\u7136\u540e\u5728\u91cc\u9762\u627elpmake<\/p>\n<p><code>gzip -cd out\/verbose.log.gz|less<\/code><\/p>\n<h4><span class=\"ez-toc-section\" id=\"metadataimg\"><\/span>metadata.img<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u5373\u5404\u4e2a.img\u6587\u4ef6\u7684\u53c2\u6570\u4fe1\u606f<\/p>\n<p>metadata \u5206\u533a\u5305\u542b\u4e86\u5173\u4e8e\u5206\u533a\u5e03\u5c40\u548c\u6587\u4ef6\u7cfb\u7edf\u7684\u5143\u6570\u636e\u4fe1\u606f\u3002\u5b83\u8bb0\u5f55\u4e86\u5206\u533a\u7684\u5927\u5c0f\u3001\u6587\u4ef6\u7cfb\u7edf\u7c7b\u578b\u3001\u4f4d\u7f6e\u7b49\u3002\u8fd9\u4e9b\u4fe1\u606f\u5bf9\u4e8e\u7cfb\u7edf\u7684\u5206\u533a\u7ba1\u7406\u548c\u6587\u4ef6\u7cfb\u7edf\u7684\u6b63\u786e\u8bc6\u522b\u5f88\u91cd\u8981\u3002<\/p>\n<ul>\n<li>\u89e3\u5305<\/li>\n<\/ul>\n<p>(1) \u5c06sparse\u683c\u5f0f\u7684metadata.img\u8f6c\u5316\u4e3araw\u683c\u5f0f\u7684metadata_raw.img<\/p>\n<p><code>sun@sun-pc:~\/android\/imgs$ ..\/out\/host\/linux-x86\/bin\/simg2img metadata.img metadata_raw.img <\/code><br \/>\n(2) \u5c06metadata_raw.img\u6302\u8f7d\u5230\u4e00\u4e2a\u76ee\u5f55\u4e0a\uff0c\u6b64\u65f6\u8bbf\u95ee\u8fd9\u4e2a\u76ee\u5f55\u5c31\u53ef\u4ee5\u8bbf\u95ee\u955c\u50cf\u6587\u4ef6\u7684\u5185\u5bb9\u4e86<\/p>\n<pre><code class=\"language-bash\">#\u9996\u5148\u521b\u5efa\u76ee\u5f55metadata\uff0c\u7136\u540e\u5c06metadata_raw.img\u6302\u8f7d\u5230\u6b64\u76ee\u5f55\nsun@sun-pc:~\/android\/imgs$ mkdir metadata &amp;&amp; sudo mount -o ro metadata_raw.img metadata\n\n#\u53ef\u4ee5\u770b\u5230metadata\u76ee\u5f55\u5df2\u7ecf\u6709\u5185\u5bb9\u4e86\nsun@sun-pc:~\/android\/imgs$ ls\nlost+found\n<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"persistimg\"><\/span>persist.img<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>persist\u5206\u533a\u4e3b\u8981\u7528\u4e8e\u5b58\u50a8\u6301\u4e45\u5316\u7684\u7cfb\u7edf\u8bbe\u7f6e\u548c\u914d\u7f6e\u6570\u636e\u3002\u5b83\u662f Android \u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u7279\u6b8a\u5206\u533a\uff0c\u7528\u4e8e\u4fdd\u5b58\u8bbe\u5907\u8bbe\u7f6e\u3001\u7528\u6237\u9996\u9009\u9879\u548c\u5e94\u7528\u7a0b\u5e8f\u914d\u7f6e\u7b49\u4fe1\u606f\uff0c\u4ee5\u4fbf\u5728\u8bbe\u5907\u91cd\u65b0\u542f\u52a8\u540e\u4fdd\u6301\u6301\u4e45\u6027\u3002<\/p>\n<ul>\n<li>\u62c6\u5305<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u955c\u50cf\u662flinux ext4\u683c\u5f0f\u7684\uff0c\u76f4\u63a5\u6302\u8f7d\u5373\u53ef<\/p>\n<pre><code class=\"language-bash\">sun@sun-pc:~\/android\/imgs$ mkdir persist\nsun@sun-pc:~\/android\/imgs$ sudo mount -o ro persist.img persist\n\nsun@sun-pc:~\/android\/imgs$ ls persist\nlost+found  sensors\n<\/code><\/pre>\n<button class=\"simplefavorite-button\" data-postid=\"10413\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"0\" style=\"\">\u6536\u85cf <i class=\"sf-icon-star-empty\"><\/i><\/button>","protected":false},"excerpt":{"rendered":"<p>https:\/\/blog.csdn.net\/z755924843\/article\/details\/1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[823],"tags":[],"_links":{"self":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/10413"}],"collection":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10413"}],"version-history":[{"count":34,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/10413\/revisions"}],"predecessor-version":[{"id":13831,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/10413\/revisions\/13831"}],"wp:attachment":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10413"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}