{"id":1203,"date":"2018-11-15T19:59:24","date_gmt":"2018-11-15T10:59:24","guid":{"rendered":"https:\/\/www.ish.org\/blog\/?p=1203"},"modified":"2019-04-19T13:55:57","modified_gmt":"2019-04-19T04:55:57","slug":"aio-boot%ef%bc%88%e3%81%9d%e3%81%ae10ubuntu%e3%81%ab%e3%82%88%e3%82%8bclover%e3%81%ae%e7%a0%b4%e5%a3%8a%e3%82%92%e9%98%b2%e6%ad%a2%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.ish.org\/blog\/?p=1203","title":{"rendered":"aio boot\uff08\u305d\u306e10:ubuntu\u306b\u3088\u308bclover\u306e\u7834\u58ca\u3092\u9632\u6b62\uff09"},"content":{"rendered":"<p>aio boot\u3092\u4f7f\u3063\u3066\u3044\u308b\u30de\u30b7\u30f3\u3067ubuntu\u306eupdate\u3092\u884c\u3046\u3068\u3001kernel\u304c\u66f4\u65b0\u3055\u308c\u305f\u308a\u3059\u308b\u6bce\u306befi\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u66f4\u65b0\u3092\u884c\u3044\u3001\u305d\u306e\u7d50\u679cclover\u304c\u8d77\u52d5\u3057\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<!--more--><br \/>\n\u4ee5\u524d\u306f\u3001USB memory\u304b\u3089aio boot\u3057\u3066clover legacy\u3092\u518d\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308c\u3070\u56de\u5fa9\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u5148\u65e5\u3001aio boot\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30a2\u30c3\u30d7\u3092\u884c\u3063\u305f\u3089\u3001\u3053\u308c\u3092\u3084\u3063\u3066\u3082MBR\u3092\u56de\u5fa9\u3057\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u306e\u3067\u3001ubuntu\u3092shutdown\/reboot\u3059\u308b\u969b\u306befi partition\u306eMBR\u3092\u30c1\u30a7\u30c3\u30af\u3057\u3066\u66f8\u304d\u63db\u3048\u3089\u308c\u3066\u3044\u305f\u3089\u623b\u3059\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n\u624b\u9806\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<\/p>\n<p>(1) dd if=\/dev\/sda1 of=\/aio-boot\/sda1 bs=512 count=1\u3067efi\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3(sda1)\u306eMBR\u306e\u5148\u982d512B\u3092\u4e88\u3081\u9000\u907f\u3057\u3066\u304a\u304f\u3002<br \/>\n(2) aio-boot-check\u3068\u3044\u3046shell script\u3092\u4f5c\u308a\u3001\u624b\u52d5\u3067\u3082efi partition\u306eMBR\u3092check\/restore\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3002aio-boot-check\u306e\u5185\u5bb9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3002<br \/>\n<code>#!\/bin\/bash<br \/>\nif [ \"`parted -l \/dev\/sda | sed -En 's\/^\\s*1\\s+.*\\sfat32\\s+EFI system partition\\s+boot, esp.*\/efi\/p'`\" != \"efi\" ]; then<br \/>\n&nbsp;&nbsp;echo \/dev\/sda1 is not efi<br \/>\n&nbsp;&nbsp;exit 255<br \/>\nfi<br \/>\ndd if=\/dev\/sda1 of=\/tmp\/sda1 bs=512 count=1 2&gt;\/dev\/null<br \/>\ncmp -s \/aio-boot\/sda1 \/tmp\/sda1<br \/>\nif [ $? -eq 0 ]; then<br \/>\n&nbsp;&nbsp;echo aio-boot-check OK<br \/>\nelif [ \"$1\" = \"correct\" ]; then<br \/>\n&nbsp;&nbsp;dd if=\/aio-boot\/sda1 of=\/dev\/sda1 2&gt;\/dev\/null<br \/>\n&nbsp;&nbsp;echo aio-boot corrected.<br \/>\n&nbsp;&nbsp;$0<br \/>\nelif [ -z $1 ]; then<br \/>\n&nbsp;&nbsp;echo aio-boot-check NG<br \/>\nelse<br \/>\n&nbsp;&nbsp;echo Usage: $0 [correct]<br \/>\nfi<\/code><br \/>\n(3) \/etc\/init.d\/\u306b\u4ee5\u4e0b\u306eaio-boot\u3092\u4f5c\u6210<br \/>\n<code>#!\/bin\/sh<\/p>\n<p>lock_file=\"\/var\/lock\/subsys\/aio-boot\"<\/p>\n<p>start()<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;touch ${lock_file}<br \/>\n}<\/p>\n<p>stop()<br \/>\n{<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;rm -r ${lock_file}<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;\/root\/bin\/aio-boot-check correct<br \/>\n}<\/p>\n<p>case \"$1\" in<br \/>\n&nbsp;&nbsp;start)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;start<br \/>\n&nbsp;&nbsp;;;<br \/>\n&nbsp;&nbsp;stop)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;stop<br \/>\n&nbsp;&nbsp;;;<br \/>\n&nbsp;&nbsp;*)<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;echo \"Usage: $0 {start|stop}\"<br \/>\n&nbsp;&nbsp;;;<br \/>\nesac<\/p>\n<p>exit 0<\/code><br \/>\n(4) \/etc\/rc?.d\/\u304b\u3089\/etc\/init.d\/aio-boot\u3078symbolic link\u3092\u4f5c\u6210<br \/>\n<code>cd \/etc\/rc0.d &amp;&amp; ln -s ..\/init.d\/aio-boot K00aio-boot<br \/>\ncd \/etc\/rc6.d &amp;&amp; ln -s ..\/init.d\/aio-boot K00aio-boot<br \/>\ncd \/etc\/rc1.d &amp;&amp; ln -s ..\/init.d\/aio-boot S01aio-boot<br \/>\ncd \/etc\/rc2.d &amp;&amp; ln -s ..\/init.d\/aio-boot S01aio-boot<br \/>\ncd \/etc\/rc3.d &amp;&amp; ln -s ..\/init.d\/aio-boot S01aio-boot<br \/>\ncd \/etc\/rc4.d &amp;&amp; ln -s ..\/init.d\/aio-boot S01aio-boot<br \/>\ncd \/etc\/rc5.d &amp;&amp; ln -s ..\/init.d\/aio-boot S01aio-boot<br \/>\ncd \/etc\/rcS.d &amp;&amp; ln -s ..\/init.d\/aio-boot S01aio-boot<\/code><\/p>\n<p><a href=\/blog\/?p=1010>\u305d\u306e9<\/a>\u3078\u623b\u308b\u3000<a href=\/blog\/?p=1416>\u305d\u306e11<\/a>\u3078\u7d9a\u304f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>aio boot\u3092\u4f7f\u3063\u3066\u3044\u308b\u30de\u30b7\u30f3\u3067ubuntu\u306eupdate\u3092\u884c\u3046\u3068\u3001kernel\u304c\u66f4\u65b0\u3055\u308c\u305f\u308a\u3059\u308b\u6bce\u306befi\u30d1\u30fc\u30c6\u30a3\u30b7\u30e7\u30f3\u306e\u66f4\u65b0\u3092\u884c\u3044\u3001\u305d\u306e\u7d50\u679cclover\u304c\u8d77\u52d5\u3057\u306a\u304f\u306a\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,9],"tags":[],"class_list":["post-1203","post","type-post","status-publish","format-standard","hentry","category-linux","category-misc"],"_links":{"self":[{"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1203"}],"version-history":[{"count":15,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1203\/revisions"}],"predecessor-version":[{"id":1420,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1203\/revisions\/1420"}],"wp:attachment":[{"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ish.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}