{"id":8403,"date":"2020-07-22T21:02:28","date_gmt":"2020-07-22T13:02:28","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=8403"},"modified":"2020-07-22T21:02:29","modified_gmt":"2020-07-22T13:02:29","slug":"bootctl","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/bootctl","title":{"rendered":"bootctl\u547d\u4ee4 – \u63a7\u5236\u56fa\u4ef6\u4e0esystemd-boot\u5f15\u5bfc\u7ba1\u7406\u5668"},"content":{"rendered":"\n

bootctl\u80fd\u591f\u68c0\u67e5 EFI \u5f15\u5bfc\u7ba1\u7406\u5668\u72b6\u6001\u3001\u5217\u51fa\u53ef\u7528\u5f15\u5bfc\u7ba1\u7406\u5668\u3001\u5217\u51fa\u542f\u52a8\u9879\uff0c \u8fd8\u80fd\u591f\u5728\u5f53\u524d\u7cfb\u7edf\u4e0a\u5b89\u88c5\u3001\u66f4\u65b0\u3001\u5378\u8f7d\u00a0systemd-boot\u5f15\u5bfc\u7ba1\u7406\u5668\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>bootctl {\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

--path=<\/td>ESP(EFI System Partition)\u7684\u6302\u8f7d\u76ee\u5f55\u3002\u82e5\u672a\u6307\u5b9a\uff0c\u90a3\u4e48\u5c06\u4f9d\u6b21\u68c0\u67e5\u00a0\/efi,\u00a0\/boot,\u00a0\/boot\/efi\u00a0\u76ee\u5f55\u3002 \u5efa\u8bae\u5c3d\u53ef\u80fd\u5c06 ESP \u6302\u8f7d\u5230\u00a0\/boot\u00a0\u76ee\u5f55<\/td><\/tr>
-p,--print-path-<\/td>\u6b64\u9009\u9879\u7528\u4e8e\u6539\u53d8\u00a0status\u00a0\u547d\u4ee4\u7684\u884c\u4e3a\uff0c \u8ba9\u8be5\u547d\u4ee4\u4ec5\u663e\u793a ESP(EFI System Partition) \u7684\u6302\u8f7d\u76ee\u5f55\u4e4b\u540e \u5c31\u7acb\u5373\u9000\u51fa<\/td><\/tr>
--no-variables<\/td>\u5ffd\u7565\u56fa\u4ef6\u4e2d\u7684\u5f15\u5bfc\u7ba1\u7406\u5668\u5217\u8868(\u5b58\u50a8\u5728 EFI \u53d8\u91cf\u4e2d)<\/td><\/tr>
--no-pager<\/td>\u4e0d\u5c06\u7a0b\u5e8f\u7684\u8f93\u51fa\u5185\u5bb9\u7ba1\u9053(pipe)\u7ed9\u5206\u9875\u7a0b\u5e8f<\/td><\/tr>
-h,\u00a0--help<\/td>\u663e\u793a\u7b80\u77ed\u7684\u5e2e\u52a9\u4fe1\u606f\u5e76\u9000\u51fa<\/td><\/tr>
--version<\/td>\u663e\u793a\u7b80\u77ed\u7684\u7248\u672c\u4fe1\u606f\u5e76\u9000\u51fa<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u663e\u793a\u7b80\u8981\u7684\u56fa\u4ef6\u4fe1\u606f\u3001\u672c\u6b21\u542f\u52a8\u6240\u4f7f\u7528\u7684\u5f15\u5bfc\u7ba1\u7406\u5668\u7b49\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~ ]# bootctl status<\/pre>\n\n\n\n

\u66f4\u65b0\u6240\u6709\u5df2\u5b89\u88c5\u7684\u00a0systemd-boot\u00a0\u5f15\u5bfc\u7ba1\u7406\u5668\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# bootctl update<\/pre>\n\n\n\n

\u5c06\u6240\u6709\u5df2\u5b89\u88c5\u7684\u00a0systemd-boot\u00a0\u4ece ESP(EFI system partition) \u4e2d\u5378\u8f7d\uff0c\u5e76\u4e14\u4eceEFI\u5f15\u5bfc\u7ba1\u7406\u5668\u542f\u52a8\u987a\u5e8f\u5217\u8868\u4e2d\u5220\u9664\u5bf9\u5e94\u7684\u9879\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# bootctl remove<\/pre>\n\n\n\n

\u5217\u51fa\u6240\u6709\u7b26\u5408\u00a0Boot Loader Specification\u00a0\u89c4\u8303\u7684 \u53ef\u7528\u542f\u52a8\u9879\u3001\u5f15\u5bfc\u7ba1\u7406\u5668\u81ea\u52a8\u751f\u6210\u7684\u542f\u52a8\u9879\u3001\u4efb\u4f55\u5176\u4ed6\u627e\u5230\u7684\u542f\u52a8\u9879\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# bootctl list<\/pre>\n\n\n\n

\u8bbe\u7f6e\u9ed8\u8ba4\u542f\u52a8\u9879\u3002ID\u00a0\u662f\u4e00\u4e2a\u542f\u52a8\u9879 ID \u6807\u8bc6\u7b26\u3002\u00a0set-oneshot\u00a0\u547d\u4ee4\u4ec5\u4e34\u65f6\u8bbe\u7f6e\u4e0b\u6b21\u542f\u52a8\u6240\u4f7f\u7528\u7684\u9ed8\u8ba4\u542f\u52a8\u9879\uff0c\u800c\u00a0set-default\u00a0\u547d\u4ee4\u5219\u662f\u6c38\u4e45\u8bbe\u7f6e\u9ed8\u8ba4\u542f\u52a8\u9879\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# bootctl set-default\u00a0ID,\u00a0set-oneshot\u00a0ID<\/pre>\n","protected":false},"excerpt":{"rendered":"

bootctl\u80fd\u591f\u68c0\u67e5 EFI \u5f15\u5bfc\u7ba1\u7406\u5668\u72b6\u6001\u3001\u5217\u51fa\u53ef\u7528\u5f15\u5bfc\u7ba1\u7406\u5668\u3001\u5217\u51fa\u542f\u52a8\u9879\uff0c \u8fd8\u80fd\u591f\u5728\u5f53\u524d\u7cfb\u7edf\u4e0a\u5b89\u88c5\u3001\u66f4\u65b0 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8403"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=8403"}],"version-history":[{"count":1,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8403\/revisions"}],"predecessor-version":[{"id":8409,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/8403\/revisions\/8409"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=8403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=8403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=8403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}