{"id":4586,"date":"2021-09-02T09:55:02","date_gmt":"2021-09-02T01:55:02","guid":{"rendered":"http:\/\/122.152.205.50\/wordpress\/?p=4586"},"modified":"2024-04-11T16:27:07","modified_gmt":"2024-04-11T08:27:07","slug":"android%e7%bc%96%e8%af%91%e6%a0%b8%e5%bf%83-build%e7%b3%bb%e7%bb%9f","status":"publish","type":"post","link":"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586","title":{"rendered":"Android\u7f16\u8bd1\u6838\u5fc3-Build\u7cfb\u7edf"},"content":{"rendered":"<p><a href=\"http:\/\/www.uml.org.cn\/mobiledev\/201705272.asp\">http:\/\/www.uml.org.cn\/mobiledev\/201705272.asp<\/a><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/qq_26787115\/article\/details\/79745022\">https:\/\/blog.csdn.net\/qq_26787115\/article\/details\/79745022<\/a><\/p>\n<p><a href=\"https:\/\/www.jianshu.com\/p\/5ad125c62af3\">https:\/\/www.jianshu.com\/p\/5ad125c62af3<\/a><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/gzzaigcnforever\/article\/details\/20146483\">https:\/\/blog.csdn.net\/gzzaigcnforever\/article\/details\/20146483<\/a><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/z1106609486\/article\/details\/51406744\/\">https:\/\/blog.csdn.net\/z1106609486\/article\/details\/51406744\/<\/a> \uff08\u5de8\u8be6\u7ec6\uff01\uff09<\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/cx_chess\/article\/details\/101938206\">https:\/\/blog.csdn.net\/cx_chess\/article\/details\/101938206<\/a><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/u014674293\/article\/details\/105158562\/\">https:\/\/blog.csdn.net\/u014674293\/article\/details\/105158562\/<\/a><\/p>\n<p><a href=\"https:\/\/www.cnblogs.com\/aspirs\/p\/7822474.html\">https:\/\/www.cnblogs.com\/aspirs\/p\/7822474.html<\/a><\/p>\n<p><a href=\"https:\/\/www.cnblogs.com\/wi100sh\/p\/4338539.html\">https:\/\/www.cnblogs.com\/wi100sh\/p\/4338539.html<\/a> \uff08\u5bf9\u4e00\u4e9b\u53d8\u91cf\u4f5c\u4e86\u8be6\u7ec6\u7684\u8bf4\u660e\uff09<\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/lizhaohui815\/article\/details\/44676113\">https:\/\/blog.csdn.net\/lizhaohui815\/article\/details\/44676113<\/a> \uff08make dist   \u6267\u884c Build\uff0c\u5e76\u5c06 MAKECMDGOALS \u53d8\u91cf\u5b9a\u4e49\u7684\u8f93\u51fa\u6587\u4ef6\u62f7\u8d1d\u5230 \/out\/dist \u76ee\u5f55\u3002\uff09<\/p>\n<p><a href=\"https:\/\/source.android.google.cn\/docs\/setup\/about?hl=da\">https:\/\/source.android.google.cn\/docs\/setup\/about?hl=da<\/a> \uff08google\u5b98\u7f51\uff09<\/p>\n<p><a href=\"https:\/\/www.jianshu.com\/p\/fd86aef44365?utm_campaign=maleskine&amp;utm_content=note&amp;utm_medium=seo_notes\">https:\/\/www.jianshu.com\/p\/fd86aef44365?utm_campaign=maleskine&amp;utm_content=note&amp;utm_medium=seo_notes<\/a> \uff08**\uff09<\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/z1106609486\/article\/details\/51406744\">https:\/\/blog.csdn.net\/z1106609486\/article\/details\/51406744<\/a><\/p>\n<p><a href=\"https:\/\/blog.csdn.net\/xiehaihit\/article\/details\/92642127\">https:\/\/blog.csdn.net\/xiehaihit\/article\/details\/92642127<\/a><\/p>\n<p><a href=\"https:\/\/www.jianshu.com\/p\/b088befb8c61\">https:\/\/www.jianshu.com\/p\/b088befb8c61<\/a> (**)<\/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-1\"><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E4%B8%80%E3%80%81%E9%95%9C%E5%83%8F%E5%88%B6%E4%BD%9C%E7%9B%B8%E5%85%B3%E7%9A%84%E8%84%9A%E6%9C%AC%E5%88%86%E6%9E%90%EF%BC%88%E4%BB%A5android10%E6%BA%90%E7%A0%81%E4%B8%BA%E4%BE%8B%EF%BC%89\" title=\"\u4e00\u3001\u955c\u50cf\u5236\u4f5c\u76f8\u5173\u7684\u811a\u672c\u5206\u6790\uff08\u4ee5android10\u6e90\u7801\u4e3a\u4f8b\uff09\">\u4e00\u3001\u955c\u50cf\u5236\u4f5c\u76f8\u5173\u7684\u811a\u672c\u5206\u6790\uff08\u4ee5android10\u6e90\u7801\u4e3a\u4f8b\uff09<\/a><ul class=\"ez-toc-list-level-2\"><li class=\"ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#build_imagepy_%E5%88%B6%E4%BD%9C%E9%95%9C%E5%83%8F\" title=\"build_image.py (\u5236\u4f5c\u955c\u50cf)\">build_image.py (\u5236\u4f5c\u955c\u50cf)<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#mkuserimg_mke2fspy%EF%BC%88%E5%88%B6%E4%BD%9C%E9%95%9C%E5%83%8F%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%EF%BC%89\" title=\"mkuserimg_mke2fs.py\uff08\u5236\u4f5c\u955c\u50cf\u6587\u4ef6\u7cfb\u7edf\uff09\">mkuserimg_mke2fs.py\uff08\u5236\u4f5c\u955c\u50cf\u6587\u4ef6\u7cfb\u7edf\uff09<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#add_img_to_target_filespy_%EF%BC%88%E5%B0%86%E9%95%9C%E5%83%8F%E5%86%99%E5%85%A5target_fileszip%E5%8C%85%EF%BC%89\" title=\"add_img_to_target_files.py \uff08\u5c06\u955c\u50cf\u5199\u5165target_files.zip\u5305\uff09\">add_img_to_target_files.py \uff08\u5c06\u955c\u50cf\u5199\u5165target_files.zip\u5305\uff09<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-1\"><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E4%BA%8C%E3%80%81Android%E7%B3%BB%E7%BB%9F%E9%95%9C%E5%83%8F%E6%96%87%E4%BB%B6%E6%89%93%E5%8C%85%E7%9A%84%E8%BF%87%E7%A8%8B\" title=\"\u4e8c\u3001Android\u7cfb\u7edf\u955c\u50cf\u6587\u4ef6\u6253\u5305\u7684\u8fc7\u7a0b\">\u4e8c\u3001Android\u7cfb\u7edf\u955c\u50cf\u6587\u4ef6\u6253\u5305\u7684\u8fc7\u7a0b<\/a><ul class=\"ez-toc-list-level-2\"><li class=\"ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E4%B8%80%E3%80%81%E5%90%84%E4%B8%AAimg%E9%95%9C%E5%83%8F%E7%9A%84%E6%9E%84%E5%BB%BA%E8%BF%87%E7%A8%8B%E5%8F%8A%E8%AF%B4%E6%98%8E\" title=\"\u4e00\u3001\u5404\u4e2a.img\u955c\u50cf\u7684\u6784\u5efa\u8fc7\u7a0b\u53ca\u8bf4\u660e\">\u4e00\u3001\u5404\u4e2a.img\u955c\u50cf\u7684\u6784\u5efa\u8fc7\u7a0b\u53ca\u8bf4\u660e<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-7\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#1%E6%A0%B9%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E7%9A%84%E5%88%B6%E4%BD%9C\" title=\"1.\u6839\u6587\u4ef6\u7cfb\u7edf\u7684\u5236\u4f5c\">1.\u6839\u6587\u4ef6\u7cfb\u7edf\u7684\u5236\u4f5c<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-8\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#2systemimg\" title=\"2.system.img\">2.system.img<\/a><ul class=\"ez-toc-list-level-4\"><li class=\"ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-9\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E5%85%B7%E4%BD%93%E6%9E%84%E5%BB%BA%E8%BF%87%E7%A8%8B\" title=\"\u5177\u4f53\u6784\u5efa\u8fc7\u7a0b\">\u5177\u4f53\u6784\u5efa\u8fc7\u7a0b<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-10\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E6%9E%84%E5%BB%BA%E6%97%A5%E5%BF%97\" title=\"\u6784\u5efa\u65e5\u5fd7\">\u6784\u5efa\u65e5\u5fd7<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-11\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#3ramdiskimg%E6%9C%80%E5%B0%8F%E6%A0%B9%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F\" title=\"3.ramdisk.img(\u6700\u5c0f\u6839\u6587\u4ef6\u7cfb\u7edf)\">3.ramdisk.img(\u6700\u5c0f\u6839\u6587\u4ef6\u7cfb\u7edf)<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-12\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#4bootimg\" title=\"4.boot.img\">4.boot.img<\/a><ul class=\"ez-toc-list-level-4\"><li class=\"ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-13\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#4-1kernel%E7%9A%84%E7%94%9F%E6%88%90%E8%BF%87%E7%A8%8B\" title=\"4-1)kernel\u7684\u751f\u6210\u8fc7\u7a0b\">4-1)kernel\u7684\u751f\u6210\u8fc7\u7a0b<\/a><ul class=\"ez-toc-list-level-5\"><li class=\"ez-toc-heading-level-5\"><a class=\"ez-toc-link ez-toc-heading-14\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E5%86%85%E6%A0%B8%E6%9E%84%E5%BB%BA%E8%84%9A%E6%9C%AC\" title=\"\u5185\u6838\u6784\u5efa\u811a\u672c\">\u5185\u6838\u6784\u5efa\u811a\u672c<\/a><ul class=\"ez-toc-list-level-6\"><li class=\"ez-toc-heading-level-6\"><a class=\"ez-toc-link ez-toc-heading-15\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#1make_defconfig%E6%96%B9%E6%B3%95%E6%A0%B9%E6%8D%AE%E5%86%85%E6%A0%B8%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E7%94%9F%E6%88%90config%E6%96%87%E4%BB%B6\" title=\"1.make_defconfig\u65b9\u6cd5(\u6839\u636e\u5185\u6838\u914d\u7f6e\u6587\u4ef6\u751f\u6210.config\u6587\u4ef6)\">1.make_defconfig\u65b9\u6cd5(\u6839\u636e\u5185\u6838\u914d\u7f6e\u6587\u4ef6\u751f\u6210.config\u6587\u4ef6)<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-6\"><a class=\"ez-toc-link ez-toc-heading-16\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#2headers_install%E5%A4%8D%E5%88%B6%E5%86%85%E6%A0%B8%E6%BA%90%E7%A0%81%E4%B8%8B%E7%9A%84%E5%A4%B4%E6%96%87%E4%BB%B6%E5%88%B0%E5%86%85%E6%A0%B8%E7%BC%96%E8%AF%91%E8%BE%93%E5%87%BA%E7%9B%AE%E5%BD%95%E4%B8%8B%E7%9A%84usrinclude%E7%9B%AE%E5%BD%95\" title=\"2.headers_install(\u590d\u5236\u5185\u6838\u6e90\u7801\u4e0b\u7684\u5934\u6587\u4ef6\u5230\u5185\u6838\u7f16\u8bd1\u8f93\u51fa\u76ee\u5f55\u4e0b\u7684\/usr\/include\u76ee\u5f55)\">2.headers_install(\u590d\u5236\u5185\u6838\u6e90\u7801\u4e0b\u7684\u5934\u6587\u4ef6\u5230\u5185\u6838\u7f16\u8bd1\u8f93\u51fa\u76ee\u5f55\u4e0b\u7684\/usr\/include\u76ee\u5f55)<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-6\"><a class=\"ez-toc-link ez-toc-heading-17\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#3build_kernel%E6%9E%84%E5%BB%BA%E5%86%85%E6%A0%B8\" title=\"3.build_kernel(\u6784\u5efa\u5185\u6838)\">3.build_kernel(\u6784\u5efa\u5185\u6838)<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-6\"><a class=\"ez-toc-link ez-toc-heading-18\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#4modules_install%E6%A8%A1%E5%9D%97%E5%AE%89%E8%A3%85\" title=\"4.modules_install(\u6a21\u5757\u5b89\u88c5)\">4.modules_install(\u6a21\u5757\u5b89\u88c5)<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-6\"><a class=\"ez-toc-link ez-toc-heading-19\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#5copy_all_to_prebuilt\" title=\"5.copy_all_to_prebuilt()\">5.copy_all_to_prebuilt()<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-5\"><a class=\"ez-toc-link ez-toc-heading-20\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E5%86%85%E6%A0%B8%E6%9E%84%E5%BB%BA%E6%97%A5%E5%BF%97\" title=\"\u5185\u6838\u6784\u5efa\u65e5\u5fd7\">\u5185\u6838\u6784\u5efa\u65e5\u5fd7<\/a><\/li><\/ul><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-21\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#5super_emptyimg\" title=\"5.super_empty.img\">5.super_empty.img<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-22\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#6superimg_%E6%AF%94%E8%BE%83%E7%89%B9%E6%AE%8A%EF%BC%8C%E6%98%AF%E5%9C%A8target%E5%8C%85%E5%88%B6%E4%BD%9C%E5%AE%8C%E6%88%90%E4%B9%8B%E5%90%8E%E6%89%8D%E4%BC%9A%E7%94%9F%E6%88%90%E3%80%82\" title=\"6.super.img (\u6bd4\u8f83\u7279\u6b8a\uff0c\u662f\u5728target\u5305\u5236\u4f5c\u5b8c\u6210\u4e4b\u540e\u624d\u4f1a\u751f\u6210\u3002)\">6.super.img (\u6bd4\u8f83\u7279\u6b8a\uff0c\u662f\u5728target\u5305\u5236\u4f5c\u5b8c\u6210\u4e4b\u540e\u624d\u4f1a\u751f\u6210\u3002)<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-23\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E4%BA%8C%E3%80%81%E5%90%84%E4%B8%AAimg%E9%95%9C%E5%83%8F%E6%9E%84%E5%BB%BA%E5%AE%8C%E6%88%90%E4%B9%8B%E5%90%8E%E5%B9%B2%E4%BA%86%E4%BB%80%E4%B9%88\" title=\"\u4e8c\u3001\u5404\u4e2a.img\u955c\u50cf\u6784\u5efa\u5b8c\u6210\u4e4b\u540e\u5e72\u4e86\u4ec0\u4e48\">\u4e8c\u3001\u5404\u4e2a.img\u955c\u50cf\u6784\u5efa\u5b8c\u6210\u4e4b\u540e\u5e72\u4e86\u4ec0\u4e48<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-24\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E5%88%B6%E4%BD%9C%E5%8D%87%E7%BA%A7%E5%8C%85\" title=\"\u5236\u4f5c\u5347\u7ea7\u5305\">\u5236\u4f5c\u5347\u7ea7\u5305<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-25\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E4%B8%89%E3%80%81qssi%E4%B8%8Ekona%E7%9A%84target%E5%8C%85%E5%AF%B9%E6%AF%94\" title=\"\u4e09\u3001qssi\u4e0ekona\u7684target\u5305\u5bf9\u6bd4\">\u4e09\u3001qssi\u4e0ekona\u7684target\u5305\u5bf9\u6bd4<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-26\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#qssi%E4%B8%8Ekona%E7%9A%84mk%E6%96%87%E4%BB%B6\" title=\"qssi\u4e0ekona\u7684mk\u6587\u4ef6\">qssi\u4e0ekona\u7684mk\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-27\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#1deviceqcomqssiqssimk\" title=\"1.device\/qcom\/qssi\/qssi.mk\">1.device\/qcom\/qssi\/qssi.mk<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-28\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#2deviceqcomkonakonamk\" title=\"2.device\/qcom\/kona\/kona.mk\">2.device\/qcom\/kona\/kona.mk<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-29\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#qssi%E4%B8%8Ekona%E7%9A%84target%E5%8C%85%E5%A6%82%E4%BD%95merged\" title=\"qssi\u4e0ekona\u7684target\u5305\u5982\u4f55merged\">qssi\u4e0ekona\u7684target\u5305\u5982\u4f55merged<\/a><ul class=\"ez-toc-list-level-4\"><li class=\"ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-30\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#BOOT\" title=\"BOOT\">BOOT<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-31\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#IMAGES\" title=\"IMAGES\">IMAGES<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-32\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#META\" title=\"META\">META<\/a><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-33\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#OTA\" title=\"OTA\">OTA<\/a><\/li><\/ul><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-34\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E5%9B%9B%E3%80%81%E9%AB%98%E9%80%9Abuildsh%E8%84%9A%E6%9C%AC%E5%88%86%E6%9E%90\" title=\"\u56db\u3001\u9ad8\u901abuild.sh\u811a\u672c\u5206\u6790\">\u56db\u3001\u9ad8\u901abuild.sh\u811a\u672c\u5206\u6790<\/a><ul class=\"ez-toc-list-level-3\"><li class=\"ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-35\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#1lunch%E9%87%8D%E8%A6%81%E6%97%A5%E5%BF%97%E5%88%86%E6%9E%90\" title=\"1.lunch\u91cd\u8981\u65e5\u5fd7\u5206\u6790\">1.lunch\u91cd\u8981\u65e5\u5fd7\u5206\u6790<\/a><ul class=\"ez-toc-list-level-4\"><li class=\"ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-36\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#1-1%EF%BC%89lunch_qssi-userdebug\" title=\"1-1\uff09lunch qssi-userdebug\">1-1\uff09lunch qssi-userdebug<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-37\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#2generate_ota_zip%EF%BC%88%E5%88%B6%E4%BD%9COTA%E5%8D%87%E7%BA%A7%E5%8C%85%EF%BC%89\" title=\"2.generate_ota_zip\uff08\u5236\u4f5cOTA\u5347\u7ea7\u5305\uff09\">2.generate_ota_zip\uff08\u5236\u4f5cOTA\u5347\u7ea7\u5305\uff09<\/a><ul class=\"ez-toc-list-level-4\"><li class=\"ez-toc-heading-level-4\"><a class=\"ez-toc-link ez-toc-heading-38\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#1merge%E6%97%A5%E5%BF%97%EF%BC%9A\" title=\"1.merge\u65e5\u5fd7\uff1a\">1.merge\u65e5\u5fd7\uff1a<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-3\"><a class=\"ez-toc-link ez-toc-heading-39\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#3generate_dynamic_partition_images%EF%BC%88%E5%88%B6%E4%BD%9Csuperimg%E5%8A%A8%E6%80%81%E5%88%86%E5%8C%BA%EF%BC%89\" title=\"3.generate_dynamic_partition_images\uff08\u5236\u4f5csuper.img\u52a8\u6001\u5206\u533a\uff09\">3.generate_dynamic_partition_images\uff08\u5236\u4f5csuper.img\u52a8\u6001\u5206\u533a\uff09<\/a><\/li><\/ul><\/li><li class=\"ez-toc-page-1 ez-toc-heading-level-2\"><a class=\"ez-toc-link ez-toc-heading-40\" href=\"http:\/\/xinyiworld.top\/wordpress_it\/?p=4586\/#%E4%BA%94%E3%80%81%E9%AB%98%E9%80%9Apkg_toolscommonbuildbuildpy_%E8%84%9A%E6%9C%AC%E5%88%86%E6%9E%90\" title=\"\u4e94\u3001\u9ad8\u901apkg_tools\/common\/build\/build.py \u811a\u672c\u5206\u6790\">\u4e94\u3001\u9ad8\u901apkg_tools\/common\/build\/build.py \u811a\u672c\u5206\u6790<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E4%B8%80%E3%80%81%E9%95%9C%E5%83%8F%E5%88%B6%E4%BD%9C%E7%9B%B8%E5%85%B3%E7%9A%84%E8%84%9A%E6%9C%AC%E5%88%86%E6%9E%90%EF%BC%88%E4%BB%A5android10%E6%BA%90%E7%A0%81%E4%B8%BA%E4%BE%8B%EF%BC%89\"><\/span>\u4e00\u3001\u955c\u50cf\u5236\u4f5c\u76f8\u5173\u7684\u811a\u672c\u5206\u6790\uff08\u4ee5android10\u6e90\u7801\u4e3a\u4f8b\uff09<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<h2><span class=\"ez-toc-section\" id=\"build_imagepy_%E5%88%B6%E4%BD%9C%E9%95%9C%E5%83%8F\"><\/span>build_image.py (\u5236\u4f5c\u955c\u50cf)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><a href=\"https:\/\/blog.csdn.net\/lewif\/article\/details\/56837191\">https:\/\/blog.csdn.net\/lewif\/article\/details\/56837191<\/a><br \/>\n\u6587\u4ef6\u4f4d\u7f6e\uff1abuild\/make\/tools\/releasetools\/build_image.py<\/p>\n<ul>\n<li>\n<p>LoadGlobalDict\u4e0eImagePropFromGlobalDict<br \/>\nLoadGlobalDict\u8bfb\u53d6system_image_info.txt\u5230\u6570\u7ec4\uff0cImagePropFromGlobalDict\u5219\u6839\u636e\u4e0d\u540c\u7684\u955c\u50cf\u6dfb\u52a0\u4e0d\u540c\u7684\u53c2\u6570\u3002<\/p>\n<\/li>\n<li>\n<p>BuildImage<\/p>\n<\/li>\n<\/ul>\n<p>BuildImage-&gt;<br \/>\n------------1)SetUpInDirAndFsConfig<br \/>\n------------2)BuildImageMkfs<\/p>\n<p>1) in_dir, fs_config = SetUpInDirAndFsConfig(in_dir, prop_dict)<\/p>\n<p>\u7406\u89e3\u8fd9\u4e2a\u65b9\u6cd5\u9700\u8981\u4e86\u89e3Android\u7684\u5206\u533a\u673a\u5236<strong>system-as-root<\/strong>\uff0c<a href=\"https:\/\/blog.csdn.net\/u012932409\/article\/details\/105075851\">https:\/\/blog.csdn.net\/u012932409\/article\/details\/105075851<\/a><\/p>\n<p>\u975e\u5e38\u91cd\u8981\uff01\uff01\uff01\uff01\uff01\uff01\uff01\uff01\uff01\uff01<br \/>\n<strong>\u7f16\u8bd1\u59cb\u7ec8\u5c06 $TARGET_SYSTEM_OUT \u548c $TARGET_ROOT_OUT \u5408\u5e76\u5230 system.img \u4e2d\uff1b\u6b64\u914d\u7f6e\u662f\u642d\u8f7d Android 10 \u7684\u6240\u6709\u8bbe\u5907\u7684\u9ed8\u8ba4\u884c\u4e3a\u3002boot.img\u5728\u7b2c\u4e00\u9636\u6bb5\u4f9d\u7136\u505a\u4e3a\u6839\u6587\u4ef6\u7cfb\u7edf\u52a0\u8f7d\uff0c\u4e4b\u540e\u6267\u884c\/init\u5c06system.img\u52a0\u8f7d\u5230\/system\u4e0a\u3002\u7136\u540e\u6267\u884c\u5207\u6362\u6839\u64cd\u4f5c\u5c06\u88c5\u8f7d\u4ece \/system \u79fb\u52a8\u5230 \/\uff0c\u88c5\u8f7d\u5b8c\u6210\u540eramdisk \u7684\u5185\u5bb9\u5c06\u4f1a\u91ca\u653e\u3002<\/strong><\/p>\n<p><img src=\"http:\/\/xinyiworld.top\/wordpress_it\/wp-content\/uploads\/2021\/09\/build_image.png\" alt=\"\" \/><\/p>\n<p>\u5bf9\u4e8esystem\u955c\u50cf\uff0cin_dir\u5219\u4e3abuild_image.py\u5236\u4f5c\u955c\u50cf\u65f6\u4f20\u5165\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\uff1a<code>out\/target\/product\/${project}\/system<\/code>\uff0c<br \/>\n$(systemimage_intermediates)\/system_image_info.txt\u4e2d\u5b9a\u4e49\u7684<code>root_dir=out\/target\/product\/qssi\/root<\/code>\uff0c\u6b64\u65b9\u6cd5\u4f1a\u521b\u5efa\u4e34\u65f6\u6587\u4ef6\u5939in_dir\uff08out\/soong\/.temp\/\u968f\u673a\u751f\u6210\u7684\u6587\u4ef6\u5939\u540d\uff0c\u4e5f\u53ef\u80fd\u662f\u522b\u7684\u76ee\u5f55\uff0c\u5177\u4f53\u662f\u4ec0\u4e48\u673a\u5236\u6ca1\u6709\u592a\u4e86\u89e3\uff09\u5e76\u5c06\u6839\u6587\u4ef6\u7cfb\u7edf\u62f7\u8d1d\u8fc7\u53bb\uff0c\u5e76\u4e14\u5c06system\u590d\u5236\u5230\u6839\u6587\u4ef6\u7cfb\u7edf\u4e0b\u3002<\/p>\n<pre><code class=\"language-python\">165   # Construct a staging directory of the root file system.\n166   in_dir = common.MakeTempDir()\n167   root_dir = prop_dict.get(&quot;root_dir&quot;)\n168   if root_dir:\n169     shutil.rmtree(in_dir)\n170     shutil.copytree(root_dir, in_dir, symlinks=True)\n171   in_dir_system = os.path.join(in_dir, &quot;system&quot;)\n172   shutil.rmtree(in_dir_system, ignore_errors=True)\n173   shutil.copytree(origin_in, in_dir_system, symlinks=True)<\/code><\/pre>\n<p>2) BuildImageMkfs(in_dir, prop_dict, out_file, target_out, fs_config)<br \/>\n\u4f5c\u7528\uff1aBuilds a pure image for the files under in_dir and writes it to out_file<\/p>\n<p><code>mkfs_output = common.RunAndCheckOutput(build_command)<\/code><br \/>\ncommon\u6a21\u5757\u5373<code>build\/make\/tools\/releasetools\/common.py<\/code><br \/>\n\u6267\u884c\u547d\u4ee4\u4f1a\u6253\u5370\u65e5\u5fd7\uff1a<code>common.py - INFO    :   Running:<\/code><\/p>\n<p>\u6700\u7ec8\u4f1a\u8c03\u7528\u5230mkuserimg_mke2fs\u5de5\u5177\uff08\u6e90\u7801\u4f4d\u4e8esystem\/extras\/ext4_utils\uff09\u751f\u6210\u955c\u50cfxx.img<\/p>\n<h2><span class=\"ez-toc-section\" id=\"mkuserimg_mke2fspy%EF%BC%88%E5%88%B6%E4%BD%9C%E9%95%9C%E5%83%8F%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%EF%BC%89\"><\/span>mkuserimg_mke2fs.py\uff08\u5236\u4f5c\u955c\u50cf\u6587\u4ef6\u7cfb\u7edf\uff09<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u6e90\u7801\u4f4d\u7f6e:<code>system\/extras\/ext4_utils<\/code>,\u4f1a\u88ab\u6253\u5305\u5230<code>out\/soong\/host\/linux-x86\/bin\/<\/code>\u76ee\u5f55\u4e0b\u3002<br \/>\nmkuserimg_mke2fs\u53c8\u4f1a\u8c03\u7528\u5230mke2fs\u4e0ee2fsdroid,\u5b83\u4eec\u5c5e\u4e8e\u7b2c\u4e09\u65b9\u5e93\uff0c\u6e90\u7801\u4f4d\u4e8e<code>external\/e2fsprogs<\/code>\uff0c\u6253\u5305\u4f4d\u4e8e<code>out\/soong\/Android-xx.mk<\/code>\uff08xx\u4e3a\u4ea7\u54c1\u540d\uff09\u4e2d.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"add_img_to_target_filespy_%EF%BC%88%E5%B0%86%E9%95%9C%E5%83%8F%E5%86%99%E5%85%A5target_fileszip%E5%8C%85%EF%BC%89\"><\/span>add_img_to_target_files.py \uff08\u5c06\u955c\u50cf\u5199\u5165target_files.zip\u5305\uff09<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u6587\u4ef6\u4f4d\u7f6e\uff1a<code>build\/make\/tools\/releasetools\/add_img_to_target_files.py<\/code><\/p>\n<ul>\n<li>\n<p>AddImagesToTargetFiles<br \/>\n\u4f5c\u7528\uff1aCreates and adds images (boot\/recovery\/system\/...) to a target_files.zip<br \/>\n\u4f9d\u6b21\u8c03\u7528AddXX-&gt;CreateImage\uff0cCreateImage\u4f1a\u8c03\u7528build_image.py\u7684BuildImage\u65b9\u6cd5\u3002<\/p>\n<\/li>\n<li>\n<p>\u76f8\u5173\u65e5\u5fd7<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"language-bash\">++++ xx ++++\n\n2024-02-05 13:39:09 - add_img_to_target_files - INFO    : creating xx.img...<\/code><\/pre>\n<h1><span class=\"ez-toc-section\" id=\"%E4%BA%8C%E3%80%81Android%E7%B3%BB%E7%BB%9F%E9%95%9C%E5%83%8F%E6%96%87%E4%BB%B6%E6%89%93%E5%8C%85%E7%9A%84%E8%BF%87%E7%A8%8B\"><\/span>\u4e8c\u3001Android\u7cfb\u7edf\u955c\u50cf\u6587\u4ef6\u6253\u5305\u7684\u8fc7\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p><a href=\"https:\/\/blog.csdn.net\/luoshengyang\/article\/details\/20501657\">https:\/\/blog.csdn.net\/luoshengyang\/article\/details\/20501657<\/a><br \/>\n<a href=\"https:\/\/blog.csdn.net\/xiaodongzitt\/article\/details\/49952169\">https:\/\/blog.csdn.net\/xiaodongzitt\/article\/details\/49952169<\/a><br \/>\n<a href=\"https:\/\/blog.csdn.net\/yiranfeng\/article\/details\/109084552\">https:\/\/blog.csdn.net\/yiranfeng\/article\/details\/109084552<\/a><\/p>\n<p>\u4ee5android10\u6e90\u7801\u4e3a\u4f8b<br \/>\nmake\u6267\u884c\u9ed8\u8ba4\u76ee\u6807<\/p>\n<pre><code class=\"language-bash\">  39 # This is the default target.  It must be the first declared target.\n  40 .PHONY: droid\n  41 DEFAULT_GOAL := droid\n  42 $(DEFAULT_GOAL): droid_targets\n  43 \n  44 .PHONY: droid_targets\n  45 droid_targets:<\/code><\/pre>\n<p>droid_targets\u5728\u67d0\u4e9b\u6761\u4ef6\u4e0b\u53ef\u80fd\u4f1a\u88ab\u91cd\u5199\uff0c\u9ed8\u8ba4\u5982\u4e0b\uff1a<br \/>\n\u2193<\/p>\n<pre><code class=\"language-bash\">1811 # Building a full system-- the default is to build droidcore\n1812 droid_targets: droidcore dist_files<\/code><\/pre>\n<p>\u2193<br \/>\n<strong>1\uff09\u76ee\u6807droidcore<\/strong><br \/>\n\u4f5c\u7528\uff1aBuild files and then package it into the rom formats<\/p>\n<pre><code class=\"language-bash\">1631 # Build files and then package it into the rom formats\n1632 .PHONY: droidcore\n1633 droidcore: $(filter $(HOST_OUT_ROOT)\/%,$(modules_to_install)) \\\n1634     $(INSTALLED_SYSTEMIMAGE_TARGET) \\\n1635     $(INSTALLED_RAMDISK_TARGET) \\\n1636     $(INSTALLED_BOOTIMAGE_TARGET) \\\n1637     $(INSTALLED_DEBUG_RAMDISK_TARGET) \\\n1638     $(INSTALLED_DEBUG_BOOTIMAGE_TARGET) \\\n1639     $(INSTALLED_RECOVERYIMAGE_TARGET) \\\n1640     $(INSTALLED_VBMETAIMAGE_TARGET) \\\n1641     $(INSTALLED_USERDATAIMAGE_TARGET) \\\n1642     $(INSTALLED_CACHEIMAGE_TARGET) \\\n1643     $(INSTALLED_BPTIMAGE_TARGET) \\\n1644     $(INSTALLED_VENDORIMAGE_TARGET) \\\n1645     $(INSTALLED_ODMIMAGE_TARGET) \\\n1646     $(INSTALLED_SUPERIMAGE_EMPTY_TARGET) \\\n1647     $(INSTALLED_PRODUCTIMAGE_TARGET) \\\n1648     $(INSTALLED_SYSTEMOTHERIMAGE_TARGET) \\\n1649     $(INSTALLED_FILES_FILE) \\\n1650     $(INSTALLED_FILES_JSON) \\\n1651     $(INSTALLED_FILES_FILE_VENDOR) \\\n1652     $(INSTALLED_FILES_JSON_VENDOR) \\\n1653     $(INSTALLED_FILES_FILE_ODM) \\\n1654     $(INSTALLED_FILES_JSON_ODM) \\\n1655     $(INSTALLED_FILES_FILE_PRODUCT) \\\n1656     $(INSTALLED_FILES_JSON_PRODUCT) \\\n1657     $(INSTALLED_FILES_FILE_PRODUCT_SERVICES) \\\n1658     $(INSTALLED_FILES_JSON_PRODUCT_SERVICES) \\\n1659     $(INSTALLED_FILES_FILE_SYSTEMOTHER) \\\n1660     $(INSTALLED_FILES_JSON_SYSTEMOTHER) \\\n1661     $(INSTALLED_FILES_FILE_RAMDISK) \\\n1662     $(INSTALLED_FILES_JSON_RAMDISK) \\\n1663     $(INSTALLED_FILES_FILE_DEBUG_RAMDISK) \\\n1664     $(INSTALLED_FILES_JSON_DEBUG_RAMDISK) \\\n1665     $(INSTALLED_FILES_FILE_ROOT) \\\n1666     $(INSTALLED_FILES_JSON_ROOT) \\\n1667     $(INSTALLED_FILES_FILE_RECOVERY) \\\n1668     $(INSTALLED_FILES_JSON_RECOVERY) \\\n1669     $(INSTALLED_ANDROID_INFO_TXT_TARGET) \\\n1670     auxiliary \\\n1671     soong_docs<\/code><\/pre>\n<p><strong>2\uff09\u76ee\u6807dist_files<\/strong><\/p>\n<blockquote>\n<p>\u91cd\u8981\u89c4\u5f8b\uff1a<br \/>\n1.\u5f88\u591a\u76ee\u6807\u90fd\u662f\u7528\u53d8\u91cf\u8868\u793a\u7684<br \/>\n2.\u67d0\u4e9b\u65e5\u5fd7\u6ca1\u6709\u6253\u5370\uff0c\u53ef\u80fd\u7684\u539f\u56e0\u662f\u8fd9\u4e9b\u65e5\u5fd7\u76f8\u5173\u7684\u76ee\u6807\u6ca1\u6709\u53d8\u5316\uff0c\u5c31\u4e0d\u4f1a\u91cd\u65b0\u751f\u6210\u3002<\/p>\n<\/blockquote>\n<h2><span class=\"ez-toc-section\" id=\"%E4%B8%80%E3%80%81%E5%90%84%E4%B8%AAimg%E9%95%9C%E5%83%8F%E7%9A%84%E6%9E%84%E5%BB%BA%E8%BF%87%E7%A8%8B%E5%8F%8A%E8%AF%B4%E6%98%8E\"><\/span>\u4e00\u3001\u5404\u4e2a.img\u955c\u50cf\u7684\u6784\u5efa\u8fc7\u7a0b\u53ca\u8bf4\u660e<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1%E6%A0%B9%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E7%9A%84%E5%88%B6%E4%BD%9C\"><\/span>1.\u6839\u6587\u4ef6\u7cfb\u7edf\u7684\u5236\u4f5c<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u89c1<code>system\/core\/rootdir<\/code>\u4e0b\u7684Android.mk\uff0c\u4e3b\u8981\u662f\u5c06rootdir\u4e0b\u7684\u6587\u4ef6\u590d\u5236\u5230<code>out\/target\/product\/\u4ea7\u54c1\u540d\/root<\/code>\u4e0b\uff0c\u6700\u540e\u5236\u4f5csystem\u955c\u50cf\u65f6\u88ab\u4e00\u8d77\u6253\u5305\u5230system.img\u4e2d\u3002<br \/>\n<a href=\"https:\/\/blog.csdn.net\/ldswfun\/article\/details\/120933632\">https:\/\/blog.csdn.net\/ldswfun\/article\/details\/120933632<\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"2systemimg\"><\/span>2.system.img<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"https:\/\/blog.csdn.net\/Thanksgining\/article\/details\/83374493\">https:\/\/blog.csdn.net\/Thanksgining\/article\/details\/83374493<\/a><br \/>\n<a href=\"https:\/\/blog.csdn.net\/Thanksgining\/article\/details\/83417531\">https:\/\/blog.csdn.net\/Thanksgining\/article\/details\/83417531<\/a><br \/>\n<a href=\"https:\/\/blog.csdn.net\/mingmigndfds\/article\/details\/135084594\">https:\/\/blog.csdn.net\/mingmigndfds\/article\/details\/135084594<\/a><\/p>\n<h4><span class=\"ez-toc-section\" id=\"%E5%85%B7%E4%BD%93%E6%9E%84%E5%BB%BA%E8%BF%87%E7%A8%8B\"><\/span>\u5177\u4f53\u6784\u5efa\u8fc7\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>system.img\u5bf9\u5e94INSTALLED_SYSTEMIMAGE_TARGET\u76ee\u6807\uff0c\u641c\u7d22\u53d1\u73b0<strong>\u76ee\u6807<\/strong>INSTALLED_SYSTEMIMAGE_TARGET\u4f4d\u4e8e<code>make\/core\/Makefile<\/code><\/p>\n<pre><code class=\"language-bash\">2289 $(INSTALLED_SYSTEMIMAGE_TARGET): $(BUILT_SYSTEMIMAGE) $(RECOVERY_FROM_BOOT_PATCH)\n2290         @echo &quot;Install system fs image: $@&quot;\n2291         $(copy-file-to-target)\n2292         $(hide) $(call assert-max-image-size,$@ $(RECOVERY_FROM_BOOT_PATCH),$(BOARD_SYSTEMIMAGE_PARTITION_SIZE))\n2293 \n2294 systemimage: $(INSTALLED_SYSTEMIMAGE_TARGET)<\/code><\/pre>\n<p>\u76ee\u6807INSTALLED_SYSTEMIMAGE_TARGET\u5bf9\u5e94\u540c\u540d\u53d8\u91cf\uff1a<br \/>\n\u5b9a\u4e49\u4e8e<code>make\/core\/Makefile:2253:INSTALLED_SYSTEMIMAGE_TARGET := $(PRODUCT_OUT)\/system.img<\/code><\/p>\n<p>\u4e5f\u5c31\u662f\u8bf4<code>$(PRODUCT_OUT)\/system.img<\/code>\u4f9d\u8d56\u4e8e<code>$(BUILT_SYSTEMIMAGE)<\/code> \u548c<code>$(RECOVERY_FROM_BOOT_PATCH)<\/code><br \/>\n<strong>1\uff09\u76ee\u6807 $(BUILT_SYSTEMIMAGE)<\/strong><br \/>\nBUILT_SYSTEMIMAGE := $(systemimage_intermediates)\/system.img<\/p>\n<pre><code class=\"language-bash\">2250 $(BUILT_SYSTEMIMAGE): $(FULL_SYSTEMIMAGE_DEPS) $(INSTALLED_FILES_FILE) $(BUILD_IMAGE_SRCS)\n2251         $(call build-systemimage-target,$@)<\/code><\/pre>\n<p><strong>\u4f9d\u8d56\u7684\u76ee\u6807\uff1a<\/strong><\/p>\n<ul>\n<li><strong>1-1\uff09FULL_SYSTEMIMAGE_DEPS<\/strong><\/li>\n<\/ul>\n<p><code>FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS)<\/code><br \/>\n<strong>$(INTERNAL_USERIMAGES_DEPS)\u76ee\u6807<\/strong><br \/>\n\u4e3b\u8981\u662f\u4e00\u4e9b\u4e0esystem\u955c\u50cf\u76f8\u5173\u7684\u5de5\u5177\u7684\u4f9d\u8d56\uff0c\u5982simg2img\u3002<\/p>\n<p><strong>$(INTERNAL_SYSTEMIMAGE_FILES)\u76ee\u6807<\/strong><\/p>\n<pre><code class=\"language-bash\">2142 INTERNAL_SYSTEMIMAGE_FILES := $(sort $(filter $(TARGET_OUT)\/%, \\\n2143     $(ALL_GENERATED_SOURCES) \\\n2144     $(ALL_DEFAULT_INSTALLED_MODULES) \\\n2145     $(PDK_FUSION_SYSIMG_FILES) \\\n2146     $(RECOVERY_RESOURCE_ZIP)) \\\n2147     $(PDK_FUSION_SYMLINK_STAMP))<\/code><\/pre>\n<p>TARGET_OUT\uff1a\u5373\u4e3aout\/target\/product\/\u4ea7\u54c1\u540d\/system<\/p>\n<p>ALL_GENERATED_SOURCES\uff1a\u63cf\u8ff0\u7684\u662f\u8981\u62f7\u8d1d\u5230\u76ee\u6807\u8bbe\u5907\u4e0a\u53bb\u7684\u7531\u5de5\u5177\u81ea\u52a8\u751f\u6210\u7684\u6e90\u4ee3\u7801\u6587\u4ef6\u3002<\/p>\n<p>ALL_DEFAULT_INSTALLED_MODULES\uff1a\u63cf\u8ff0\u7684\u662f\u6240\u6709\u9700\u8981\u5b89\u88c5\u7684module<\/p>\n<p>PDK_FUSION_SYSIMG_FILES\uff1a\u662f\u4ecePDK(Platform Development Kit)\u63d0\u53d6\u51fa\u6765\u7684\u76f8\u5173\u6587\u4ef6<\/p>\n<p>RECOVERY_RESOURCE_ZIP\uff1a\u63cf\u8ff0\u7684\u662fAndroid\u7684recovery\u7cfb\u7edf\u8981\u4f7f\u7528\u7684\u8d44\u6e90\u6587\u4ef6\uff0c\u5bf9\u5e94\u4e8e\/system\/etc\u76ee\u5f55\u4e0b\u7684recovery-resource.dat\u6587\u4ef6\u3002<\/p>\n<p>PDK_FUSION_SYMLINK_STAMP\uff1aPDK\u7684\u7b26\u53f7\u94fe\u63a5\u6587\u4ef6<\/p>\n<ul>\n<li><strong>1-2\uff09INSTALLED_FILES_FILE<\/strong>\n<pre><code class=\"language-bash\">2169 INSTALLED_FILES_FILE := $(PRODUCT_OUT)\/installed-files.txt\n2170 INSTALLED_FILES_JSON := $(INSTALLED_FILES_FILE:.txt=.json)\n2171 $(INSTALLED_FILES_FILE): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON)\n2172 $(INSTALLED_FILES_FILE): $(FULL_SYSTEMIMAGE_DEPS) $(FILESLIST)\n2173         @echo Installed file list: $@\n2174         @mkdir -p $(dir $@)\n2175         @rm -f $@\n2176         $(hide) $(FILESLIST) $(TARGET_OUT) &gt; $(@:.txt=.json)\n2177         $(hide) build\/make\/tools\/fileslist_util.py -c $(@:.txt=.json) &gt; $@<\/code><\/pre>\n<\/li>\n<\/ul>\n<p><strong>$(FILESLIST)\u76ee\u6807<\/strong><br \/>\nbuild\/make\/core\/config.mk:519:FILESLIST := $(SOONG_HOST_OUT_EXECUTABLES)\/fileslist\uff0cfileslist\u4e3a\u4e8c\u8fdb\u5236\u5de5\u5177\u3002<br \/>\nTARGET_OUT\u5373\u4e3a<code>out\/target\/product\/\u4ea7\u54c1\u540d\/system<\/code><\/p>\n<p><code>$(hide) $(FILESLIST) $(TARGET_OUT) &gt; $(@:.txt=.json)<\/code>\u5373\u662f\u5c06TARGET_OUT\u4e0b\u7684\u5168\u90e8\u6587\u4ef6\u7684sha\u503c\u3001\u8def\u5f84(\u7531system\u5f00\u59cb)\u3001size\u5199\u5165\u5230installed-files.json\u6587\u4ef6\u4e2d\u3002<br \/>\n<code>$(hide) build\/make\/tools\/fileslist_util.py -c $(@:.txt=.json) &gt; $@<\/code>\u5373\u662f\u5c06installed-files.json\u91cc\u7684\u683c\u5f0f\u8f6c\u6362\u6210installed-files.txt<\/p>\n<p><strong>$(FULL_SYSTEMIMAGE_DEPS)\u76ee\u6807<\/strong>\uff0c\u4e0a\u9762\u6709\u4f5c\u8bf4\u660e\u3002<\/p>\n<ul>\n<li><strong>1-3\uff09BUILD_IMAGE_SRCS<\/strong><br \/>\nbuild\/make\/core\/config.mk:600:BUILD_IMAGE_SRCS := $(wildcard build\/make\/tools\/releasetools\/*.py)<\/li>\n<\/ul>\n<p><strong>\u5f00\u59cb\u6253\u5305\u955c\u50cf\uff1a<\/strong><br \/>\n$(systemimage_intermediates)\/system.img\u5373\u662f\u901a\u8fc7<strong>build-systemimage-target<\/strong>\u51fd\u6570\uff08\u5b9a\u4e49\u5728make\/core\/Makefile\u4e2d\uff09\u751f\u6210\u7684\uff0c\u4f1a\u6253\u5370\u65e5\u5fd7\uff1a<code>Target system fs image<\/code><\/p>\n<p><strong>build-systemimage-target<\/strong>\u51fd\u6570\u5b9a\u4e49\uff1a<\/p>\n<pre><code class=\"language-bash\">2233 # $(1): output file\n2234 define build-systemimage-target\n2235   @echo &quot;Target system fs image: $(1)&quot;\n2236   $(call create-system-vendor-symlink)\n2237   $(call create-system-product-symlink)\n2238   $(call create-system-product_services-symlink)\n2239   $(call check-apex-libs-absence-on-disk)\n2240   @mkdir -p $(dir $(1)) $(systemimage_intermediates) &amp;&amp; rm -rf $(systemimage_intermediates)\/system_image_info.txt\n2241   $(call generate-image-prop-dictionary, $(systemimage_intermediates)\/system_image_info.txt,system, \\\n2242       skip_fsck=true)\n2243   $(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH \\\n2244       build\/make\/tools\/releasetools\/build_image.py \\\n2245       $(TARGET_OUT) $(systemimage_intermediates)\/system_image_info.txt $(1) $(TARGET_OUT) \\\n2246       || ( mkdir -p $${DIST_DIR}; cp $(INSTALLED_FILES_FILE) $${DIST_DIR}\/installed-files-rescued.txt; \\\n2247            exit 1 )\n2248 endef<\/code><\/pre>\n<p>build-systemimage-target\u51fd\u6570\u4f1a\u8c03\u7528<strong><code>build_image.py<\/code><\/strong>\u6765\u7f16\u8bd1\u955c\u50cf\uff0c\u65e5\u5fd7\u6709\u65f6\u6ca1\u6709\u8c03\u7528build_image.py\u662f\u4ec0\u4e48\u60c5\u51b5\uff1f\uff08TODO\uff09<\/p>\n<pre><code class=\"language-bash\">\u53c2\u6570$(1)\uff1aout\/target\/product\/${project}\/system\n\u53c2\u6570$(2)\uff1a$(systemimage_intermediates)\/system_image_info.txt   \/\/\u8bb0\u5f55\u4e86\u955c\u50cf\u6587\u4ef6\u7cfb\u7edf\u683c\u5f0f\u3001ext\u6587\u4ef6\u7cfb\u7edf\u5236\u4f5c\u5de5\u5177\u7b49\u5185\u5bb9\n\u53c2\u6570$(3)\uff1a$(systemimage_intermediates)\/system.img\n\u53c2\u6570$(4)\uff1aout\/target\/product\/${project}\/system<\/code><\/pre>\n<p><strong>2\uff09\u76ee\u6807 $(RECOVERY_FROM_BOOT_PATCH)<\/strong><br \/>\n\u5728\u8bbe\u5907\u4e0a\uff0c\u53ef\u4ee5\u901a\u8fc7boot.img\u548crecovery_from_boot.p\u6587\u4ef6\u751f\u6210\u4e00\u4e2arecovery.img\u6587\u4ef6\uff0c\u4f7f\u5f97\u8bbe\u5907\u53ef\u4ee5\u8fdb\u5165recovery\u6a21\u5f0f\u3002<\/p>\n<p><strong>3\uff09\u52a8\u4f5c copy-file-to-target<\/strong><br \/>\n\u4f1a\u521b\u5efa\/out\/target\/product\/xxx\/\u76ee\u5f55\uff0c\u5176\u4e2dxxx\u662f\u4ea7\u54c1\u540d\uff0c\u7136\u540e\u628a(BUILT_SYSTEMIMAGE)\u53d8\u91cf\u6240\u4ee3\u8868\u7684\u6587\u4ef6\u76f4\u63a5\u62f7\u8d1d\u8fc7\u6765\u3002\u7ecf\u6bd4\u8f83\uff0c\u4e24\u8005md5\u786e\u5b9e\u4e00\u81f4\u3002<br \/>\n<img src=\"http:\/\/xinyiworld.top\/wordpress_it\/wp-content\/uploads\/2021\/09\/md5.png\" alt=\"\" \/><\/p>\n<h4><span class=\"ez-toc-section\" id=\"%E6%9E%84%E5%BB%BA%E6%97%A5%E5%BF%97\"><\/span>\u6784\u5efa\u65e5\u5fd7<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u4ee5\u4e0a\u6784\u5efa\u8fc7\u7a0b\u4f1a\u5bf9\u5e94\u4e24\u6761\u975e\u5e38\u91cd\u8981\u7684\u65e5\u5fd7\uff1a<\/p>\n<pre><code class=\"language-bash\">[ 99% 30426\/30429] Target system fs image: out\/target\/product\/qssi\/obj\/PACKAGING\/systemimage_intermediates\/system.img\n[ 99% 30427\/30429] Install system fs image: out\/target\/product\/qssi\/system.img<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"3ramdiskimg%E6%9C%80%E5%B0%8F%E6%A0%B9%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F\"><\/span>3.ramdisk.img(\u6700\u5c0f\u6839\u6587\u4ef6\u7cfb\u7edf)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"https:\/\/blog.csdn.net\/yangjizhen1533\/article\/details\/113573468\">https:\/\/blog.csdn.net\/yangjizhen1533\/article\/details\/113573468<\/a><\/p>\n<pre><code class=\"language-bash\"> 892 BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)\/ramdisk.img\n 893 \n 894 # We just build this directly to the install location.\n 895 INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET)\n 896 $(INSTALLED_RAMDISK_TARGET): $(MKBOOTFS) $(INTERNAL_RAMDISK_FILES) $(INSTALLED_FILES_FILE_RAMDISK) | $(MINIGZIP)\n 897         $(call pretty,&quot;Target ram disk: $@&quot;)\n 898         $(hide) $(MKBOOTFS) -d $(TARGET_OUT) $(TARGET_RAMDISK_OUT) | $(MINIGZIP) &gt; $@<\/code><\/pre>\n<p><strong>1\uff09\u76ee\u6807 $(MKBOOTFS)<\/strong><br \/>\nbuild\/make\/core\/config.mk:554:MKBOOTFS := $(HOST_OUT_EXECUTABLES)\/mkbootfs$(HOST_EXECUTABLE_SUFFIX)<br \/>\nbuild\/make\/core\/envsetup.mk:325:HOST_OUT_EXECUTABLES := $(HOST_OUT)\/bin<br \/>\n$(MKBOOTFS)\u5373<code>out\/host\/linux-x86\/bin\/mkbootfs<\/code>,\u6e90\u7801\u4f4d\u4e8e<code>system\/core\/cpio\/mkbootfs.c<\/code><\/p>\n<p><strong>2\uff09\u76ee\u6807 $(INTERNAL_RAMDISK_FILES)<\/strong><\/p>\n<pre><code class=\"language-bash\"> 876 INTERNAL_RAMDISK_FILES := $(filter $(TARGET_RAMDISK_OUT)\/%, \\\n 877         $(ALL_GENERATED_SOURCES) \\\n 878         $(ALL_DEFAULT_INSTALLED_MODULES))<\/code><\/pre>\n<p><code>build\/make\/core\/envsetup.mk:843:TARGET_RAMDISK_OUT := $(PRODUCT_OUT)\/$(TARGET_COPY_OUT_RAMDISK)<\/code>\uff0c\u5373<code>out\/target\/product\/qssi\/ramdisk<\/code>\u76ee\u5f55\u3002<br \/>\n\u5176\u5b83\u7684\u4e24\u4e2a\u4f9d\u8d56\u6682\u65f6\u5c31\u4e0d\u53bb\u7814\u7a76\u4e86<br \/>\n<strong>3\uff09\u76ee\u6807 $(INSTALLED_FILES_FILE_RAMDISK)<\/strong><br \/>\nINSTALLED_FILES_FILE_RAMDISK := $(PRODUCT_OUT)\/installed-files-ramdisk.txt<\/p>\n<pre><code class=\"language-bash\"> 882 $(INSTALLED_FILES_FILE_RAMDISK): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_RAMDISK)\n 883 $(INSTALLED_FILES_FILE_RAMDISK) : $(INTERNAL_RAMDISK_FILES) $(FILESLIST)\n 884         @echo Installed file list: $@\n 885         @mkdir -p $(TARGET_RAMDISK_OUT)\n 886         @mkdir -p $(dir $@)\n 887         @rm -f $@\n 888         $(hide) $(FILESLIST) $(TARGET_RAMDISK_OUT) &gt; $(@:.txt=.json)\n 889         $(hide) build\/make\/tools\/fileslist_util.py -c $(@:.txt=.json) &gt; $@<\/code><\/pre>\n<p>\u8fd9\u4e2a\u53ef\u4ee5\u501f\u9274syste.img\u7684\u751f\u6210\uff0c\u7c7b\u4f3c\u3002<br \/>\n<strong>3\uff09\u76ee\u6807 $(MINIGZIP)<\/strong><br \/>\nbuild\/make\/core\/config.mk:555:MINIGZIP := $(HOST_OUT_EXECUTABLES)\/minigzip$(HOST_EXECUTABLE_SUFFIX)<br \/>\n\u5373<code>out\/host\/linux-x86\/bin\/minigzip<\/code>,\u6e90\u7801\u4f4d\u4e8e<code>\/external\/zlib<\/code><br \/>\nminigzip\u4ecb\u7ecd\uff1a<br \/>\n<a href=\"https:\/\/www.cnblogs.com\/pengdonglin137\/p\/10468556.html\">https:\/\/www.cnblogs.com\/pengdonglin137\/p\/10468556.html<\/a><\/p>\n<h3><span class=\"ez-toc-section\" id=\"4bootimg\"><\/span>4.boot.img<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"https:\/\/blog.csdn.net\/weixin_42135087\/article\/details\/103384825\">https:\/\/blog.csdn.net\/weixin_42135087\/article\/details\/103384825<\/a><\/p>\n<p>912 BUILT_BOOTIMAGE_TARGET := $(PRODUCT_OUT)\/boot.img<br \/>\n955 INSTALLED_BOOTIMAGE_TARGET := $(BUILT_BOOTIMAGE_TARGET)<br \/>\nINSTALLED_BOOTIMAGE_TARGET := $(BUILT_BOOTIMAGE_TARGET)<\/p>\n<pre><code class=\"language-bash\"> $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(INTERNAL_BOOTIMAGE_FILES) $(BOARD_AVB_BOOT_KEY_PATH)\n 963         $(call pretty,&quot;Target boot image: $@&quot;)\n 964         $(hide) $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@\n 965         $(hide) $(call assert-max-image-size,$@,$(call get-hash-image-max-size,$(BOARD_BOOTIMAGE_PARTITION_SIZE)))\n 966         $(hide) $(AVBTOOL) add_hash_footer \\\n 967           --image $@ \\\n 968           --partition_size $(BOARD_BOOTIMAGE_PARTITION_SIZE) \\\n 969           --partition_name boot $(INTERNAL_AVB_BOOT_SIGNING_ARGS) \\\n 970           $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)<\/code><\/pre>\n<p><strong>1)\u76ee\u6807$(MKBOOTIMG)<\/strong><br \/>\nbuild\/make\/core\/config.mk:558:MKBOOTIMG := $(HOST_OUT_EXECUTABLES)\/mkbootimg$(HOST_EXECUTABLE_SUFFIX)<br \/>\n\u5373<code>out\/host\/linux-x86\/bin\/mkbootimg<\/code>\uff0cboot\u955c\u50cf\u7684\u5236\u4f5c\u5de5\u5177\u3002<br \/>\n<strong>2)\u76ee\u6807$(AVBTOOL)<\/strong><br \/>\nbuild\/make\/core\/config.mk:568:AVBTOOL := $(HOST_OUT_EXECUTABLES)\/avbtool$(HOST_EXECUTABLE_SUFFIX)<br \/>\n\u5373<code>out\/host\/linux-x86\/bin\/avbtool<\/code>\uff0c<\/p>\n<p>avbtool\u4ecb\u7ecd\uff1a<a href=\"https:\/\/blog.csdn.net\/u010164190\/article\/details\/136532158?spm=1001.2014.3001.5501\">https:\/\/blog.csdn.net\/u010164190\/article\/details\/136532158?spm=1001.2014.3001.5501<\/a><br \/>\nAVB\u6821\u9a8c\uff1a<a href=\"https:\/\/blog.csdn.net\/weixin_45264425\/article\/details\/128039053\">https:\/\/blog.csdn.net\/weixin_45264425\/article\/details\/128039053<\/a><br \/>\n<strong>3)\u76ee\u6807$(INTERNAL_BOOTIMAGE_FILES)<\/strong><br \/>\n927 INTERNAL_BOOTIMAGE_FILES := $(filter-out --%,$(INTERNAL_BOOTIMAGE_ARGS))<br \/>\n\u4e0a\u9762\u8fd9\u4e2a\u51fd\u6570\u975e\u5e38\u5de7\u5999\uff0c\u4ece\u53c2\u6570\u4e2d\u53bb\u9664<code>--%<\/code>\uff0c\u5269\u4e0b\u7684\u5c31\u662f\u76f8\u5173\u7684\u6587\u4ef6\u4e86\u3002\u540e\u9762\u4f1a\u7ee7\u7eed\u7ed9INTERNAL_BOOTIMAGE_ARGS\u53d8\u91cf\u8ffd\u52a0\u53c2\u6570<br \/>\n<strong>3-1)\u76ee\u6807INTERNAL_BOOTIMAGE_ARGS<\/strong><br \/>\n\u662f\u5236\u4f5cboot.img\u6240\u9700\u7684\u53c2\u6570<\/p>\n<pre><code class=\"language-bash\"> 914 ifneq ($(strip $(TARGET_NO_KERNEL)),true)\n 915 INTERNAL_BOOTIMAGE_ARGS := \\\n 916         $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \\\n 917         --kernel $(INSTALLED_KERNEL_TARGET)\n 918 \n 919 ifdef BOARD_INCLUDE_DTB_IN_BOOTIMG\n 920   INTERNAL_BOOTIMAGE_ARGS += --dtb $(INSTALLED_DTBIMAGE_TARGET)\n 921 endif\n 922 \n 923 ifneq ($(BOARD_BUILD_SYSTEM_ROOT_IMAGE),true)\n 924 INTERNAL_BOOTIMAGE_ARGS += --ramdisk $(INSTALLED_RAMDISK_TARGET)\n 925 endif<\/code><\/pre>\n<p><strong>4)\u76ee\u6807$(BOARD_AVB_BOOT_KEY_PATH)<\/strong><br \/>\nTODO<\/p>\n<p><strong>5)\u6267\u884c\u6253\u5305\u547d\u4ee4<\/strong><br \/>\nboot.img\u5236\u4f5c\u65e5\u5fd7(add image to target\u7684\u65e5\u5fd7\uff0c\u4e0d\u662f\u9996\u7f16\u751f\u6210boot.img\u7684\u65e5\u5fd7\u3002)\uff1a<\/p>\n<pre><code class=\"language-bash\">++++ boot ++++\n\n2024-02-05 11:10:41 - common.py - INFO    : building image from target_files BOOT...\n2024-02-05 11:10:41 - common.py - INFO    :   Running: &quot;mkbootfs -f \/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/PACKAGING\/target_files_intermediates\/qssi-target_files-eng.root\/META\/boot_filesystem_config.txt \/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/PACKAGING\/target_files_intermediates\/qssi-target_files-eng.root\/BOOT\/RAMDISK&quot;\n2024-02-05 11:10:41 - common.py - INFO    :   Running: &quot;minigzip&quot;\n2024-02-05 11:10:41 - common.py - INFO    :   Running: &quot;out\/host\/linux-x86\/bin\/mkbootimg --kernel \/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/PACKAGING\/target_files_intermediates\/qssi-target_files-eng.root\/BOOT\/kernel --dtb \/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/PACKAGING\/target_files_intermediates\/qssi-target_files-eng.root\/BOOT\/dtb --cmdline console=ttyMSM0,115200n8 earlycon=msm_geni_serial,0xa90000 androidboot.hardware=qcom androidboot.console=ttyMSM0 androidboot.memcg=1 lpm_levels.sleep_disabled=1 video=vfb:640x400,bpp=32,memsize=3072000 msm_rtb.filter=0x237 service_locator.enable=1 swiotlb=2048 loop.max_part=7 androidboot.usbcontroller=a600000.dwc3 buildvariant=userdebug --base 0x00000000 --pagesize 4096 --header_version 2 --os_version 10 --os_patch_level 2020-08-05 --ramdisk \/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/soong\/.temp\/tmpRfujAB --output \/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/soong\/.temp\/tmpz1mcIo&quot;\n2024-02-05 11:10:42 - common.py - INFO    : \n2024-02-05 11:10:42 - common.py - INFO    :   Running: &quot;avbtool add_hash_footer --image \/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/soong\/.temp\/tmpz1mcIo --partition_size 100663296 --partition_name boot --prop com.android.build.boot.os_version:10 --prop com.android.build.boot.security_patch:2020-08-05 --prop com.android.build.boot.security_patch:2020-08-05&quot;\n2024-02-05 11:10:42 - common.py - INFO    : \n2024-02-05 11:10:43 - add_img_to_target_files - INFO    : <\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"4-1kernel%E7%9A%84%E7%94%9F%E6%88%90%E8%BF%87%E7%A8%8B\"><\/span>4-1)kernel\u7684\u751f\u6210\u8fc7\u7a0b<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u4ee5qssi\u4ea7\u54c1\u4e3a\u4f8b<\/p>\n<h5><span class=\"ez-toc-section\" id=\"%E5%86%85%E6%A0%B8%E6%9E%84%E5%BB%BA%E8%84%9A%E6%9C%AC\"><\/span>\u5185\u6838\u6784\u5efa\u811a\u672c<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p><code>device\/qcom\/kernelscripts\/buildkernel.sh<\/code><\/p>\n<p>\u811a\u672c\u76f8\u5173\u53d8\u91cf\uff1a<\/p>\n<p><img src=\"http:\/\/xinyiworld.top\/wordpress_it\/wp-content\/uploads\/2021\/09\/makekernel.png\" alt=\"\" \/><\/p>\n<p>\u6839\u636e<code>device\/qcom\/kernelscripts\/kernel_definitions.mk<\/code>\uff0c<code>build out\/target\/product\/qssi\/obj\/kernel\/msm-4.19\/usr<\/code>\u4f1a\u8d70\u4e0a\u9762\u7684if\u6d41\u7a0b\uff0c\u6ca1\u6709\u8c03\u7528<code>build_kernel<\/code>\u65b9\u6cd5(\u901a\u8fc7\u641c\u7d22\u5173\u952e\u7b26\u53f7<code>======================<\/code>\u53ef\u4ee5\u533a\u5206)\u3002<\/p>\n<h6><span class=\"ez-toc-section\" id=\"1make_defconfig%E6%96%B9%E6%B3%95%E6%A0%B9%E6%8D%AE%E5%86%85%E6%A0%B8%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E7%94%9F%E6%88%90config%E6%96%87%E4%BB%B6\"><\/span>1.make_defconfig\u65b9\u6cd5(\u6839\u636e\u5185\u6838\u914d\u7f6e\u6587\u4ef6\u751f\u6210.config\u6587\u4ef6)<span class=\"ez-toc-section-end\"><\/span><\/h6>\n<pre><code class=\"language-bash\"> 53 make_defconfig()\n 54 {\n 55         if [ -z &quot;${SKIP_DEFCONFIG}&quot; ] ; then\n 56                 echo &quot;======================&quot;\n 57                 echo &quot;Building defconfig&quot;\n 58                 set -x\n 59                 (cd ${KERNEL_DIR} &amp;&amp; \\\n 60                 make O=${OUT_DIR} ${MAKE_ARGS} HOSTCFLAGS=&quot;${TARGET_INCLUDES}&quot; HOSTLDFLAGS=&quot;${TARGET_LINCLUDES}&quot; ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} ${DEFCONFIG})\n 61                 set +x\n 62         fi\n 63 }\n\ncd kernel\/msm-4.19\n#make\u547d\u4ee4\u53c2\u6570\u683c\u5f0f\u5316\nmake \n##\u6307\u5b9amake\u7684\u8f93\u51fa\u76ee\u5f55\nO=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/kernel\/msm-4.19 \nREAL_CC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/vendor\/qcom\/proprietary\/llvm-arm-toolchain-ship\/8.0\/bin\/clang \nCLANG_TRIPLE=aarch64-linux-gnu- \nDTC_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/dtc \nDTC_OVERLAY_TEST_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/ufdt_apply_overlay \nCONFIG_BUILD_ARM64_DT_OVERLAY=y HOSTCC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-gcc\n HOSTAR=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ar \n HOSTLD=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ld &#039;HOSTCFLAGS=-I\/home\/xinyi\/code\/sg865\/sg865w_android10\/kernel\/msm-4.19\/include\/uapi -I\/usr\/include -I\/usr\/include\/x86_64-linux-gnu -L\/usr\/lib -L\/usr\/lib\/x86_64-linux-gnu&#039; &#039;HOSTLDFLAGS=-L\/usr\/lib -L\/usr\/lib\/x86_64-linux-gnu&#039; \n ARCH=arm64 \n CROSS_COMPILE=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/aarch64\/aarch64-linux-android-4.9\/bin\/aarch64-linux-androidkernel- \n##make\u7684\u76ee\u6807\n vendor\/kona_defconfig<\/code><\/pre>\n<p>\u5206\u6790\u4e00\u4e0b\u5404\u4e2a\u53d8\u91cf\u662f\u5728\u54ea\u91cc\u5b9a\u4e49\u7684\uff08\u5927\u591a\u6570\u90fd\u662f\u5728<code>device\/qcom\/kernelscripts\/kernel_definitions.mk<\/code>\u4e2d\u5b9a\u4e49\u7684\uff09\uff1a<\/p>\n<ul>\n<li>DEFCONFIG<br \/>\n\u5728kernel_definitions.mk\u4e2d\u5b9a\u4e49\uff0c\u4e3aKERNEL_DEFCONFIG\u3002KERNEL_DEFCONFIG\u5728<code>device\/qcom\/qssi\/BoardConfig.mk<\/code>\u4e2d\u5b9a\u4e49\u8d4b\u503c<\/p>\n<pre><code class=\"language-bash\">device\/qcom\/qssi\/BoardConfig.mk:93:KERNEL_DEFCONFIG := kona_defconfig\ndevice\/qcom\/qssi\/BoardConfig.mk:95:KERNEL_DEFCONFIG := vendor\/$(KERNEL_DEFCONFIG)<\/code><\/pre>\n<\/li>\n<\/ul>\n<h6><span class=\"ez-toc-section\" id=\"2headers_install%E5%A4%8D%E5%88%B6%E5%86%85%E6%A0%B8%E6%BA%90%E7%A0%81%E4%B8%8B%E7%9A%84%E5%A4%B4%E6%96%87%E4%BB%B6%E5%88%B0%E5%86%85%E6%A0%B8%E7%BC%96%E8%AF%91%E8%BE%93%E5%87%BA%E7%9B%AE%E5%BD%95%E4%B8%8B%E7%9A%84usrinclude%E7%9B%AE%E5%BD%95\"><\/span>2.headers_install(\u590d\u5236\u5185\u6838\u6e90\u7801\u4e0b\u7684\u5934\u6587\u4ef6\u5230\u5185\u6838\u7f16\u8bd1\u8f93\u51fa\u76ee\u5f55\u4e0b\u7684\/usr\/include\u76ee\u5f55)<span class=\"ez-toc-section-end\"><\/span><\/h6>\n<pre><code class=\"language-bash\"> 66 headers_install()\n 67 {\n 68         echo &quot;======================&quot;\n 69         echo &quot;Installing kernel headers&quot;\n 70         set -x\n 71         (cd ${OUT_DIR} &amp;&amp; \\\n 72         make HOSTCFLAGS=&quot;${TARGET_INCLUDES}&quot; HOSTLDFLAGS=&quot;${TARGET_LINCLUDES}&quot; ARCH=${ARCH} C    ROSS_COMPILE=${CROSS_COMPILE} O=${OUT_DIR} ${CC_ARG} ${MAKE_ARGS} headers_install)\n 73         set +x\n 74 }\n\ncd \/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/kernel\/msm-4.19\n#make\u547d\u4ee4\u683c\u5f0f\u5316\nmake \n&#039;HOSTCFLAGS=-I\/home\/xinyi\/code\/sg865\/sg865w_android10\/kernel\/msm-4.19\/include\/uapi -I\/usr\/include -I\/usr\/include\/x86_64-linux-gnu -L\/usr\/lib -L\/usr\/lib\/x86_64-linux-gnu&#039; \n&#039;HOSTLDFLAGS=-L\/usr\/lib -L\/usr\/lib\/x86_64-linux-gnu&#039; \nARCH=arm64 \nCROSS_COMPILE=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/aarch64\/aarch64-linux-android-4.9\/bin\/aarch64-linux-androidkernel- \nO=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/kernel\/msm-4.19 \nREAL_CC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/vendor\/qcom\/proprietary\/llvm-arm-toolchain-ship\/8.0\/bin\/clang \nCLANG_TRIPLE=aarch64-linux-gnu- DTC_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/dtc \nDTC_OVERLAY_TEST_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/ufdt_apply_overlay \nCONFIG_BUILD_ARM64_DT_OVERLAY=y HOSTCC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-gcc \nHOSTAR=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ar \nHOSTLD=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ld \nheaders_install\n<\/code><\/pre>\n<h6><span class=\"ez-toc-section\" id=\"3build_kernel%E6%9E%84%E5%BB%BA%E5%86%85%E6%A0%B8\"><\/span>3.build_kernel(\u6784\u5efa\u5185\u6838)<span class=\"ez-toc-section-end\"><\/span><\/h6>\n<pre><code class=\"language-bash\"> 77 build_kernel()\n 78 {\n 79         echo &quot;======================&quot;\n 80         echo &quot;Building kernel&quot;\n 81         set -x\n 82         (cd ${OUT_DIR} &amp;&amp; \\\n 83         make ARCH=${ARCH} CROSS_COMPILE=${CROSS_COMPILE} HOSTCFLAGS=&quot;${TARGET_INCLUDES}&quot; HOSTLDFLAGS=&quot;${TARGET_LINCLUDES}&quot; O=${OUT_DIR} ${CC_    ARG} ${MAKE_ARGS} -j$(nproc))\n 84         set +x\n 85 }\n\n#\u4e0a\u9762\u7684make\u6ca1\u6709\u5e26\u4efb\u4f55\u76ee\u6807 <\/code><\/pre>\n<h6><span class=\"ez-toc-section\" id=\"4modules_install%E6%A8%A1%E5%9D%97%E5%AE%89%E8%A3%85\"><\/span>4.modules_install(\u6a21\u5757\u5b89\u88c5)<span class=\"ez-toc-section-end\"><\/span><\/h6>\n<pre><code class=\"language-bash\"> 88 modules_install()\n 89 {\n 90         echo &quot;======================&quot;\n 91         echo &quot;Installing kernel modules&quot;\n 92         rm -rf ${MODULES_STAGING_DIR}\n 93         mkdir -p ${MODULES_STAGING_DIR}\n 94         set -x\n 95         (cd ${OUT_DIR} &amp;&amp; \\\n 96         make O=${OUT_DIR} ${CC_ARG} INSTALL_MOD_STRIP=1 INSTALL_MOD_PATH=${MODULES_STAGING_DIR} ${MAKE_AR    GS} modules_install)\n 97         set +x\n 98 }\n\ncd \/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/kernel\/msm-4.19 \n#make\u547d\u4ee4\u683c\u5f0f\u5316 \nmake\nO=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/kernel\/msm-4.19 \nINSTALL_MOD_STRIP=1 \nINSTALL_MOD_PATH=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/kernel\/msm-4.19\/staging \nREAL_CC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/vendor\/qcom\/proprietary\/llvm-arm-toolchain-ship\/8.0\/bin\/clang \nCLANG_TRIPLE=aarch64-linux-gnu- DTC_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/dtc\nDTC_OVERLAY_TEST_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/ufdt_apply_overlay \nCONFIG_BUILD_ARM64_DT_OVERLAY=y HOSTCC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-gcc \nHOSTAR=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ar \nHOSTLD=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ld\nmodules_install<\/code><\/pre>\n<p>MODULES_STAGING_DIR\u4e3a\u6a21\u5757\u5b89\u88c5\u76ee\u5f55<code>out\/target\/product\/qssi\/obj\/kernel\/msm-4.19\/staging<\/code><\/p>\n<h6><span class=\"ez-toc-section\" id=\"5copy_all_to_prebuilt\"><\/span>5.copy_all_to_prebuilt()<span class=\"ez-toc-section-end\"><\/span><\/h6>\n<p><code> copy_all_to_prebuilt ${KERNEL_BINS}<\/code>\u5e26\u7684\u53c2\u6570<code>${KERNEL_BINS}<\/code>\u4e3a\u76ee\u5f55<code>\/home\/xinyi\/code\/sg865\/sg865w_android10\/kernel\/ship_prebuilt\/primary_kernel<\/code>\uff0c\u4f1a\u8d4b\u503c\u7ed9PREBUILT_OUT\u53d8\u91cf\u3002<\/p>\n<p>1\uff09\u62f7\u8d1d\u6a21\u5757\u5230PREBUILT_OUT\u76ee\u5f55<br \/>\n\u4f1a\u8c03\u7528copy_modules_to_prebuilt\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u4f1a\u904d\u5386\u6240\u6709\u5b89\u88c5\u7684\u6a21\u5757.ko\u6587\u4ef6\uff0c\u7136\u540e\u62f7\u8d1d\u5230${PREBUILT_OUT}\/${KERNEL_MODULES_OUT}\u76ee\u5f55\u3002<br \/>\n<code>device\/qcom\/qssi\/qssi.mk:228:KERNEL_MODULES_OUT := out\/target\/product\/$(PRODUCT_NAME)\/$(KERNEL_MODULES_INSTALL)\/lib\/modules<\/code><br \/>\n<code>device\/qcom\/qssi\/qssi.mk:227:KERNEL_MODULES_INSTALL := dlkm<\/code><\/p>\n<p><code>${KERNEL_MODULES_OUT}<\/code>\u5373\u4e3a <code>out\/target\/product\/qssi\/dlkm\/lib\/modules<\/code><br \/>\n2\uff09\u62f7\u8d1d\u5185\u6838\u955c\u50cf\u7b49\u6587\u4ef6\u5230PREBUILT_OUT\u76ee\u5f55<\/p>\n<h5><span class=\"ez-toc-section\" id=\"%E5%86%85%E6%A0%B8%E6%9E%84%E5%BB%BA%E6%97%A5%E5%BF%97\"><\/span>\u5185\u6838\u6784\u5efa\u65e5\u5fd7<span class=\"ez-toc-section-end\"><\/span><\/h5>\n<p>\u6839\u636e\u65e5\u5fd7\uff0c\u53ef\u77e5\u5185\u6838\u4f1a\u6784\u5efa\u4e24\u4e2a\u76ee\u6807\u3002<\/p>\n<pre><code class=\"language-bash\">build out\/target\/product\/qssi\/obj\/kernel\/msm-4.19\/usr\n+++ dirname device\/qcom\/kernelscripts\/buildkernel.sh\n\nbuild out\/target\/product\/qssi\/obj\/kernel\/msm-4.19\/arch\/arm64\/boot\/Image\n+++ dirname device\/qcom\/kernelscripts\/buildkernel.sh<\/code><\/pre>\n<p><code>grep -nr &quot;buildkernel.sh&quot; build kernel system device<\/code>\uff0c\u53ef\u4ee5\u641c\u7d22\u5230buildkernel.sh\u7684\u8c03\u7528\u4f4d\u7f6e\uff1a<br \/>\ndevice\/qcom\/kernelscripts\/kernel_definitions.mk:158:    device\/qcom\/kernelscripts\/buildkernel.sh \\<br \/>\ndevice\/qcom\/kernelscripts\/kernel_definitions.mk:180:    device\/qcom\/kernelscripts\/buildkernel.sh \\<\/p>\n<p><code>device\/qcom\/kernelscripts\/kernel_definitions.mk<\/code>\u6b63\u597d\u5b9a\u4e49\u4e86\u4e0a\u9762\u4e24\u4e2a\u76ee\u6807,\u6ce8\u610f\u5728\u6267\u884cbuildkernel.sh\u4e4b\u524d\u5b9a\u4e49\u4e86\u5f88\u591a\u53d8\u91cf\uff1a<br \/>\n<img src=\"http:\/\/xinyiworld.top\/wordpress_it\/wp-content\/uploads\/2021\/09\/kernel_all.png\" alt=\"\" \/><\/p>\n<p>TODO:\u4e0a\u9762\u7684\u4e24\u4e2a\u76ee\u6807\uff0c\u5728\u6784\u5efaboot.img\u7684\u65f6\u5019\u53c8\u662f\u5982\u4f55\u5173\u8054\u8d77\u6765\u7684\uff1f<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5super_emptyimg\"><\/span>5.super_empty.img<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>droidcore:INSTALLED_SUPERIMAGE_EMPTY_TARGET<\/p>\n<pre><code class=\"language-bash\">4602 INSTALLED_SUPERIMAGE_EMPTY_TARGET := $(PRODUCT_OUT)\/super_empty.img\n4603 $(INSTALLED_SUPERIMAGE_EMPTY_TARGET): intermediates := $(call intermediates-dir-for,PACKAGING,super_empty)\n4604 $(INSTALLED_SUPERIMAGE_EMPTY_TARGET): $(LPMAKE) $(BUILD_SUPER_IMAGE)\n4605         $(call pretty,&quot;Target empty super fs image: $@&quot;)\n4606         mkdir -p $(intermediates)\n4607         rm -rf $(intermediates)\/misc_info.txt\n4608         $(call dump-super-image-info,$(intermediates)\/misc_info.txt)\n4609         PATH=$(dir $(LPMAKE)):$$PATH \\\n4610             $(BUILD_SUPER_IMAGE) -v $(intermediates)\/misc_info.txt $@<\/code><\/pre>\n<p><strong>1)\u76ee\u6807$(LPMAKE)<\/strong><br \/>\nbuild\/make\/core\/config.mk:592:LPMAKE := $(HOST_OUT_EXECUTABLES)\/lpmake$(HOST_EXECUTABLE_SUFFIX)<br \/>\n\u5373<code>out\/host\/linux-x86\/bin\/lpmake<\/code>,\u6e90\u7801\u4f4d\u4e8e<code>system\/extras\/partition_tools\/lpmake.cc<\/code><br \/>\n<strong>2)\u76ee\u6807$(BUILD_SUPER_IMAGE)<\/strong><br \/>\nbuild\/make\/core\/config.mk:593:BUILD_SUPER_IMAGE := build\/make\/tools\/releasetools\/build_super_image.py<br \/>\n<strong>3)\u547d\u4ee4<\/strong><br \/>\n<code>$(BUILD_SUPER_IMAGE) -v $(intermediates)\/misc_info.txt $@<\/code><\/p>\n<pre><code class=\"language-bash\">177 def BuildSuperImage(inp, out):\n178 \n179   if isinstance(inp, dict):\n180     logger.info(&quot;Building super image from info dict...&quot;)\n181     return BuildSuperImageFromDict(inp, out)\n182 \n183   if isinstance(inp, str):\n184     if os.path.isdir(inp):\n185       logger.info(&quot;Building super image from extracted target files...&quot;)\n186       return BuildSuperImageFromExtractedTargetFiles(inp, out)\n187 \n188     if zipfile.is_zipfile(inp):\n189       logger.info(&quot;Building super image from target files...&quot;)\n190       return BuildSuperImageFromTargetFiles(inp, out)\n191 \n192     if os.path.isfile(inp):\n193       with open(inp) as f:\n194         lines = f.read()\n195       logger.info(&quot;Building super image from info dict...&quot;)\n196       return BuildSuperImageFromDict(common.LoadDictionaryFromLines(lines.split(&quot;\\n&quot;)), out)\n197 \n198   raise ValueError(&quot;{} is not a dictionary or a valid path&quot;.format(inp))<\/code><\/pre>\n<p>\u53ef\u77e5super_empty.img\u6784\u5efa\u65f6\uff0c\u4f1a\u8d70\u5230<code>Building super image from info dict...<\/code>\uff0c\u8bfb\u53d6misc_info.txt\u5230\u5b57\u5178\uff0c\u7136\u540e\u518d\u8c03\u7528BuildSuperImageFromDict\u65b9\u6cd5\u3002<\/p>\n<p>super_empty.img\u65e0\u6cd5\u89e3\u5305\uff1fTODO<\/p>\n<h3><span class=\"ez-toc-section\" id=\"6superimg_%E6%AF%94%E8%BE%83%E7%89%B9%E6%AE%8A%EF%BC%8C%E6%98%AF%E5%9C%A8target%E5%8C%85%E5%88%B6%E4%BD%9C%E5%AE%8C%E6%88%90%E4%B9%8B%E5%90%8E%E6%89%8D%E4%BC%9A%E7%94%9F%E6%88%90%E3%80%82\"><\/span>6.super.img (\u6bd4\u8f83\u7279\u6b8a\uff0c\u662f\u5728target\u5305\u5236\u4f5c\u5b8c\u6210\u4e4b\u540e\u624d\u4f1a\u751f\u6210\u3002)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><a href=\"https:\/\/blog.csdn.net\/guyongqiangx\/article\/details\/124052932\">https:\/\/blog.csdn.net\/guyongqiangx\/article\/details\/124052932<\/a> (*)<br \/>\n<a href=\"https:\/\/huaweicloud.csdn.net\/64f986f2993dd34278ee1df2.html\">https:\/\/huaweicloud.csdn.net\/64f986f2993dd34278ee1df2.html<\/a><br \/>\n<a href=\"https:\/\/blog.51cto.com\/u_16099314\/7779971\">https:\/\/blog.51cto.com\/u_16099314\/7779971<\/a><br \/>\n\u867d\u7136\u8bf4super.img\u76f8\u5173\u7684\u76ee\u6807\u5728build\/make\/core\/Makefile\u91cc\u5b58\u5728\uff0c\u4f46\u662f\u5728droidcore\u91cc\u5374\u6ca1\u6709\u5b83\u7684\u4f9d\u8d56\u3002\u627e\u4e86\u534a\u5929\uff0c\u624d\u77e5\u9053\u5b83\u4f4d\u4e8e\u9ad8\u901a\u81ea\u5df1\u5199\u7684\u811a\u672c <code>vendor\/qcom\/opensource\/core-utils\/build\/build.sh<\/code>\u4e2d\u7684<code>generate_dynamic_partition_images<\/code>\u65b9\u6cd5\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E4%BA%8C%E3%80%81%E5%90%84%E4%B8%AAimg%E9%95%9C%E5%83%8F%E6%9E%84%E5%BB%BA%E5%AE%8C%E6%88%90%E4%B9%8B%E5%90%8E%E5%B9%B2%E4%BA%86%E4%BB%80%E4%B9%88\"><\/span>\u4e8c\u3001\u5404\u4e2a.img\u955c\u50cf\u6784\u5efa\u5b8c\u6210\u4e4b\u540e\u5e72\u4e86\u4ec0\u4e48<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"%E5%88%B6%E4%BD%9C%E5%8D%87%E7%BA%A7%E5%8C%85\"><\/span>\u5236\u4f5c\u5347\u7ea7\u5305<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u89c2\u5bdf\u65e5\u5fd7\uff1a<br \/>\n<code>[ 99% 1075\/1080] Package target files: out\/target\/product\/qssi\/obj\/PACKAGING\/target_files_intermediates\/qssi-target_files-eng.root.zip<\/code><br \/>\n<a href=\"https:\/\/cloud.tencent.com\/developer\/article\/1578427?from=15425\">https:\/\/cloud.tencent.com\/developer\/article\/1578427?from=15425<\/a><br \/>\n<a href=\"https:\/\/blog.csdn.net\/liyuchong2537631\/article\/details\/97517850\">https:\/\/blog.csdn.net\/liyuchong2537631\/article\/details\/97517850<\/a><br \/>\n<a href=\"https:\/\/blog.csdn.net\/thinkinwm\/article\/details\/8985530\">https:\/\/blog.csdn.net\/thinkinwm\/article\/details\/8985530<\/a><\/p>\n<p>\u6267\u884c$(BUILT_TARGET_FILES_PACKAGE)\u76ee\u6807\uff08\u4f4d\u4e8ebuild\/make\/core\/Makefile\uff09\u5219\u5f00\u59cb\u5236\u4f5ctarget\u5305<\/p>\n<p>\u6ce8\u610f<strong>zip_root<\/strong>\uff0c\u5373<code>out\/target\/product\/xx\/obj\/PACKAGING\/target_files_intermediates\/xx-target_files-eng.root<\/code>\u76ee\u5f55<\/p>\n<pre><code class=\"language-bash\">3732 # -----------------------------------------------------------------\n3733 # A zip of the directories that map to the target filesystem.\n3734 # This zip can be used to create an OTA package or filesystem image\n3735 # as a post-build step.\n3736 #\n3737 name := $(TARGET_PRODUCT)\n3738 ifeq ($(TARGET_BUILD_TYPE),debug)\n3739   name := $(name)_debug\n3740 endif\n3741 name := $(name)-target_files-$(FILE_NAME_TAG)\n3742 \n3743 intermediates := $(call intermediates-dir-for,PACKAGING,target_files)\n3744 BUILT_TARGET_FILES_PACKAGE := $(intermediates)\/$(name).zip\n3745 $(BUILT_TARGET_FILES_PACKAGE): intermediates := $(intermediates)\n3746 $(BUILT_TARGET_FILES_PACKAGE): \\\n3747             zip_root := $(intermediates)\/$(name)<\/code><\/pre>\n<p>\u5c06\u5404\u79cd\u6587\u4ef6\u62f7\u8d1d\u5230zip_root\u76ee\u5f55\u4e0b\uff0c\u5e76\u5411\u4e00\u4e9b\u6587\u4ef6\u5199\u5165\u6570\u636e\u3002<br \/>\n\u5c06zip_root\u5305\u542b\u7684\u6587\u4ef6\u8def\u5f84\u5199\u5165\u5230xx-target_files-eng.root.zip.list\u6587\u4ef6\u4e2d<br \/>\n\u8c03\u7528add_img_to_target_files\u5de5\u5177\uff0c\u5c06\u5404\u4e2aimage\u5199\u5230target\u5305IMAGES\u76ee\u5f55\u4e0b<br \/>\n<code>$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \\ 4257             build\/make\/tools\/releasetools\/add_img_to_target_files -a -r -v -p $(HOST_OUT) $(zip_root)<\/code><br \/>\n\u6700\u540e\u8c03\u7528out\/soong\/host\/linux-x86\/bin\/soong_zip\u538b\u7f29\u5de5\u5177\uff08\u6e90\u7801\u4f4d\u4e8ebuild\/soong\/zip\/cmd\/main.go\uff09\u5c06zip_root\u76ee\u5f55\u6253\u5305\u540d\u4e3axx-target_files-eng.root.zip.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E4%B8%89%E3%80%81qssi%E4%B8%8Ekona%E7%9A%84target%E5%8C%85%E5%AF%B9%E6%AF%94\"><\/span>\u4e09\u3001qssi\u4e0ekona\u7684target\u5305\u5bf9\u6bd4<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p><img src=\"http:\/\/xinyiworld.top\/wordpress_it\/wp-content\/uploads\/2021\/09\/merge.png\" alt=\"\" \/><\/p>\n<p>\u5171\u6709\u76ee\u5f55\uff1aBOOT\u3001IMAGES\u3001META\u3001OTA\u3001ROOT<br \/>\nqssi\u72ec\u6709\uff1aPRODUCT\u3001SYSTEM<br \/>\nkona\u72ec\u6709\uff1aDATA\u3001ODM\u3001PREBUILT_IMAGES(dtbo.img)\u3001RADIO\u3001RECOVERY\u3001VENDOR<\/p>\n<h3><span class=\"ez-toc-section\" id=\"qssi%E4%B8%8Ekona%E7%9A%84mk%E6%96%87%E4%BB%B6\"><\/span>qssi\u4e0ekona\u7684mk\u6587\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"1deviceqcomqssiqssimk\"><\/span>1.device\/qcom\/qssi\/qssi.mk<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>1\uff09\u6ce8\u91ca\u8bf4\u660e\u4e86\u53ea\u6253system\u955c\u50cf<br \/>\n2\uff09\u4e0d\u652f\u6301\u52a8\u6001\u5206\u533a<br \/>\n<img src=\"http:\/\/xinyiworld.top\/wordpress_it\/wp-content\/uploads\/2021\/09\/qssimk.png\" alt=\"\" \/><\/p>\n<h4><span class=\"ez-toc-section\" id=\"2deviceqcomkonakonamk\"><\/span>2.device\/qcom\/kona\/kona.mk<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>1\uff09\u652f\u6301\u52a8\u6001\u5206\u533a<br \/>\n<img src=\"http:\/\/xinyiworld.top\/wordpress_it\/wp-content\/uploads\/2021\/09\/konamk.png\" alt=\"\" \/><\/p>\n<h3><span class=\"ez-toc-section\" id=\"qssi%E4%B8%8Ekona%E7%9A%84target%E5%8C%85%E5%A6%82%E4%BD%95merged\"><\/span>qssi\u4e0ekona\u7684target\u5305\u5982\u4f55merged<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\u5404\u81ea\u7279\u6709\u7684\u76ee\u5f55\u72ec\u81ea\u62f7\u8d1d\uff0c\u5171\u6709\u7684\u76ee\u5f55\u3002<\/p>\n<h4><span class=\"ez-toc-section\" id=\"BOOT\"><\/span>BOOT<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u76f4\u63a5\u4f7f\u7528kona\u7684BOOT\u76ee\u5f55\uff0c\u901a\u8fc7<code>diff -r kona\/BOOT merge\/BOOT<\/code>\u65e0\u8f93\u51fa\u5373\u53ef\u9a8c\u8bc1\u3002<\/p>\n<h4><span class=\"ez-toc-section\" id=\"IMAGES\"><\/span>IMAGES<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><strong>qssi\u4e0ekona\u7684IMAGES\u76ee\u5f55\u5bf9\u6bd4<\/strong>\uff1a<\/p>\n<ul>\n<li>\u53ea\u5728qssi\/IMAGES\u4e2d\u5b58\u5728<br \/>\nproduct.img\u3001product.map\u3001system.img\u3001system.map<\/li>\n<li>\u53ea\u5728kona\/IMAGES\u4e2d\u5b58\u5728<br \/>\ndtbo.img\u3001odm.img\u3001odm.map\u3001recovery.img\u3001recovery-two-step.img\u3001userdata.img\u3001vendor.img\u3001vendor.map<\/li>\n<li>qssi\/IMAGE\u4e0ekona\/IMAGES\u4e2d\u90fd\u5b58\u5728\u4f46\u662fmd5\u4e0d\u4e00<br \/>\nsuper_empty.img\u3001vbmeta.img\u3001vbmeta_system.img\u3001boot.img<br \/>\n<strong>merge\/IMAGES\u76ee\u5f55\u4f7f\u7528\u4e86\u8c01\u7684\u955c\u50cf<\/strong>\uff1a<br \/>\n\u53d1\u73b0merge\/IAMGES\u4e0b\u7684\u955c\u50cf\u6587\u4ef6\u548cqssi\u4e0ekona\u7684\u90fd\u4e0d\u4e00\u6837\uff01\uff01<\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"META\"><\/span>META<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u90e8\u5206\u53d6\u81eaqssi\uff0c\u90e8\u5206\u53d6\u81eakona.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"OTA\"><\/span>OTA<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u76f4\u63a5\u4f7f\u7528kona.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%9B%9B%E3%80%81%E9%AB%98%E9%80%9Abuildsh%E8%84%9A%E6%9C%AC%E5%88%86%E6%9E%90\"><\/span>\u56db\u3001\u9ad8\u901abuild.sh\u811a\u672c\u5206\u6790<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"1lunch%E9%87%8D%E8%A6%81%E6%97%A5%E5%BF%97%E5%88%86%E6%9E%90\"><\/span>1.lunch\u91cd\u8981\u65e5\u5fd7\u5206\u6790<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h4><span class=\"ez-toc-section\" id=\"1-1%EF%BC%89lunch_qssi-userdebug\"><\/span>1-1\uff09lunch qssi-userdebug<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-bash\">glob xx.prof\nout\/soong\/.bootstrap\/bin\/soong_build out\/soong\/build.ninja\n\ninitializing build system ...\n#include\u5404\u4e2a\u6a21\u5757\u7684Android.mk\u6587\u4ef6\nincluding xx\/Android.mk\n[ 55% 778\/1399] including build\/make\/target\/board\/Android.mk ...\nUsing DTB Image\nUsing uncompressed kernel\ndevice\/qcom\/common\/generate_extra_images.mk:567: warning: ==== device\/qcom\/qssi\/qssi.mk ====\n[ 99% 1398\/1399] finishing build rules ...\n#\u6ce8\u610f\u8fd9\u91cc\u662f\u4e0d\u540c\u7684\u6587\u4ef6(TODO:\u6ca1\u6709\u641c\u7d22\u5230vendor\/qcom\/build\/tasks\/generate_extra_images.mk\u5f15\u7528\u7684\u4f4d\u7f6e\uff1f)\nvendor\/qcom\/build\/tasks\/generate_extra_images.mk:567: warning: ==== device\/qcom\/qssi\/qssi.mk ====\n[100% 1399\/1399] writing build rules ...\n\nStarting ninja...\n\n#\u5185\u6838\u6784\u5efa\n#\u76ee\u68071\n[ 74% 1406\/1894] build out\/target\/product\/qssi\/obj\/kernel\/msm-4.19\/usr\n+++ dirname device\/qcom\/kernelscripts\/buildkernel.sh \uff08**\u6267\u884c\u6b64\u811a\u672c\uff0c\u5f00\u59cb\u6784\u5efa\u5185\u6838\u3002**\uff09\n#1.\u6784\u5efavendor\/kona_defconfig\u76ee\u6807\nBuilding defconfig\n+ set -x\n+ cd kernel\/msm-4.19\n+ make O=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/kernel\/msm-4.19 REAL_CC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/vendor\/qcom\/proprietary\/llvm-arm-toolchain-ship\/8.0\/bin\/clang CLANG_TRIPLE=aarch64-linux-gnu- DTC_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/dtc DTC_OVERLAY_TEST_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/ufdt_apply_overlay CONFIG_BUILD_ARM64_DT_OVERLAY=y HOSTCC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-gcc HOSTAR=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ar HOSTLD=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ld &#039;HOSTCFLAGS=-I\/home\/xinyi\/code\/sg865\/sg865w_android10\/kernel\/msm-4.19\/include\/uapi -I\/usr\/include -I\/usr\/include\/x86_64-linux-gnu -L\/usr\/lib -L\/usr\/lib\/x86_64-linux-gnu&#039; &#039;HOSTLDFLAGS=-L\/usr\/lib -L\/usr\/lib\/x86_64-linux-gnu&#039; ARCH=arm64 CROSS_COMPILE=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/aarch64\/aarch64-linux-android-4.9\/bin\/aarch64-linux-androidkernel- vendor\/kona_defconfig\nmake[1]: \u8fdb\u5165\u76ee\u5f55\u201c\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/kernel\/msm-4.19\u201d\n  GEN     .\/Makefile\narch\/arm64\/configs\/vendor\/kona_defconfig:351:warning: override: reassigning to symbol PPP_DEFLATE\n#\n# configuration written to .config\n#\nmake[1]: \u79bb\u5f00\u76ee\u5f55\u201c\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/kernel\/msm-4.19\u201d\n#2.\u6784\u5efaheaders_install\u76ee\u6807\nInstalling kernel headers\n+ cd \/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/kernel\/msm-4.19\n+ make &#039;HOSTCFLAGS=-I\/home\/xinyi\/code\/sg865\/sg865w_android10\/kernel\/msm-4.19\/include\/uapi -I\/usr\/include -I\/usr\/include\/x86_64-linux-gnu -L\/usr\/lib -L\/usr\/lib\/x86_64-linux-gnu&#039; &#039;HOSTLDFLAGS=-L\/usr\/lib -L\/usr\/lib\/x86_64-linux-gnu&#039; ARCH=arm64 CROSS_COMPILE=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/aarch64\/aarch64-linux-android-4.9\/bin\/aarch64-linux-androidkernel- O=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/qssi\/obj\/kernel\/msm-4.19 REAL_CC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/vendor\/qcom\/proprietary\/llvm-arm-toolchain-ship\/8.0\/bin\/clang CLANG_TRIPLE=aarch64-linux-gnu- DTC_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/dtc DTC_OVERLAY_TEST_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/ufdt_apply_overlay CONFIG_BUILD_ARM64_DT_OVERLAY=y HOSTCC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-gcc HOSTAR=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ar HOSTLD=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ld headers_install\nmake[6]: \u5bf9\u201c__headers\u201d\u65e0\u9700\u505a\u4efb\u4f55\u4e8b\u3002\n+ set +x\n[ 74% 1407\/1894] build out\/target\/product\/qssi\/obj\/KERNEL_OBJ\/usr\n...\u6784\u5efa\u4e86\u4e00\u4e9b\u5176\u5b83\u7684\u4e1c\u897f\n\n#\u76ee\u68072\n[ 98% 1818\/1842] build out\/target\/product\/qssi\/obj\/kernel\/msm-4.19\/arch\/arm64\/boot\/Image\n+++ dirname device\/qcom\/kernelscripts\/buildkernel.sh\n...\u4e4b\u524d\u7684\u548c\u76ee\u68071\u4e00\u6837\uff08Building defconfig\u3001Installing kernel headers\uff09\uff0c\u989d\u5916\u6267\u884c\u4e86\u4e00\u4e9b\u64cd\u4f5c\nBuilding kernel\nInstalling kernel modules\nCopying modules files\n\n+ cd \/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/kona\/obj\/kernel\/msm-4.19\n#make\u9ed8\u8ba4\u76ee\u6807\n+ make ARCH=arm64 CROSS_COMPILE=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/aarch64\/aarch64-linux-android-4.9\/bin\/aarch64-linux-android- &#039;HOSTCFLAGS=-I\/home\/xinyi\/code\/sg865\/sg865w_android10\/kernel\/msm-4.19\/include\/uapi -I\/usr\/include -I\/usr\/include\/x86_64-linux-gnu -L\/usr\/lib -L\/usr\/lib\/x86_64-linux-gnu&#039; &#039;HOSTLDFLAGS=-L\/usr\/lib -L\/usr\/lib\/x86_64-linux-gnu&#039; O=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/target\/product\/kona\/obj\/kernel\/msm-4.19 REAL_CC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/vendor\/qcom\/proprietary\/llvm-arm-toolchain-ship\/8.0\/bin\/clang CLANG_TRIPLE=aarch64-linux-gnu- DTC_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/dtc DTC_OVERLAY_TEST_EXT=\/home\/xinyi\/code\/sg865\/sg865w_android10\/out\/host\/linux-x86\/bin\/ufdt_apply_overlay CONFIG_BUILD_ARM64_DT_OVERLAY=y HOSTCC=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-gcc HOSTAR=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ar HOSTLD=\/home\/xinyi\/code\/sg865\/sg865w_android10\/prebuilts\/gcc\/linux-x86\/host\/x86_64-linux-glibc2.17-4.8\/bin\/x86_64-linux-ld -j8\n  GEN     .\/Makefile\nscripts\/kconfig\/conf  --syncconfig Kconfig\n  GEN     .\/Makefile\n  Using \/home\/xinyi\/code\/sg865\/sg865w_android10\/kernel\/msm-4.19 as source for kernel\n  CALL    \/home\/xinyi\/code\/sg865\/sg865w_android10\/kernel\/msm-4.19\/scripts\/checksyscalls.sh\n  CHK     include\/generated\/compile.h\n  GZIP    kernel\/config_data.gz\n  DTC     arch\/arm64\/boot\/dts\/vendor\/qcom\/kona.dtb\n  DTC     arch\/arm64\/boot\/dts\/vendor\/qcom\/kona-v2.dtb\n<\/code><\/pre>\n<h3><span class=\"ez-toc-section\" id=\"2generate_ota_zip%EF%BC%88%E5%88%B6%E4%BD%9COTA%E5%8D%87%E7%BA%A7%E5%8C%85%EF%BC%89\"><\/span>2.generate_ota_zip\uff08\u5236\u4f5cOTA\u5347\u7ea7\u5305\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash\">313 function generate_ota_zip () {\n314     log &quot;Processing dist\/ota commands:&quot;\n315 \n316     SYSTEM_TARGET_FILES=&quot;$(find $DIST_DIR -name &quot;qssi*-target_files-*.zip&quot; -print)&quot;\n317     log &quot;SYSTEM_TARGET_FILES=$SYSTEM_TARGET_FILES&quot;\n318     check_if_file_exists &quot;$SYSTEM_TARGET_FILES&quot;\n319 \n320     OTHER_TARGET_FILES=&quot;$(find $DIST_DIR -name &quot;${TARGET_PRODUCT}*-target_files-*.zip&quot; -print)&quot;\n321     log &quot;OTHER_TARGET_FILES=$OTHER_TARGET_FILES&quot;\n322     check_if_file_exists &quot;$OTHER_TARGET_FILES&quot;\n323 \n324     log &quot;MERGED_TARGET_FILES=$MERGED_TARGET_FILES&quot;\n325 \n326     check_if_file_exists &quot;$DIST_DIR\/merge_config_system_misc_info_keys&quot;\n327     check_if_file_exists &quot;$DIST_DIR\/merge_config_system_item_list&quot;\n328     check_if_file_exists &quot;$DIST_DIR\/merge_config_other_item_list&quot;\n329 \n330     MERGE_TARGET_FILES_COMMAND=&quot;.\/build\/tools\/releasetools\/merge_target_files.py \\\n331         --system-target-files $SYSTEM_TARGET_FILES \\\n332         --other-target-files $OTHER_TARGET_FILES \\\n333         --output-target-files $MERGED_TARGET_FILES \\\n334         --system-misc-info-keys $DIST_DIR\/merge_config_system_misc_info_keys \\\n335         --system-item-list $DIST_DIR\/merge_config_system_item_list \\\n336         --other-item-list $DIST_DIR\/merge_config_other_item_list \\\n337         --output-ota  $MERGED_OTA_ZIP&quot;\n338 \n339     if [ &quot;$ENABLE_AB&quot; = false ]; then\n340         MERGE_TARGET_FILES_COMMAND=&quot;$MERGE_TARGET_FILES_COMMAND --rebuild_recovery&quot;\n341     fi\n342 \n343     command &quot;$MERGE_TARGET_FILES_COMMAND&quot;\n344 }<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"1merge%E6%97%A5%E5%BF%97%EF%BC%9A\"><\/span><strong>1.merge\u65e5\u5fd7<\/strong>\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<pre><code class=\"language-bash\">[build.sh]: Processing dist\/ota commands:\n============================================\n============================================\n[build.sh]: SYSTEM_TARGET_FILES=out\/dist\/qssi-target_files-eng.root.zip\n============================================\n============================================\n[build.sh]: OTHER_TARGET_FILES=out\/dist\/kona-target_files-eng.root.zip\n============================================\n============================================\n[build.sh]: MERGED_TARGET_FILES=out\/dist\/merged-qssi_kona-target_files.zip\n============================================\n============================================\n[build.sh]: Command: &quot;.\/build\/tools\/releasetools\/merge_target_files.py         --system-target-files out\/dist\/qssi-target_files-eng.root.zip         --other-target-files out\/dist\/kona-target_files-eng.root.zip         --output-target-files out\/dist\/merged-qssi_kona-target_files.zip         --system-misc-info-keys out\/dist\/merge_config_system_misc_info_keys         --system-item-list out\/dist\/merge_config_system_item_list         --other-item-list out\/dist\/merge_config_other_item_list         --output-ota  out\/dist\/merged-qssi_kona-ota.zip&quot;\n============================================\n2024-02-05 19:53:44 - merge_target_files.py - INFO    : starting: merge system out\/dist\/qssi-target_files-eng.root.zip and other out\/dist\/kona-target_files-eng.root.zip into output out\/dist\/merged-qssi_kona-target_files.zip\n2024-02-05 19:53:44 - merge_target_files.py - INFO    : extracting from out\/dist\/qssi-target_files-eng.root.zip\n2024-02-05 19:53:45 - common.py - INFO    :   Running: &quot;unzip -o -q out\/dist\/qssi-target_files-eng.root.zip -d \/tmp\/merge_target_files_ubTwC5\/output META\/apexkeys.txt META\/apkcerts.txt META\/filesystem_config.txt META\/root_filesystem_config.txt META\/system_manifest.xml META\/system_matrix.xml META\/update_engine_config.txt PRODUCT\/* ROOT\/* SYSTEM\/*&quot;\n2024-02-05 19:54:03 - common.py - INFO    : \n2024-02-05 19:54:03 - merge_target_files.py - INFO    : extracting from out\/dist\/kona-target_files-eng.root.zip\n2024-02-05 19:54:03 - common.py - INFO    :   Running: &quot;unzip -o -q out\/dist\/kona-target_files-eng.root.zip -d \/tmp\/merge_target_files_ubTwC5\/output META\/boot_filesystem_config.txt META\/file_contexts.bin META\/otakeys.txt META\/releasetools.py META\/vendor_filesystem_config.txt META\/vendor_manifest.xml META\/vendor_matrix.xml BOOT\/* DATA\/* ODM\/* OTA\/android-info.txt PREBUILT_IMAGES\/* RADIO\/* RECOVERY\/* VENDOR\/*&quot;\n2024-02-05 19:54:59 - common.py - INFO    : \n2024-02-05 19:54:59 - merge_target_files.py - INFO    : extracting from out\/dist\/qssi-target_files-eng.root.zip\n2024-02-05 19:54:59 - common.py - INFO    :   Running: &quot;unzip -o -q out\/dist\/qssi-target_files-eng.root.zip -d \/tmp\/merge_target_files_ubTwC5\/system META\/*&quot;\n2024-02-05 19:54:59 - common.py - INFO    : \n2024-02-05 19:54:59 - merge_target_files.py - INFO    : extracting from out\/dist\/kona-target_files-eng.root.zip\n2024-02-05 19:54:59 - common.py - INFO    :   Running: &quot;unzip -o -q out\/dist\/kona-target_files-eng.root.zip -d \/tmp\/merge_target_files_ubTwC5\/other META\/*&quot;<\/code><\/pre>\n<p><strong>1-1\uff09 merge_target_files.py\u7684\u53c2\u6570\u8bf4\u660e<\/strong><br \/>\n<code>--system-target-files<\/code>\uff1aqssi\u4ea7\u54c1\u7684target\u5305\u3002<br \/>\n<code>--other-target-files<\/code>\uff1akona\u4ea7\u54c1\u7684target\u5305\u3002<br \/>\n<code>--output-target-files<\/code>\uff1aqssi\u4e0ekona\u4ea7\u54c1merge\u540e\u7684target\u5305\u3002<br \/>\n<code>--system-item-list<\/code>\uff1aqssi\u7684target\u5305\u9700\u8981merge\u7684\u6587\u4ef6\u3002<br \/>\n<code>--other-item-list<\/code>\uff1akona\u7684target\u5305\u9700\u8981merge\u7684\u6587\u4ef6\u3002<br \/>\n...\u89c1\u6e90\u7801\u8bf4\u660e\uff0c\u975e\u5e38\u8be6\u7ec6\uff01\uff01\uff01\uff01<\/p>\n<p><strong>1-2\uff09 merge\u4e3b\u8981\u6d41\u7a0b<\/strong><br \/>\n\u8c03\u7528call_func_with_temp_dir\u65b9\u6cd5\u521b\u5efa\u4e34\u65f6\u76ee\u5f55\/tmp\/merge_target_files_xx\uff0c\u7136\u540e\u8c03\u7528merge_target_files\u65b9\u6cd5\u5f00\u59cbmerge.<br \/>\n<strong>merge_target_files<\/strong><br \/>\n1-2-1\uff09extract_items:\u5c06qssi\u4e0ekona\u7684target\u5305\u7684\u4e3b\u8981\u6587\u4ef6\u5408\u5e76\u5230merge\u4e34\u65f6\u76ee\u5f55<br \/>\n1-2-2\uff09add_img_to_target_files.main(add_img_args):add_img_args\u53c2\u6570\u5c31\u5305\u62ecmerge\u4e34\u65f6\u76ee\u5f55\u3002<br \/>\n@@\u300badd_img_to_target_files<\/p>\n<pre><code class=\"language-bash\">def AddImagesToTargetFiles(filename):\n696   &quot;&quot;&quot;Creates and adds images (boot\/recovery\/system\/...) to a target_files.zip.\n697 \n698   It works with either a zip file (zip mode), or a directory that contains the\n699   files to be packed into a target_files.zip (dir mode). The latter is used when\n700   being called from build\/make\/core\/Makefile.\n701 \n702   The images will be created under IMAGES\/ in the input target_files.zip.\n703 \n704   Args:\n705     filename: the target_files.zip, or the zip root directory.\n706   &quot;&quot;&quot;<\/code><\/pre>\n<p>@@@@\u300bGetBootableImage<br \/>\n\u5728\u4e34\u65f6merge\u76ee\u5f55\u4e2d\/IAMGES\u76ee\u5f55\u4e0b\u67e5\u627e\u76f8\u5173\u7684\u955c\u50cf\u6587\u4ef6\uff0c\u5982\u679c\u4e0d\u5b58\u5728\u5c31\u8c03\u7528_BuildBootableImage\u65b9\u6cd5\u751f\u6210\u955c\u50cf\uff0c\u4f1a\u8f93\u51fa\u65e5\u5fd7\uff1a<br \/>\n<code>building image from target_files<\/code><br \/>\n\u53ea\u6709<code>++++ boot ++++\u3001++++ recovery ++++\u3001++++ recovery (two-step image) ++++<\/code>\u91cd\u65b0\u751f\u6210\u4e86\uff0cwhy??? \/\/TODO<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3generate_dynamic_partition_images%EF%BC%88%E5%88%B6%E4%BD%9Csuperimg%E5%8A%A8%E6%80%81%E5%88%86%E5%8C%BA%EF%BC%89\"><\/span>3.generate_dynamic_partition_images\uff08\u5236\u4f5csuper.img\u52a8\u6001\u5206\u533a\uff09<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre><code class=\"language-bash\">285 function generate_dynamic_partition_images () {\n286     log &quot;Generate Dynamic Partition Images for ${TARGET_PRODUCT}&quot;\n287     # Handling for Dist Enabled targets\n288     # super.img\/super_empty generation\n289     if [ &quot;$DIST_ENABLED&quot; = true ]; then\n290        if [ &quot;$DP_IMAGES_OVERRIDE&quot; = true ]; then\n291            command &quot;mkdir -p $DYNAMIC_PARTITIONS_IMAGES_PATH&quot;\n292        fi\n293        command &quot;cp $QSSI_OUT\/vbmeta_system.img $OUT\/&quot;\n294        command &quot;unzip -jo $MERGED_TARGET_FILES IMAGES\/*.img -x IMAGES\/userdata.img -d $DYNAMIC_PARTITI    ONS_IMAGES_PATH&quot;\n295        command &quot;.\/build\/tools\/releasetools\/build_super_image.py $MERGED_TARGET_FILES $DYNAMIC_PARTITIO    NS_IMAGES_PATH\/super.img&quot;\n296     else\n            ...\n310     fi\n311 }<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"%E4%BA%94%E3%80%81%E9%AB%98%E9%80%9Apkg_toolscommonbuildbuildpy_%E8%84%9A%E6%9C%AC%E5%88%86%E6%9E%90\"><\/span>\u4e94\u3001\u9ad8\u901apkg_tools\/common\/build\/build.py \u811a\u672c\u5206\u6790<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u4e3b\u8981\u662f\u751f\u6210\u70e7\u5f55\u76f8\u5173\u7684\u4e00\u4e9b\u6587\u4ef6<\/p>\n<button class=\"simplefavorite-button\" data-postid=\"4586\" 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>http:\/\/www.uml.org.cn\/mobiledev\/201705272.asp http [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[209],"tags":[],"_links":{"self":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/4586"}],"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=4586"}],"version-history":[{"count":155,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/4586\/revisions"}],"predecessor-version":[{"id":13001,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/4586\/revisions\/13001"}],"wp:attachment":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4586"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}