{"id":9885,"date":"2023-06-29T09:22:49","date_gmt":"2023-06-29T01:22:49","guid":{"rendered":"http:\/\/xinyiworld.top\/wordpress_it\/?p=9885"},"modified":"2023-06-29T09:23:29","modified_gmt":"2023-06-29T01:23:29","slug":"%e8%87%aa%e5%ae%9a%e4%b9%89%e7%9a%84-rc%e6%96%87%e4%bb%b6%e6%98%af%e5%a6%82%e4%bd%95%e5%8a%a0%e8%bd%bd%e7%9a%84","status":"publish","type":"post","link":"http:\/\/xinyiworld.top\/wordpress_it\/?p=9885","title":{"rendered":"\u81ea\u5b9a\u4e49\u7684.rc\u6587\u4ef6\u662f\u5982\u4f55\u52a0\u8f7d\u7684"},"content":{"rendered":"<p>1.\u901a\u8fc7\u4ea7\u54c1mk\u6587\u4ef6\u4e2d\u7684PRODUCT_COPY_FILES\u5b8f\u5c06\u81ea\u5b9a\u4e49\u7684.rc\u6587\u4ef6\u62f7\u8d1d\u81f3\u6839\u6587\u4ef6\u7cfb\u7edf\uff0c\u4e00\u822c\u62f7\u8d1d\u5230<code>system\/etc\/init<\/code>\u76ee\u5f55\u4e0b\u3002<br \/>\n2.<code>system\/core\/init\/builtins<\/code>\u4e2d\u7684import_late\u65b9\u6cd5\u4f1a\u89e3\u6790<code>system\/etc\/init<\/code>\u7b49\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u7684.rc\u6587\u4ef6\u3002<\/p>\n<pre><code class=\"language-bash\">\n\/* Imports .rc files from the specified paths. Default ones are applied if none is given.\n *\n * start_index: index of the first path in the args list\n *\/\nstatic void import_late(const std::vector&lt;std::string&gt;&amp; args, size_t start_index, size_t end_index) {\n    Parser&amp; parser = Parser::GetInstance();\n    if (end_index &lt;= start_index) {\n        \/\/ Use the default set if no path is given\n        static const std::vector&lt;std::string&gt; init_directories = {\n            &quot;\/system\/etc\/init&quot;,\n            &quot;\/vendor\/etc\/init&quot;,\n            &quot;\/odm\/etc\/init&quot;\n        };\n\n        for (const auto&amp; dir : init_directories) {\n            parser.ParseConfig(dir);\n        }\n    } else {\n        for (size_t i = start_index; i &lt; end_index; ++i) {\n            parser.ParseConfig(args[i]);\n        }\n    }\n}<\/code><\/pre>\n<p>3.\u81f3\u4e8eimport_late\u65b9\u6cd5\u662f\u4f55\u65f6\u88ab\u8c03\u7528\u7684\uff0c\u770b\u6e90\u7801\u662f\u548cmount\u76f8\u5173\u7684\uff0c\u6b64\u5904\u5c31\u4e0d\u6df1\u7a76\u4e86\u3002<\/p>\n<button class=\"simplefavorite-button\" data-postid=\"9885\" 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>1.\u901a\u8fc7\u4ea7\u54c1mk\u6587\u4ef6\u4e2d\u7684PRODUCT_COPY_FILES\u5b8f\u5c06\u81ea\u5b9a\u4e49\u7684.rc\u6587\u4ef6\u62f7\u8d1d\u81f3\u6839\u6587\u4ef6\u7cfb\u7edf\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[787],"tags":[],"_links":{"self":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/9885"}],"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=9885"}],"version-history":[{"count":1,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/9885\/revisions"}],"predecessor-version":[{"id":9886,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=\/wp\/v2\/posts\/9885\/revisions\/9886"}],"wp:attachment":[{"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9885"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/xinyiworld.top\/wordpress_it\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}