{"id":385,"date":"2021-05-27T22:50:21","date_gmt":"2021-05-27T14:50:21","guid":{"rendered":"http:\/\/cocozq.com\/?p=385"},"modified":"2021-05-28T11:05:30","modified_gmt":"2021-05-28T03:05:30","slug":"%e5%a4%a7%e5%9e%8b%e8%bf%9e%e7%bb%ad%e5%89%a7%e4%b9%8b%e6%8b%af%e6%95%91%e5%8f%98%e7%a0%96%e9%bb%91%e8%8e%93key2%e4%b9%8b%e7%ac%ac%e4%b9%9d%e9%9b%86-%e7%a6%bb%e6%88%90%e5%8a%9f%e4%b8%8d","status":"publish","type":"post","link":"https:\/\/cocozq.com\/?p=385","title":{"rendered":"\u5927\u578b\u8fde\u7eed\u5267\u4e4b\u62ef\u6551\u53d8\u7816\u9ed1\u8393KEY2\u4e4b\u7b2c\u4e5d\u96c6\u2014-\u79bb\u6210\u529f\u4e0d\u8fdc\u4e86\uff1f"},"content":{"rendered":"<blockquote><p>\n  \u524d\u666f\u63d0\u8981\uff0c\u4e4b\u524d\u5229\u7528KEY2LE\u5de5\u7a0b\u673a\u521b\u5efa\u4e86<code>rawprogram0.xml<\/code>\u548c<code>partition.xml<\/code>\uff0c\u5237\u5165\u4e4b\u540e\u53d1\u73b0<code>system<\/code>\u548c<code>vendor<\/code>\u5206\u533a\u6ca1\u6709\u521b\u5efa\u6210\u529f\u3002\n<\/p><\/blockquote>\n<p>&emsp;&emsp;\u8fd9\u4e24\u5929\u6211\u5148\u5bfb\u627e\u5404\u79cd\u51fa\u95ee\u9898\u7684\u5730\u65b9\uff0c\u6bd4\u5982\u4e4b\u524d\u7528python\u6821\u9a8c\u751f\u6210<code>rawprogram0.xml<\/code>\u7684\u65f6\u5019\u53d1\u73b0<code>num_partition_sectors<\/code>\u5728\u751f\u6210<code>start_sector<\/code>\u8fd0\u7b97\u65f6\uff0c\u5c0f\u4e8e8\u65f6\u9700\u8981\u75288\u6765\u8ba1\u7b97\uff0c\u8fd8\u6709\u5176\u4ed6\u4e00\u4e9b\u5c0f\u95ee\u9898\u3002\u518d\u5c31\u662f\u5bf9<code>partition.xml<\/code>\u8fdb\u884c\u6821\u9a8c\uff0c\u5199\u4e86\u4e2apython\u51fd\u6570\u5982\u4e0b:<\/p>\n<pre><code class=\"language-python line-numbers\">def rebuild_partition(filepath, size_dict):\n    tree = ET.parse(filepath)\n    root = tree.getroot()\n    for node in root:\n        if node.tag == 'physical_partition':\n            for child in node:\n                label = child.get('label')\n                if label and len(label) &gt; 0:\n                    # if label.endswith('_a') or label.endswith('_b'):\n                    #     label = label.replace('_a', '').replace('_b', '')\n                    size_in_kb = size_dict[label]\n                    child.set('size_in_kb', size_in_kb)\n                else:\n                    print(child.tag, child.attrib)\n\n    tree.write('.\/files\/partition.xml', encoding='utf-8', xml_declaration=True)\n<\/code><\/pre>\n<p>\u6700\u540e\u5c31\u662f<code>patch0.xml<\/code>\u7684\u751f\u6210\uff0c\u867d\u7136\u6211\u89c9\u5f97\u5df2\u7ecf\u6ca1\u6709\u4ec0\u4e48\u95ee\u9898\u4e86\uff0c\u518d\u6b21\u5237\u673a\u4e4b\u540e<code>vendor<\/code>\u548c<code>system<\/code>\u5206\u533a\u4e5f\u51fa\u73b0\u4e86\uff0c\u4f46\u662f\u4ecd\u7136\u65e0\u6cd5\u542f\u52a8\u7cfb\u7edf\uff0c\u8df3\u81f3bootloader\u754c\u9762\uff0c\u770b\u6837\u5b50\u662f\u542f\u52a8\u5185\u6838\u6b65\u9aa4\u5c31\u6302\u4e86\uff0c\u8fd8\u6ca1\u6709\u5230\u542f\u52a8init\u8fdb\u7a0b\uff0c\u518d\u627e\u627e\u539f\u56e0\uff0c\u5982\u679c\u4e0d\u884c\u518d\u4f7f\u7528Evolve X\u6765\u8f85\u52a9\u62a2\u6551\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u666f\u63d0\u8981\uff0c\u4e4b\u524d\u5229\u7528KEY2LE\u5de5\u7a0b\u673a\u521b\u5efa\u4e86rawprogram0.xml\u548cpartition.xml\uff0c\u5237\u5165\u4e4b\u540e &hellip; <a href=\"https:\/\/cocozq.com\/?p=385\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;\u5927\u578b\u8fde\u7eed\u5267\u4e4b\u62ef\u6551\u53d8\u7816\u9ed1\u8393KEY2\u4e4b\u7b2c\u4e5d\u96c6\u2014-\u79bb\u6210\u529f\u4e0d\u8fdc\u4e86\uff1f&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[51,42,46,49],"class_list":{"0":"post-385","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-mobilephone","7":"tag-key2","8":"tag-42","10":"tag-keyone","11":"hfeed"},"_links":{"self":[{"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/posts\/385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cocozq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=385"}],"version-history":[{"count":6,"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/posts\/385\/revisions"}],"predecessor-version":[{"id":402,"href":"https:\/\/cocozq.com\/index.php?rest_route=\/wp\/v2\/posts\/385\/revisions\/402"}],"wp:attachment":[{"href":"https:\/\/cocozq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cocozq.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cocozq.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}