<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gentoo &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/category/computer/unix/gentoo/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Fri, 19 Dec 2025 17:31:41 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>[Gentoo] 2025 小升級流水帳</title>
		<link>https://blog.richliu.com/2025/12/20/6441/gentoo-2025-%e5%b0%8f%e5%8d%87%e7%b4%9a%e6%b5%81%e6%b0%b4%e5%b8%b3/</link>
					<comments>https://blog.richliu.com/2025/12/20/6441/gentoo-2025-%e5%b0%8f%e5%8d%87%e7%b4%9a%e6%b5%81%e6%b0%b4%e5%b8%b3/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 19 Dec 2025 17:31:37 +0000</pubDate>
				<category><![CDATA[Blog/wiki]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[nft]]></category>
		<category><![CDATA[升級]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=6441</guid>

					<description><![CDATA[<p>都什麼年代了，本來應該不會再寫這種升級流水帳了，不過今天當作日記寫一下吧因為今天有三件大事同時發生，總覺得該紀 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/12/20/6441/gentoo-2025-%e5%b0%8f%e5%8d%87%e7%b4%9a%e6%b5%81%e6%b0%b4%e5%b8%b3/">[Gentoo] 2025 小升級流水帳</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>都什麼年代了，本來應該不會再寫這種升級流水帳了，不過今天當作日記寫一下吧<br />因為今天有三件大事同時發生，總覺得該紀念一下<br />* 五個人的大法官自己只有比總共八人，最低門檻六人少一人，所以可以用緊急事*態做成決議<br />* 台北捷運有一個人丟煙霧彈後殺了三個人，傷了五個人<br />* 我今天才發現 Linux kernel 6.18 已經拿掉 iptables </p>



<span id="more-6441"></span>



<p>大概幾個月前我就發現硬碟有聲音，但是因為使用很正常，所以一直很懶得去處理，大概一個月前才跑去檢查那顆發出聲音，並不是功能影響到我，而是聲音實在讓我太抓狂了。</p>



<p>研究了半天，想說最近 SSD 和 DRAM 都狂漲，剛好看到美亞有黑五特價 Seagate IronWolf Pro 12TB 大概一顆 7500 左右，比 8TB 牌價還便宜，也比我現在用的 Toshiba 大了一倍，再瞄了一下台灣的價格大概都在 11500 左右，想想不想研究了，踩雷就算了吧</p>



<p>訂購中間可以感覺到美亞的落後，光出貨就花了十二天，沒有運貨途中資訊，讓常常買淘寶的我覺得 Amazon 真的是不行，雖然是黑五特價週，但是也太慢了吧</p>



<p>更換的時候我會順便升級系統，就碰到一堆問題</p>



<h2 class="wp-block-heading">Genkernel dmraid 編譯錯誤</h2>



<p>跑 genkernel 會出現  dmraid 的錯誤訊息</p>



<pre class="wp-block-code"><code>misc/file.c: In function 'rw_file':
misc/file.c:64:19: error: initialization of 'ssize_t (*)(void)' {aka 'long int (*)(void)'} from incompatible pointer type 'ssize_t (*)(int,  void *, long unsigned int)' {aka 'long int (*)(int,  void *, long unsigned int)'} &#91;-Wincompatible-pointer-types]
   64 |                 { read, "read"},
      |                   ^~~~
misc/file.c:64:19: note: (near initialization for 'rw_spec&#91;0].func')
In file included from /usr/include/unistd.h:1217,
                 from ./internal.h:24,
                 from misc/file.c:8:
/usr/include/bits/unistd.h:26:1: note: 'read' declared here
   26 | read (int __fd, __fortify_clang_overload_arg0 (void *, ,__buf), size_t __nbytes)
      | ^~~~
misc/file.c:65:19: error: initialization of 'ssize_t (*)(void)' {aka 'long int (*)(void)'} from incompatible pointer type 'ssize_t (*)(int,  const void *, size_t)' {aka 'long int (*)(int,  const void *, long unsigned int)'} &#91;-Wincompatible-pointer-types]
   65 |                 { write, "writ"},
      |                   ^~~~~
misc/file.c:65:19: note: (near initialization for 'rw_spec&#91;1].func')
/usr/include/unistd.h:378:16: note: 'write' declared here
  378 | extern ssize_t write (int __fd, const void *__buf, size_t __n) __wur
      |                ^~~~~
misc/file.c:79:18: error: too many arguments to function 'rw->func'; expected 0, have 3
   79 |         else if (rw->func(fd, buffer, size) != size)
format/ddf/ddf1.c: In function 'check_rd':
format/ddf/ddf1.c:891:25: warning: comparison between 'enum type' and 'enum status' &#91;-Wenum-compare]
  891 |         return rd->type != s_broken;
      |                         ^~
format/ataraid/hpt37x.c: In function 'hpt37x_log':
format/ataraid/hpt37x.c:353:19: warning: taking address of packed member of 'struct hpt37x' may result in an unaligned pointer value &#91;-Waddress-of-packed-member]
  353 |         for (el = hpt->errorlog; el &lt; hpt->errorlog + 32; el++) {
      |                   ^~~</code></pre>



<p>問了 Gemini 和 DeepSeek 後的結果都是</p>



<pre class="wp-block-preformatted">簡單來說，dmraid 這段程式碼非常老舊，它的函數指標定義不嚴謹。在舊版編譯器中，它把函數定義為 (void)（不接受參數）但卻傳入了參數，以前編譯器可能睜一隻眼閉一隻眼，但現在的編譯器（如 GCC 14）預設將這種「指標類型不相容」視為 Error (錯誤) 而不是 Warning，導致編譯失敗。<br /><br />以下是修復方案，你需要修改原始碼中的 misc/file.c 檔案。（下略)</pre>



<p>總之就是花了一點時間找，但是 AI 不識 genkernel ，所以也無從改起，看了一下 genkernel 是採用自己設定 package 自己編的方式，而沒有從 portage 將 patch 拿過來用，所以會 compile 錯誤。不過查了一下 dmraid 最後的 package 是 2010 年 release ，現在應該沒有人用 dmraid ，都是用 mdadm ，之前放在設定檔內應該是相容性的問題，在 /etc/genkernel.conf mark 掉 dmraid 就可以了。</p>



<h2 class="wp-block-heading">init[1]: Id &#8220;f0&#8221; respawning too fast: disabled for 5 minutes</h2>



<p>這個並不是這次升級的錯誤訊息，而是一直出現在我系統內的，問 GPT 的結果是</p>



<pre class="wp-block-preformatted">這通常發生在 /etc/inittab 中定義的某個終端機（TTY）或服務（識別碼為 f0）嘗試啟動但立即失敗，導致 init 陷入不斷重啟的無窮迴圈。<br /><br />1. 找出 f0 是什麼<br />開啟 /etc/inittab 檔案，搜尋 f0 這一行：<br />grep "f0" /etc/inittab<br />常見的內容可能如下： f0:12345:respawn:/sbin/getty 9600 ttyS0<br /><br />2. 常見原因與解決方法<br />序列埠設備不存在 (Serial Port)： 如果 f0 指向的是 /dev/ttyS0（或 ttyUSB0），但該硬體沒插好、驅動沒掛載或在虛擬機中未配置，getty 就會噴錯並結束。<br /><br />解決：若不需要該序列埠，在該行最前面加上 # 註解掉。<br /><br />波特率 (Baud Rate) 錯誤： 設定了硬體不支援的速率。<br /><br />解決：檢查設定是否為正確的 9600 或 115200。<br /><br />執行檔路徑錯誤： /sbin/getty 或指定的程式路徑不存在。<br /><br />解決：確認檔案路徑正確，或改用 agetty。<br /><br />3. 套用變更<br />修改完 /etc/inittab 並存檔後，不需要重新開機，執行以下指令讓 init 重新讀取配置：<br /><br />Bash<br /><br />telinit q</pre>



<p>查了一下果然如此，不過上一代的 GPT 就不知道是什麼，主要是我現在 f0 那一段的 ttyAMA0 不知道為什麼不見了，這個是 ARM 常見的 console ，可能要花時間再查一下問題</p>



<h2 class="wp-block-heading">Linux kernel 6.18 不支援 iptables </h2>



<p>這個我比較崩潰，原來的 kernel 是 6.12 ，換到 6.18 之後感覺天都蹋了，想到我學 iptables 的時候那時候還是 ipchains 的尾聲，想想都快 20 年了，整天與 iptables 為伍，都知道要怎麼下指令和 debug ，但是現在僅僅只有 nft 了，如果你的 iptables 僅有 firewall ，還是可以用 iptables-nft 做轉換，但是如果是有一些特別的指令，像 TCPMSS 之類的，那還是建議改用 nft </p>



<p>還好這年代有 GPT ，直接餵 Gemini 和 DeepSeek ，DeepSeek 吐出來的比較簡潔，所以我就用 DeepSeek 產出的，因為我的網路稍複雜，產生出來的還是有些小問題，不過看了一下就知道怎麼改，問題不大</p>



<p>問題比較大的像是這行，這個 nft 有自己的指令不吃，而且也很難整合進原來的 nft table 內，我碰到的是不知道為什麼 iptables 都會重新產生一次，或是完全無法用，最後還是放棄回去用 nft</p>



<pre class="wp-block-preformatted">$IPTBIN -i $i -A FORWARD -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:1536 -j TCPMSS --clamp-mss-to-pmtu</pre>



<p>還好第二次就比較順了，但是有個奇怪的點是，我的 sysctl 內的 ip forward 設定跑掉了，不知道誰偷偷改了</p>



<p>沒了 iptables 好失落啊，感覺什麼東西離我而去<br />想當年做 Hardware NAT 的時候天天跟 iptables / Linux kernel tcp stack 為伍，我是有感情的<img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f62d.png" alt="😭" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f62d.png" alt="😭" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f62d.png" alt="😭" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f62d.png" alt="😭" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f62d.png" alt="😭" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>其它像什麼 virbr0 消失就要吃自己的狗食了<a href="https://blog.richliu.com/2025/07/27/6345/gentoo-virt-manager-libvirt-virbr0-doesnt-exist/"> [Gentoo] virt-manager/libvirt virbr0 doesn’t exist</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/12/20/6441/gentoo-2025-%e5%b0%8f%e5%8d%87%e7%b4%9a%e6%b5%81%e6%b0%b4%e5%b8%b3/">[Gentoo] 2025 小升級流水帳</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2025/12/20/6441/gentoo-2025-%e5%b0%8f%e5%8d%87%e7%b4%9a%e6%b5%81%e6%b0%b4%e5%b8%b3/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] virt-manager/libvirt virbr0 doesn&#8217;t exist</title>
		<link>https://blog.richliu.com/2025/07/27/6345/gentoo-virt-manager-libvirt-virbr0-doesnt-exist/</link>
					<comments>https://blog.richliu.com/2025/07/27/6345/gentoo-virt-manager-libvirt-virbr0-doesnt-exist/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 27 Jul 2025 12:11:11 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[libvirt]]></category>
		<category><![CDATA[virt-manager]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=6345</guid>

					<description><![CDATA[<p>Once when I reboot the system, system shows, there is n [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/07/27/6345/gentoo-virt-manager-libvirt-virbr0-doesnt-exist/">[Gentoo] virt-manager/libvirt virbr0 doesn&#8217;t exist</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Once when I reboot the system, system shows, there is no virbr0 </p>



<span id="more-6345"></span>



<p>First, check the interface states, default network is inactive</p>



<pre class="wp-block-preformatted"># virsh net-list --all<br /> Name              State    Autostart   Persistent<br />----------------------------------------------------<br /> bridged-network   active   yes         yes<br /> default           inactive yes         yes</pre>



<p>Manual restart, it shows following message</p>



<pre class="wp-block-preformatted"># virsh net-start default<br />error: Failed to start network default<br />error: internal error: Child process (VIR_BRIDGE_NAME=virbr1 /usr/sbin/dnsmasq --conf-file=/var/lib/libvirt/dnsmasq/default.conf --leasefile-ro --dhcp-script=/usr/libexec/libvirt_leaseshelper) unexpected exit status 2:<br />dnsmasq: failed to create listening socket for 192.168.123.1: Address already in use</pre>



<p>The root cause is, when libvirt start the default network, it will also bring up the dnsmasq as dns server, but if this system also has DNS server like named or another dnsmasq service, it will have port conflict. <br />Tried to modify the yaml to assign dnsmasq to another port, but doens&#8217;t work (old configure is to use /etc/dnsmasq.conf, but seems it will use default.xml after update the libvirt )</p>



<p>add <code><strong>&lt;dns enable="no"/></strong></code> to default network setting can solve this issue, ex:</p>



<pre class="wp-block-preformatted"># virsh net-edit default<br /><br />&lt;network><br />  &lt;name>default&lt;/name><br />  &lt;uuid>cdf10e75-0299-43b5-8c93-e6943e261ef3&lt;/uuid><br />  &lt;forward mode='nat'/><br />  &lt;bridge name='virbr0' stp='on' delay='0'/><br />  &lt;mac address='52:54:00:66:c4:a3'/><br />  <strong>&lt;dns enable='no'/></strong><br />  &lt;ip address='192.168.122.1' netmask='255.255.255.0'><br />    &lt;dhcp><br />      &lt;range start='192.168.122.2' end='192.168.122.254'/><br />    &lt;/dhcp><br />  &lt;/ip><br />&lt;/network></pre>



<p>ref. <br />https://serverfault.com/questions/937188/disable-or-change-port-of-dnsmasq-service-in-libvirt</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/07/27/6345/gentoo-virt-manager-libvirt-virbr0-doesnt-exist/">[Gentoo] virt-manager/libvirt virbr0 doesn&#8217;t exist</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2025/07/27/6345/gentoo-virt-manager-libvirt-virbr0-doesnt-exist/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Gentoo ARM64 Altra Compile chromium Issue</title>
		<link>https://blog.richliu.com/2024/10/10/6052/gentoo-arm64-altra-compile-chromium-issue/</link>
					<comments>https://blog.richliu.com/2024/10/10/6052/gentoo-arm64-altra-compile-chromium-issue/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 09 Oct 2024 17:22:12 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[AltraMax]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[arm64]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=6052</guid>

					<description><![CDATA[<p>When compile the chromium on my Altra platform, it meet [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/10/10/6052/gentoo-arm64-altra-compile-chromium-issue/">Gentoo ARM64 Altra Compile chromium Issue</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>When compile the chromium on my Altra platform, it meet compile problem like this</p>



<span id="more-6052"></span>



<pre class="wp-block-preformatted">no-dangling-assignment-gsl -std=c++20 -Wno-trigraphs -gsimple-template-names -fno-exceptio00:01:51 [472/19443]
nc++ -isystem../../third_party/libc++/src/include -isystem../../third_party/libc++abi/src/include -fvisibility
-inlines-hidden -O2 -pipe -march=armv8.2-a -Wno-unknown-warning-option -c ../../third_party/libyuv/source/comp
are_neon64.cc -o obj/third_party/libyuv/libyuv_neon/compare_neon64.o
../../third_party/libyuv/source/compare_neon64.cc:175:8: error: instruction requires: dotprod
  175 |       "udot        v4.4s, v0.16b, v6.16b         \n"
      |        ^
&lt;inline asm>:14:1: note: instantiated into assembly here
   14 | udot        v4.4s, v0.16b, v6.16b
      | ^
../../third_party/libyuv/source/compare_neon64.cc:176:8: error: instruction requires: dotprod
  176 |       "udot        v5.4s, v1.16b, v6.16b         \n"
      |        ^
&lt;inline asm>:15:1: note: instantiated into assembly here
   15 | udot        v5.4s, v1.16b, v6.16b
      | ^
../../third_party/libyuv/source/compare_neon64.cc:204:8: error: instruction requires: dotprod
  204 |       "udot        v4.4s, v0.16b, v0.16b         \n"
      |        ^
&lt;inline asm>:10:1: note: instantiated into assembly here
   10 | udot        v4.4s, v0.16b, v0.16b
      | ^
../../third_party/libyuv/source/compare_neon64.cc:205:8: error: instruction requires: dotprod
  205 |       "udot        v5.4s, v1.16b, v1.16b         \n"
      |        ^
&lt;inline asm>:11:1: note: instantiated into assembly here
   11 | udot        v5.4s, v1.16b, v1.16b
      | ^
4 errors generated.
[10940/63891] aarch64-unknown-linux-gnu-clang++-18 -MD -MF obj/third_party/libyuv/libyuv_neon/rotate_neon.o.d</pre>



<p>Seems because some -march/-mcpu/-mtune drop &#8216;dotprod&#8217; parameters, it needs to add the extension manuall. &#8216;+dotprod&#8217;.</p>



<p>Edit the file /etc/portage/make.conf, and change the COMMON_FLAGS to </p>



<pre class="wp-block-preformatted">COMMON_FLAGS="-mcpu=neoverse-n1+crc+crypto+ssbs+dotprod -O2 -pipe"</pre>



<p>It can use the following command to get current CPU flag</p>



<pre class="wp-block-preformatted">gcc -v -E -x c /dev/null -o /dev/null -march=native -mcpu=native 2>&amp;1 | grep /cc1</pre>



<p>Thanks Gentoo user zukunf to provide those information. </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/10/10/6052/gentoo-arm64-altra-compile-chromium-issue/">Gentoo ARM64 Altra Compile chromium Issue</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/10/10/6052/gentoo-arm64-altra-compile-chromium-issue/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ampere Altra ARM64 Grub Cannot Output Message To Serial Console</title>
		<link>https://blog.richliu.com/2024/03/08/5866/ampere-altra-arm64-grub-cannot-output-message-to-serial-console/</link>
					<comments>https://blog.richliu.com/2024/03/08/5866/ampere-altra-arm64-grub-cannot-output-message-to-serial-console/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 08 Mar 2024 11:35:47 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[grub]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5866</guid>

					<description><![CDATA[<p>This issue is a little bit anomalous. Different boards  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/03/08/5866/ampere-altra-arm64-grub-cannot-output-message-to-serial-console/">Ampere Altra ARM64 Grub Cannot Output Message To Serial Console</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This issue is a little bit anomalous. Different boards and different combinations have different results.</p>



<p>For current ARM64 systems, most of the time they will use the serial console as the debug console. So, when there is no output from the serial console, it confuses me.</p>



<span id="more-5866"></span>



<p>CPU: Ampere Altra Family<br />Board: AsRock ALTRAD8UD<br />For example, on my Gentoo system, only need to configure /etc/default/grub to following configuration.</p>



<pre class="wp-block-preformatted">GRUB_TIMEOUT=30
GRUB_TIMEOUT_STYLE=menu
GRUB_CMDLINE_LINUX_DEFAULT="domdadm console=ttyAMA0 pcie_aspm=off"
GRUB_TERMINAL=console</pre>



<p>Output to serial console will be no problem, but on the Ubuntu 22.04, it cannot output to serial console. </p>



<p>So, on Ubuntu, if you only can see grub menu on VGA and cannot see it on serial console, try this configuration, it will output to serial console and VGA console at the same time.</p>



<pre class="wp-block-preformatted">GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=10
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
</pre>



<p>Don&#8217;t forget to update grub.cfg</p>



<pre class="wp-block-preformatted">update-grub2</pre>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1377" height="808" src="https://blog.richliu.com/wp-content/uploads/2024/03/image-8.png" alt="" class="wp-image-5906" srcset="https://blog.richliu.com/wp-content/uploads/2024/03/image-8.png 1377w, https://blog.richliu.com/wp-content/uploads/2024/03/image-8-600x352.png 600w, https://blog.richliu.com/wp-content/uploads/2024/03/image-8-768x451.png 768w, https://blog.richliu.com/wp-content/uploads/2024/03/image-8-816x479.png 816w" sizes="(max-width: 1377px) 100vw, 1377px" /></figure>



<p>ref.<br />https://help.ubuntu.com/community/SerialConsoleHowto</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/03/08/5866/ampere-altra-arm64-grub-cannot-output-message-to-serial-console/">Ampere Altra ARM64 Grub Cannot Output Message To Serial Console</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/03/08/5866/ampere-altra-arm64-grub-cannot-output-message-to-serial-console/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>apt-cacher-ng E: Failed to fetch 503 Connection closed, check DlMaxRetries</title>
		<link>https://blog.richliu.com/2024/02/04/5764/apt-cacher-ng-e-failed-to-fetch-503-connection-closed-check-dlmaxretries/</link>
					<comments>https://blog.richliu.com/2024/02/04/5764/apt-cacher-ng-e-failed-to-fetch-503-connection-closed-check-dlmaxretries/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 04 Feb 2024 01:03:35 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5764</guid>

					<description><![CDATA[<p>When run apt-cacher-ng, and client will apper message l [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/04/5764/apt-cacher-ng-e-failed-to-fetch-503-connection-closed-check-dlmaxretries/">apt-cacher-ng E: Failed to fetch 503 Connection closed, check DlMaxRetries</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>When run apt-cacher-ng, and client will apper message like this and failed to download packages via apt-cacher-ng</p>



<span id="more-5764"></span>



<pre class="wp-block-preformatted">E: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/pool/main/c/curl/libcurl3-gnutls_7.81.0-1ubu<br />ntu1.15_arm64.deb 503 Connection closed, check DlMaxRetries [IP: 192.168.1.254 3142]</pre>



<p>The reason is the system file open limit, it needs to modify it, it needs to modify file /etc/security/limits.conf and add those lines </p>



<p>apt-cacher-ng soft nofile 102400<br />apt-cacher-ng hard nofile 102400</p>



<p>If your system is heavy loading server, it can increase those numbers, and not existed the system cat /proc/sys/fs/nr_open setting. </p>



<p>Write the limit nofile to /etc/init.d/apt-cacher-ng doesn&#8217;t work for me. </p>



<p>ref.<br /><a href="https://askubuntu.com/questions/590151/unable-to-download-anything-from-apt-cacher-ng-proxy" target="_blank" rel="noopener">Unable to download anything from apt-cacher-ng proxy</a><br /><a href="https://stackoverflow.com/questions/19995855/increase-max-open-files-for-ubuntu-upstart-initctl" target="_blank" rel="noopener">Increase max open files for Ubuntu/Upstart (initctl)</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/04/5764/apt-cacher-ng-e-failed-to-fetch-503-connection-closed-check-dlmaxretries/">apt-cacher-ng E: Failed to fetch 503 Connection closed, check DlMaxRetries</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/02/04/5764/apt-cacher-ng-e-failed-to-fetch-503-connection-closed-check-dlmaxretries/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] Upgrade From x64 to ARM64</title>
		<link>https://blog.richliu.com/2024/02/03/5761/gentoo-upgrade-from-x64-to-arm64/</link>
					<comments>https://blog.richliu.com/2024/02/03/5761/gentoo-upgrade-from-x64-to-arm64/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 03 Feb 2024 14:53:39 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[virt-manager]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5761</guid>

					<description><![CDATA[<p>Describe how to move Gentoo x64 to ARM64 platform. </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/03/5761/gentoo-upgrade-from-x64-to-arm64/">[Gentoo] Upgrade From x64 to ARM64</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>時隔多年，終於又迎來一次大升級，之前寫過幾篇升級的文章，像是<br />電腦升級 <a href="https://blog.richliu.com/2015/08/06/1827/%e9%9b%bb%e8%85%a6%e5%8d%87%e7%b4%9a-i7-5775c-asus-z97-ausb3-1/">i7 5775c + ASUS Z97-A/USB3.1</a> : 後來 Desktop 還升級了二次，一次是換 i5-9600K，中間還買了 2080 ，最近一次是換 AMD 7900，又買了一張 3090 （當然是買前生產力買後遊戲機），不過因為懶得寫就沒記錄了<br /><a href="https://blog.richliu.com/2013/12/26/1583/gentoo-%e9%9b%bb%e8%85%a6%e5%8d%87%e7%b4%9a%e6%a1%88-32bit-64bit-linux/">[Gentoo] 電腦升級案 32bit -> 64bit Linux</a> : 十年前的升級紀錄，和本篇要寫的文章很像，不過這次就是升級到不同平台架構的機器上了<br /><a href="https://blog.richliu.com/2006/10/17/366/%e5%b1%b1%e5%af%a8%e6%9b%b4%e6%96%b0%e8%a8%98%e9%8c%84/">山寨更新記錄</a> : 早年 BBS 的更新紀錄，現在的話就不會用這種 Raid 盒，都是改用 Software Raid ，便宜！</p>



<p>這次升級要從 x64 平台升級到 ARM64 平台，雖然目前 Linux 下 ARM64 支援度還是不錯，但是兩個平台能用的東西還是有差異，主要是紀錄一下升級過程中有什麼需要注意的事情</p>



<span id="more-5761"></span>



<h2 class="wp-block-heading">ARM64 Hardware Prepareation </h2>



<p>CPU Board: Ampere Altra CPU + AsRock ALTRAD8U : 這個組合現在已經能在 <a href="https://www.newegg.com/p/N82E16813140134" target="_blank" rel="noopener">newegg </a>上買到了，也是目前最強大的 ARM64 平台，當 homelab 平台非常適合<br /><br />DRAM: 買這種主機板用的都是 RDIMM ，有可能便宜有可能貴，可以查 Gigabyte 的 QVL List[<a href="https://www.gigabyte.com/tw/Enterprise/Rack-Server/R152-P33-rev-100#Support-QvlPdfSupportList" target="_blank" rel="noopener">Ref</a>] 內的 DRAM list 購買，有朋友就是在日本買到DDR4 2933 32GB RDIMM 一隻5000羊的DDR，目前匯率 NT$1,100.- 非常便宜<br /><br />Network: AsRock ALTRAD8U 有 1*Intel i210 Ethernet 和 2*10G Intel x550 Ethernet ，這部份到不是問題，我另外拿了舊的 Intel x540 4 Port ethernet 當小 switch 用<br /><br />SATA:  這種板子預設都沒有 SATA interface 了，所以要買 SATA 卡，有 PCIe 轉 SATA ，這個要注意 PCIe bandwidth 和 SATA 數量，一分錢一份貨。<br />如果要追求速度，淘寶上也可以買到便宜 SAS 外接 SATA ，淘寶的 LSI SAS 8port internal 卡大部份 NT$2500 到 NT$6000 都有，記得買轉接線要看好規格，SAS 接頭的規格很多，一不小心就會弄錯<br /><br />SSD: 板子上介面有 2* M.2 2280，如果覺得不夠，可以買 OCU 轉 U.2 轉接線，或是還有 PCIe slot ，可以買 PCIe 轉 M.2 都可以。但是 U.2 的硬碟不一定好買，而且常常價位偏高，但是相對上是比較便宜的選擇</p>



<h2 class="wp-block-heading">Software Move To ARM64 Platform </h2>



<h3 class="wp-block-heading">QEMU/Libvirt</h3>



<p>這部份應該是最難的部份，不過理論上也不是不可以，我原來是 VirtualBox ，但是 ARM64 沒有 VirtualBox ，只有 Proxmox 有，剛看了一下，還支援 riscv64,loongarch64 [<a href="https://github.com/jiangcuo/Proxmox-Port" target="_blank" rel="noopener">ref</a>]，不過我個人不太想再學一套，所以還是用 virt-manager/libvirtd 這套，一般用途 virt-manager 和 libvirtd 應該也很夠用了。</p>



<p>目前用到現在都可以用，Ubuntu 22.04，Windows 10 for x86，Windows 11 for ARM，安裝沒什麼問題。只有 Windows 10 for x86 非常慢，慢到我不想再開了，不知道為什麼。</p>



<p><strong>Qemu bridge devices</strong>: 這個應該是問題，如果是以前用 VirtualBox ，可以直接選 NIC card interface ，但是 virt-manager 似乎沒這個選項，所以要直接設定到 bridge device，不過影響不是很大，就只是設定一個 bridge device，然後將 host internet ethernet port device 綁上去就好了</p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" width="824" height="383" src="https://blog.richliu.com/wp-content/uploads/2024/02/image-12.png" alt="" class="wp-image-5762" style="aspect-ratio:2.151436031331593;width:784px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/image-12.png 824w, https://blog.richliu.com/wp-content/uploads/2024/02/image-12-600x279.png 600w, https://blog.richliu.com/wp-content/uploads/2024/02/image-12-768x357.png 768w" sizes="(max-width: 824px) 100vw, 824px" /></figure></div>


<p>其他可能是如果 Libvirt 要用 graphic 輸出，不能用 qxl ，只能用 VGA or ramfb ，尤其是 windows 只能用 ramfb，如果 Guest 是 Linux 可以用 VGA ，顯示比較正常，如果連 GUI 都沒有，就直接看 console 輸出吧，問題更少</p>



<h3 class="wp-block-heading">Qemu file sharing </h3>



<p>QEMU 支援 virtiofs ，不過這個功能在 gentoo 內 ARM64 是不能用的，因為不能用，所以我也不知道 x64 那邊會有什麼限制<br />另外一個是 virtio-9p ，這個缺點是分享進 VM  之後，沒辦法使用 user 權限存取，用 root 身份限制也很多，像是存取 non-root user 檔案會有問題[<a href="https://serverfault.com/questions/559726/kvm-guest-cannot-write-to-9p-share-owned-by-non-root" target="_blank" rel="noopener">ref</a>]<br /><br />有其他需求的人可以考慮改用 samba or nfs ，但是效能就會大大下降了，這點可能是有效能需求的人要考量的</p>



<h3 class="wp-block-heading">Firewall </h3>



<p>原來的 Firewall script 似乎沒辦法和 Libvirt 一起工作，我又不想修改，最後比較簡單的作法就是在我的 script 執行完之後，再重啟 libvirtd ，這樣就正常了。<br />正常後別忘了執行 /etc/init.d/iptables save 儲存，這樣重開機之後才會正常執行 firewall rule. </p>



<h3 class="wp-block-heading">Docker</h3>



<p>試了一下似乎沒什麼問題，但是目前沒什麼要跑的 APP ，所以應該測不出什麼<br />不過之前 arm64 k8s docker [<a href="https://blog.richliu.com/2023/09/17/5329/arm64-kubernetes-qemu-metallb-linkerd-numa/">ref</a>]都跑過了，應該踩雷的機會低很多</p>



<h3 class="wp-block-heading">Other Software</h3>



<p>在 Linux 下轉移到 ARM64 平台問題不大，大部份的 software 都是安裝之後 copy 過去<br />就算是在系統上有資料的 mysql 和 apache 都是這樣</p>



<p>這次我用了一個方式轉移 configuration files<br />1. 將要轉移的程式設定檔 commit 到 git server <br />2. 從新機器將 git server 拉回來 configuration files <br />3. diff 之後將新的設定套上去<br /><br />因為我是 gentoo 玩家，gentoo 升級 packages 常常需 merge configuration files 了，所以這個轉移的過程不難，只是很耗費時間而已。不過因此絕大部份的設定檔都沒有問題，反而是少數系統本身自帶的設定檔反而怪怪的</p>



<h3 class="wp-block-heading">KDE</h3>



<p>之前我都遠端跑 vnc + kde ，不過 Gentoo 有個 BUG 就是 plasmashell 的 CPU usage 會很高<br />這次換 virt-manager 之後可以用 ssh remote control VM，發現這個方式還不錯，反正我也只有用到這個功能，KDE 等有需求的時候再開 vnc 就好了，平時是不需要開的</p>



<h2 class="wp-block-heading">搬移步驟</h2>



<p>1. 備份系統碟，以備不時之需<br />2. 重新規劃電腦的網路卡，如果只有一張就直接設成 bridge interface <br />3. software raid 的部份可以參考自己之前的文章 <a href="https://blog.richliu.com/2011/05/16/1078/linux-software-raid-%E7%B3%BB%E7%B5%B1%E8%BD%89%E7%A7%BB/">Linux Software Raid 系統轉移</a><br />4. UEFI 的部份可以參考自己之前的文章<a href="https://blog.richliu.com/2020/07/09/4295/gentoo-arm64-uefi-install-guide/"> Gentoo ARM64 UEFI Install Guide</a><br />5. 搬移 APPs<br />5.1 重要的 APP 才要搬資料，ex: Web, mysql <br />5.2 不重要的 APP 只要搬設定檔，ex: apt-cache-ng, squid 等等<br />5.3 如果是切換平台，要確定 VM 沒問題才能切</p>



<h2 class="wp-block-heading">Known Issues </h2>



<h3 class="wp-block-heading">IPv6 Default Router</h3>



<p>不知道為什麼，在 wan 的 bridge interface 會增加一個 default route fe80::1 ，這個設定會讓 IPv6 失效，後來解決方式是在 LAN 端加上一個 IP address fe80::1 才解決</p>



<h3 class="wp-block-heading">efi boot </h3>



<p>因為我系統碟是做 software raid  ，每次編完 kernel 再 update grub 時，記得 efi boot 時有時會 fail ，試著將兩顆 nvme 都 mount 上來加上再安裝一次 efi partition 似乎才會正常，找了一下沒找到原因，不管了，反正能動就好</p>



<pre class="wp-block-preformatted">grub-mkconfig -o /boot/grub/grub.cfg
umount /boot/efi
mount /dev/nvme0n1p1 /boot/efi
grub-install --target=arm64-efi --efi-directory=/boot/efi --bootloader-id=Gentoo
umount /boot/efi
mount /dev/nvme1n1p1 /boot/efi
grub-install --target=arm64-efi --efi-directory=/boot/efi --bootloader-id=Gentoo
umount /boot/efi
</pre>



<p>ref.<br />None</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/03/5761/gentoo-upgrade-from-x64-to-arm64/">[Gentoo] Upgrade From x64 to ARM64</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/02/03/5761/gentoo-upgrade-from-x64-to-arm64/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo][ARM64] Compile qtwebengine fail</title>
		<link>https://blog.richliu.com/2021/03/23/4428/gentooarm64-compile-qtwebengine-fail/</link>
					<comments>https://blog.richliu.com/2021/03/23/4428/gentooarm64-compile-qtwebengine-fail/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Tue, 23 Mar 2021 13:33:11 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Gentoo]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=4428</guid>

					<description><![CDATA[<p>&#8220;ninja: build stopped: subcommand failed&#8221;If [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2021/03/23/4428/gentooarm64-compile-qtwebengine-fail/">[Gentoo][ARM64] Compile qtwebengine fail</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><br />&#8220;ninja: build stopped: subcommand failed&#8221;<br />If system has many CPU cores, compile some package like qtwebengine will fail, seems ninja compile issues. </p>



<p>it better to reduce CPU number under 8, batter number is 4 or 6. </p>



<p>just put MAKEOPTS=&#8221;-j 4&#8243; on your /etc/portage/make.conf </p>



<p>It can be roll back after compile qtwebengine. </p>



<p>modify <a rel="noreferrer noopener" href="https://wiki.gentoo.org/wiki//etc/portage/package.env" data-type="URL" data-id="https://wiki.gentoo.org/wiki//etc/portage/package.env" target="_blank">package.env</a> can support special MAKEOPTS command on some packages. <br />ex:</p>



<pre class="wp-block-code"><code>echo "dev-qt/qtwebengine lowcpu.conf" | sudo tee -a /etc/portage/package.env
mkdir -p /etc/portage/env
echo "MAKEOPTS=\"-j4\"" | sudo tee /etc/portage/env/lowcpu.conf</code></pre>



<p>ref.<br /><a href="https://forums.gentoo.org/viewtopic-t-1057526-start-0-postdays-0-postorder-asc-highlight-.html?sid=a2beb23f6b58570b502c87ba590044f3" target="_blank" rel="noopener">[SOLVED] emerging qtwebengine-5.7.1</a><br /><a href="https://linux-tips.com/t/memory-problems-on-qtwebengine-build/761" target="_blank" rel="noopener">Memory problems on QtWebEngine build</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2021/03/23/4428/gentooarm64-compile-qtwebengine-fail/">[Gentoo][ARM64] Compile qtwebengine fail</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2021/03/23/4428/gentooarm64-compile-qtwebengine-fail/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Gentoo ARM64 UEFI Install Guide</title>
		<link>https://blog.richliu.com/2020/07/09/4295/gentoo-arm64-uefi-install-guide/</link>
					<comments>https://blog.richliu.com/2020/07/09/4295/gentoo-arm64-uefi-install-guide/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 09 Jul 2020 04:43:38 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[uefi]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=4295</guid>

					<description><![CDATA[<p>This is not a detail guide to describe how to full inst [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2020/07/09/4295/gentoo-arm64-uefi-install-guide/">Gentoo ARM64 UEFI Install Guide</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This is not a detail guide to describe how to full install system, just figure out some important point. Even not for Gentoo newbie. <br /><br />Most important handbook is<a rel="noreferrer noopener" aria-label=" Gentoo AMD64 installation guide. (opens in a new tab)" href="https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation#Manual_network_configuration" target="_blank"> Gentoo AMD64 installation guide.</a> <br />There is some different between ARM64 and AMD64<br /></p>



<p>2021/08/31 Updated : No more need Ubuntu ISO image, ARM64 EFI minimal ISO can be download from official website: https://www.gentoo.org/downloads/</p>



<span id="more-4295"></span>



<p>Some ARM64 platform support UEFI bios system, like Ampere Computing Altea or Marvell ThunderX. <br />Recently Linux like CentOS or Ubuntu can support both system, but not for Gentoo ARM64 project, <br />if you want to install Gentoo on ARM64 bare system, it needs some trick skill. </p>



<h3 class="wp-block-heading">Install System</h3>



<p>Gentoo ARM64 install, it needs to relay on other OS&#8217;s installation software. <br />I were using Ubuntu/Debain net-inst to install system, below is my nvme driver partition table.<br /><br />/dev/nvme0n1p1  (bootloader/efi)    500MB    for EFI only <br />/dev/nvme0n1p2  /                                800G       for Gentoo system <br />/dev/nvme0n1p3  /                                 90G        for Ubuntu system <br /><br />Suggest to keep a ubuntu system for booting, it can be rescue system when fail to boot Gentoo system. <br /><br />After Ubuntu/Debian installed system, it can go back to installation menu, there is a execute shell on menu, run it. </p>



<h3 class="wp-block-heading">Decompress Gentoo Stage3 File. </h3>



<p>Most challenge thing is, Ubuntu/Debian installation rootfs, there is no unbzip function, that&#8217;s means it needs to use installed disk and used the Ubuntu system&#8217;s bzip2. below is my command to untar it. </p>



<pre class="wp-block-code"><code># use gentoo iso cdrom boot
# mount /dev/nvme0n1p3 /mnt/gentoo
# cd /mnt/gentoo
# wget https://bouncer.gentoo.org/fetch/root/all/releases/arm64/autobuilds/20210829T233646Z/stage3-arm64-systemd-20210829T233646Z.tar.xz
# tar xvf stage3-arm64-systemd-20210829T233646Z.tar.xz
# mount --bind /proc proc
# mount --bind /dev dev
# mount --bind /sys sys
# mount --bind /sys/firmware/efi/efivars/ ./sys/firmware/efi/efivars/
# cp /etc/resolv.conf /mnt/gentoo/etc/
# cd ..
# chroot gentoo 

&gt;&gt;&gt;&gt; chroot to ubuntu 
# mkdir  -p /mnt/gentoo
# mount /dev/nvme0n1p2 /mnt/gentoo 
# cd /mnt/gentoo 
# wget http://distfiles.gentoo.org/experimental/arm64/stage3-arm64-systemd-20190925.tar.bz2
# tar xvzf stage3-arm64-systemd-20190925.tar.bz2
# mount --bind /proc proc
# mount --bind /dev dev
# mount --bind /sys sys
# cp /etc/resolv.conf /mnt/gentoo/etc/
# cd ..
# chroot gentoo</code></pre>



<p>Yaa.. We got Gentoo file system . </p>



<h3 class="wp-block-heading">Gentoo Kernel</h3>



<p>Suppose that reader know how to configure hostname , fstab, emerge &#8211;sync &#8230; etc.<br /><br />Next step is to install Gentoo kernel, I will show how to use genkernel to generate workable kernel for ARM64 system <br /><br />*Note: Some install command might need to unmask or add accept keyword, will ignore that, please try add &#8220;&#8211;autounmask-write&#8221; and run command &#8220;etc-update&#8221; to update it.</p>



<pre class="wp-block-code"><code># mkdir -p /boot/efi
# mount /dev/nvme0n1p1 /boot/efi
# echo 'GRUB_PLATFORMS="efi-64"' &gt;&gt; /etc/portage/make.conf
# emerge --ask sys-boot/grub:2
# emerge efibootmgr
# grub-install --target=arm64-efi --efi-directory=/boot/efi --bootloader-id=Gentoo</code></pre>



<p>If have problem on the stage, and it shows cannot find /dev/md0, it needs to emerge mdadm package.</p>



<p>Compile Linux Kernel</p>



<pre class="wp-block-code"><code># emerge gentoo-sources 
# emerge genkernel
# genkernel --menuconfig all</code></pre>



<p>genkernel will let you choice kernel configure before compile it. Please enable those options, Gentoo kernel didn&#8217;t enable ARM&#8217;s serial port by default. </p>



<pre class="wp-block-code"><code>Device Drivers  ---&gt;
	Character devices  ---&gt;
		Serial drivers  ---&gt;
			 &lt;*&gt; ARM AMBA PL010 serial port support
			&#91;*]   Support for console on AMBA serial port
			 &lt;*&gt; ARM AMBA PL011 serial port support
			&#91;*]   Support for console on AMBA serial port
                        &#91;*] Early console using ARM semihosting
</code></pre>



<p>Save it and quit. <br /><br />Next step is edit /etc/default/grub and add &#8220;console==ttyAMA0&#8221; to /etc/default/grub</p>



<pre class="wp-block-preformatted">GRUB_CMDLINE_LINUX_DEFAULT="console=ttyAMA0"</pre>



<p>Update grub.conf </p>



<p> grub-mkconfig -o /boot/grub/grub.cfg </p>



<h3 class="wp-block-heading"> Check UEFI Boot Priority </h3>



<p>Run efibootmgr and get boot priority </p>



<pre class="wp-block-code"><code># efibootmgr
BootCurrent: 0003
Timeout: 5 seconds
BootOrder: 0003,0001,0002,0004
Boot0001* ubuntu
Boot0002* UEFI: PXE IP4 Intel(R) Ethernet Server Adapter I210-T1
Boot0003* Gentoo
Boot0004* UEFI: Built-in EFI Shell</code></pre>



<p>It can see current boot and boot order here , if Gentoo is not first priority, it can use option &#8220;-o&#8221; to update it. </p>



<p></p>



<h3 class="wp-block-heading">Other</h3>



<p>if you choice systemd as your service manager, after install openssh, please run command below to activate it and as default service. </p>



<pre class="wp-block-code"><code># systemctl enable sshd.service
# systemctl start sshd.service
# systemctl status sshd.service</code></pre>



<h3 class="wp-block-heading">Conclusion</h3>



<p>I have write down my note here, good luck to you if you have the same question then get this webpage. </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2020/07/09/4295/gentoo-arm64-uefi-install-guide/">Gentoo ARM64 UEFI Install Guide</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2020/07/09/4295/gentoo-arm64-uefi-install-guide/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Gentoo ARM64 Docker Image</title>
		<link>https://blog.richliu.com/2019/08/02/4049/gentoo-arm64-docker-image/</link>
					<comments>https://blog.richliu.com/2019/08/02/4049/gentoo-arm64-docker-image/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 02 Aug 2019 07:43:30 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[docker]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=4049</guid>

					<description><![CDATA[<p>There is a long time no article about gentoo on my blog [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/08/02/4049/gentoo-arm64-docker-image/">Gentoo ARM64 Docker Image</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>There is a long time no article about gentoo on my blog. <br /><br />Today, I have a whim to do a gentoo ARM64 docker image, so, we have this article. </p>



<div class="wp-block-image"><figure class="alignright is-resized"><img decoding="async" src="https://blog.richliu.com/wp-content/uploads/2019/08/擷取-1024x478.png" alt="" class="wp-image-4050" width="309" height="143" srcset="https://blog.richliu.com/wp-content/uploads/2019/08/擷取-1024x478.png 1024w, https://blog.richliu.com/wp-content/uploads/2019/08/擷取-300x140.png 300w, https://blog.richliu.com/wp-content/uploads/2019/08/擷取-768x359.png 768w, https://blog.richliu.com/wp-content/uploads/2019/08/擷取.png 1441w" sizes="(max-width: 309px) 100vw, 309px" /></figure></div>



<p>Please understand that ARM64 Gentoo is experimental, and might be different after a while. </p>



<span id="more-4049"></span>



<p>First, we can start from stage3 file, it would be easy to create it. if you don&#8217;t know what is stage3 file, I think you should leave this page and learn gentoo from scratch. <br />it can download arm64 stage3 file from here<br /> <a href="https://gentoo.osuosl.org/experimental/arm64/" target="_blank" rel="noopener">https://gentoo.osuosl.org/experimental/arm64/</a> <br />and extract it to a new directory. <br /><br />if cannot download file from URL address above, please visit URL above to fetch latest stage3 files.</p>



<pre class="wp-block-preformatted">wget https://gentoo.osuosl.org/experimental/arm64/stage3-arm64-20190613.tar.bz2
mkdir gentoo 
cd gentoo 
sudo tar xf ../stage3-arm64-20190613.tar.bz2</pre>



<p>it can modify something in this directory. </p>



<p>Next step is create first docker image, it will contain all stage3 files. </p>



<pre class="wp-block-preformatted">cd ..
sudo tar -C gentoo -c . | docker import - gentoo</pre>



<p>Please create a directory with a file named &#8220;dockerfile&#8221;, and contain following text.</p>



<pre class="wp-block-preformatted">FROM gentoo
RUN mkdir -p /var/run/sshd
RUN ssh-keygen -f /etc/ssh/ssh_host_rsa_key
RUN ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
RUN echo 'root:root' |chpasswd # echo password | passwd --stdin root
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i '/pam_loginuid.so/c session optional pam_loginuid.so' /etc/pam.d/sshd
RUN echo "export VISIBLE=now" >> /etc/profile
EXPOSE 22
CMD /usr/sbin/sshd -D </pre>



<p>Now, create a gentoo docker image </p>



<pre class="wp-block-preformatted">docker build -t gentoo_sshd ./</pre>



<p>Run a new instance with this gentoo docker image </p>



<pre class="wp-block-preformatted">docker run -d --privileged=true --name gentootest -v /work:/work -p 40001:22 -P gentoo_sshd</pre>



<p>Now, it can use ssh to login this system and run it, password is root.</p>



<pre class="wp-block-code"><code>ssh -p 40001 root@localhost</code></pre>



<p>Ref<br /><a href="https://blog.richliu.com/2017/12/24/2199/build-sdk-in-docker">Build SDK in Docker</a><br /><a href="https://docs.docker.com/develop/develop-images/baseimages/" target="_blank" rel="noopener">Create a base image</a><br /><a href="https://gentoo.osuosl.org/experimental/arm64/" target="_blank" rel="noopener">https://gentoo.osuosl.org/experimental/arm64/</a> <br />Thanks gyakovlev in irc channel . </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/08/02/4049/gentoo-arm64-docker-image/">Gentoo ARM64 Docker Image</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2019/08/02/4049/gentoo-arm64-docker-image/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] Moved to eudev from udev</title>
		<link>https://blog.richliu.com/2019/01/19/3406/gentoo-moved-to-eudev-from-udev/</link>
					<comments>https://blog.richliu.com/2019/01/19/3406/gentoo-moved-to-eudev-from-udev/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 19 Jan 2019 01:42:51 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[eudev]]></category>
		<category><![CDATA[udev]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=3406</guid>

					<description><![CDATA[<p>好久沒有寫 Gentoo 的文章了，畢竟除了一般性升級也懶得再動什麼，不過最近一次升級系統又爛了 所有的 ne [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/01/19/3406/gentoo-moved-to-eudev-from-udev/">[Gentoo] Moved to eudev from udev</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>好久沒有寫 Gentoo 的文章了，畢竟除了一般性升級也懶得再動什麼，不過最近一次升級系統又爛了</p>



<p>所有的 network interface 變成 eth0/eth1 &#8230;.. ，不再是 predictable network interface names （可預測的網路介面名稱像是 ensp1 這樣的）</p>



<span id="more-3406"></span>



<p>查了一下系統，發現 driver loading 都是正常的，想到 predictable network interface names 最主要的就是 udev ，試著重啟 udev 看看，沒想到所有的 interface 就變回來了</p>



<p>查了一下 Kernel option ，以前 Gentoo 用 predictable network interface names 要開 kernel option ，現在不用，想必已經預設是這樣了<br />下一步就是查一下之前用的 udev ，再編回來。沒想到，舊版的 236 從 portage 移除了，新版的 238 之後， compile error 都要 download systemd 放在裡面。這下原因大白了，八成是這個原因，因為 Gentoo 的老玩家都還在用 OpenRC。</p>



<p>之前在查其他東西的時候有注意到 eudev 這個東西，不過沒有特別注意，但是解法就在這邊<br /><br />簡單的說， eudev 就是 Udev 的 Gentoo 版，給 OpenRC 這樣的舊系統用的，systemd 不要用。<br /><br />真是 %@%@#$%@#$%@#$%#@%$<br /><br />可能有一天真的要升級到 systemd ，我不想啊啊啊啊啊</p>



<p>以下 Copy 自 Gentoo Wiki<br />&#8212;<br /><strong>eudev</strong>&nbsp;is Gentoo&#8217;s fork of&nbsp;<a href="https://wiki.gentoo.org/wiki/Udev" target="_blank" rel="noopener">udev</a>, systemd&#8217;s&nbsp;<a href="https://wiki.gentoo.org/wiki/Device_file" target="_blank" rel="noopener">device file</a>&nbsp;manager for the Linux kernel.<sup><a href="https://wiki.gentoo.org/wiki/Eudev#cite_note-1" target="_blank" rel="noopener">[1]</a></sup>&nbsp;It manages device nodes in&nbsp;<a href="https://wiki.gentoo.org/wiki/Eudev#The_.2Fdev_directory" target="_blank" rel="noopener">/dev</a>&nbsp;and handles all user space actions when adding or removing devices.</p>



<p>The goal of eudev is to obtain better compatibility with existing software such as the&nbsp;<a href="https://wiki.gentoo.org/wiki/OpenRC" target="_blank" rel="noopener">OpenRC</a>&nbsp;init system,&nbsp;<a href="https://en.wikipedia.org/wiki/Upstart" target="_blank" rel="noopener">Upstart</a>&nbsp;init system, older Linux kernels, various toolchains, and anything else required<sup><a href="https://wiki.gentoo.org/wiki/Eudev#cite_note-2" target="_blank" rel="noopener">[2]</a></sup>&nbsp;by (but not well supported through)&nbsp;<strong>udev</strong>.</p>



<p>Similar to ebuild, eclass, emerge, etc. eudev&#8217;s name follows the &#8216;E&#8217; prefix convention started by Gentoo&#8217;s founder Daniel Robbins.<br /></p>



<p>System configurations running&nbsp;<strong>systemd</strong>&nbsp;have no use for eudev.</p>



<p>Ref.<br /><br />https://wiki.gentoo.org/wiki/Eudev</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/01/19/3406/gentoo-moved-to-eudev-from-udev/">[Gentoo] Moved to eudev from udev</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2019/01/19/3406/gentoo-moved-to-eudev-from-udev/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[ERROR] Error message file /usr/share/mysql/errmsg.sys had only 1118 error messages, but it should contain at least 3076 error messages</title>
		<link>https://blog.richliu.com/2017/10/20/2191/error-error-message-file-usrsharemysqlerrmsg-sys-had-only-1118-error-messages-but-it-should-contain-at-least-3076-error-messages/</link>
					<comments>https://blog.richliu.com/2017/10/20/2191/error-error-message-file-usrsharemysqlerrmsg-sys-had-only-1118-error-messages-but-it-should-contain-at-least-3076-error-messages/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 20 Oct 2017 08:32:03 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[errmsg.sys]]></category>
		<category><![CDATA[MariaDB]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=2191</guid>

					<description><![CDATA[<p>今天碰到怪問題, mariadb 重開失敗, 直接跑 mysqld 碰到這個訊息 [ERROR] Error  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/10/20/2191/error-error-message-file-usrsharemysqlerrmsg-sys-had-only-1118-error-messages-but-it-should-contain-at-least-3076-error-messages/">[ERROR] Error message file /usr/share/mysql/errmsg.sys had only 1118 error messages, but it should contain at least 3076 error messages</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>今天碰到怪問題, mariadb 重開失敗, 直接跑 mysqld 碰到這個訊息</p>
<pre lang="text">[ERROR] Error message file '/usr/share/mysql/errmsg.sys' had only 1118 error messages, but it should contain at least 3076 error messages
</pre>
<p><span id="more-2191"></span></p>
<p>重編一次 mariadb , 然後到 /var/tmp/portage 找 errmsg.sys 這個檔案, 然後 copy 到 /usr/share/mysql/errmsg.sys</p>
<pre lang="text"># cd /var/tmp/portage
# find -name errmsg*.sys
# cp ./dev-db/mariadb-10.2.9/work/mysql-abi_x86_64.amd64/sql/share/english/errmsg.sys /usr/share/mysql/errmsg.sys
# /etc/init.d/mysql restart
</pre>
<p>2018/02/24 Update</p>
<p>這樣比較快</p>
<pre lang="bash"># cp /usr/share/mariadb/english/errmsg.sys /usr/share/mysql/errmsg.sys
</pre>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/10/20/2191/error-error-message-file-usrsharemysqlerrmsg-sys-had-only-1118-error-messages-but-it-should-contain-at-least-3076-error-messages/">[ERROR] Error message file /usr/share/mysql/errmsg.sys had only 1118 error messages, but it should contain at least 3076 error messages</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2017/10/20/2191/error-error-message-file-usrsharemysqlerrmsg-sys-had-only-1118-error-messages-but-it-should-contain-at-least-3076-error-messages/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] UEFI 系統轉移</title>
		<link>https://blog.richliu.com/2017/10/12/2181/gentoo-uefi-%e7%b3%bb%e7%b5%b1%e8%bd%89%e7%a7%bb/</link>
					<comments>https://blog.richliu.com/2017/10/12/2181/gentoo-uefi-%e7%b3%bb%e7%b5%b1%e8%bd%89%e7%a7%bb/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 12 Oct 2017 08:59:06 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[EFI]]></category>
		<category><![CDATA[grub]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=2181</guid>

					<description><![CDATA[<p>最近 HGST 6T 硬碟大特價(12000/9999 =&#62; 6200), 之前的硬碟也差不多快四年了  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/10/12/2181/gentoo-uefi-%e7%b3%bb%e7%b5%b1%e8%bd%89%e7%a7%bb/">[Gentoo] UEFI 系統轉移</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>最近 HGST 6T 硬碟大特價(12000/9999 =&gt; 6200), 之前的硬碟也差不多快四年了 (33319 小時)<br />
剛好提早換硬碟. 看到有人提到的時候去搶只有最後兩顆, 果然運氣不錯<br />
<span id="more-2181"></span></p>
<p>不過收到硬碟的時候發現製造日期是 DEC-2016, 生產快一年了, 應該是賣不出去吧 (註: 剛剛查了一下 amazon.com , 才 US$216 , 所以我們買到只是美國的一般價而己)</p>
<p><a href="https://blog.richliu.com/wp-content/uploads/2017/10/擷取.jpg"><img loading="lazy" decoding="async" class="aligncenter size-medium wp-image-2182" src="https://blog.richliu.com/wp-content/uploads/2017/10/擷取-300x191.jpg" alt="HGST 6TB HDD" width="300" height="191" srcset="https://blog.richliu.com/wp-content/uploads/2017/10/擷取-300x191.jpg 300w, https://blog.richliu.com/wp-content/uploads/2017/10/擷取-768x488.jpg 768w, https://blog.richliu.com/wp-content/uploads/2017/10/擷取-1024x651.jpg 1024w, https://blog.richliu.com/wp-content/uploads/2017/10/擷取.jpg 1684w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>轉移的文章可以參考這二篇<br />
<a href="https://blog.richliu.com/2010/01/20/839/raid-5raid-6-mdadm-%e6%8c%87%e4%bb%a4" target="_blank" rel="noopener">Raid5/Raid6 指令</a><br />
<a href="https://blog.richliu.com/2011/05/16/1078/linux-software-raid-%e7%b3%bb%e7%b5%b1%e8%bd%89%e7%a7%bb" target="_blank" rel="noopener">Linux Software Raid 系統轉移</a></p>
<p>這次因為下錯指令結果剛好不小心就從 BIOS Mode, 升級到 UEFI mode.</p>
<p>其實也沒有很難, 以前 GPT + BIOS 的 Partition 長這樣</p>
<pre lang="text">Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            4095   1024.0 KiB  EF02  BIOS boot partition
   2            4096       209719295   100.0 GiB   FD00  Linux RAID
   3       209719296      5830086655   2.6 TiB     FD00  Linux RAID
   4      5830086656      5860533134   14.5 GiB    FD00  Linux RAID
</pre>
<p>請注意第一個 partition Code 是 EF02, size 只有 1MB, 這個保留給 GRUB 放 boot loader</p>
<p>如果要用 UEFI 開機 Partition table 是這樣,</p>
<pre lang="text">Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          616447   300.0 MiB   EF00  EFI System
   2          616448       420046847   200.0 GiB   FD00  Linux RAID
   3       420046848     11700000000   5.3 TiB     FD00  Linux RAID
   4     11700000768     11721045134   10.0 GiB    FD00  Linux RAID
</pre>
<p>第一個 Partition Table code 是 EF00, 這會 format 成 FAT 格式, 放 EFI Binary<br />
我設 300MB 太大了, 一般 100MB 就可以. 硬碟大就是任性!!</p>
<p>mount partition 並且 install EFI binary</p>
<pre lang="bash">$ mkdir -p /boot/efi
$ mkfs.vfat /dev/sda1
$ mount /dev/sda1 /boot/efi
</pre>
<p>Grub install 的時候改用這個參數</p>
<pre lang="bash">$ grub-install --efi=directory=/boot/efi
</pre>
<p>在 /etc/fstab 加上</p>
<pre lang="text">/dev/sda1  /boot/efi   vfat noauto,noatime 1 2
</pre>
<p>其他我到是沒有改什麼,</p>
<p>至於 BIOS 我是用技嘉的主機板, 在選擇開機選項時就會有一項<br />
(gentoo) HGST HDN726060AL<br />
這個設為第一個就可以了.</p>
<p>感覺移到 EFI 意外的簡單.</p>
<p>接近 190MB/s 算傳統硬碟內非常快的.</p>
<pre lang="text">md11 : active raid1 sda2[0] sdb2[2]
      209715136 blocks [2/1] [U_]
      [=======&gt;.............]  recovery = 38.2% (80207808/209715136) finish=11.5min speed=186778K/sec
      bitmap: 2/2 pages [8KB], 65536KB chunk

</pre>
<p>2018/2/23<br />
不知道為什麼, 今天換主機版的時候開不起來, 理論上之前做的步驟內的 EFI 消失了.<br />
兩顆都消失了那我之前是做什麼的呢?</p>
<p>照上面步驟重新執行一次</p>
<p>另外將檔案 copy 成 default EFI 認得到的檔案, 這樣 EFI BIOS 就直接可以認到了</p>
<p>2022/02/10</p>
<p>兩顆 HGST 似乎在存取上都有點問題，第一顆約半年前下線，下線後大概二個月死亡<br />
第二顆今天也讓他下線了，總使用時數約為 4.3 年左右<br />
果然是特價品啊</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/10/12/2181/gentoo-uefi-%e7%b3%bb%e7%b5%b1%e8%bd%89%e7%a7%bb/">[Gentoo] UEFI 系統轉移</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2017/10/12/2181/gentoo-uefi-%e7%b3%bb%e7%b5%b1%e8%bd%89%e7%a7%bb/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[ERROR] Can&#8217;t find messagefile &#8216;/usr/share/mysql/errmsg.sys&#8217;</title>
		<link>https://blog.richliu.com/2017/09/25/2170/error-cant-find-messagefile-usrsharemysqlerrmsg-sys/</link>
					<comments>https://blog.richliu.com/2017/09/25/2170/error-cant-find-messagefile-usrsharemysqlerrmsg-sys/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 25 Sep 2017 11:34:10 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[MariaDB]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=2170</guid>

					<description><![CDATA[<p>因為 Gentoo 忘了 copy file 過去. # mkdir -p /usr/share/mysql/ [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/09/25/2170/error-cant-find-messagefile-usrsharemysqlerrmsg-sys/">[ERROR] Can&#8217;t find messagefile &#8216;/usr/share/mysql/errmsg.sys&#8217;</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>因為 Gentoo 忘了 copy file 過去. </p>
<pre lang="bash">
# mkdir -p /usr/share/mysql/
# cp /usr/share/mariadb/english/errmsg.sys /usr/share/mysql/errmsg.sys
# /etc/init.d/mysql restart
</pre>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/09/25/2170/error-cant-find-messagefile-usrsharemysqlerrmsg-sys/">[ERROR] Can&#8217;t find messagefile &#8216;/usr/share/mysql/errmsg.sys&#8217;</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2017/09/25/2170/error-cant-find-messagefile-usrsharemysqlerrmsg-sys/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>OpenVPN Easy RSA  筆記</title>
		<link>https://blog.richliu.com/2017/01/18/2084/openvpn-easy-rsa-%e7%ad%86%e8%a8%98/</link>
					<comments>https://blog.richliu.com/2017/01/18/2084/openvpn-easy-rsa-%e7%ad%86%e8%a8%98/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 18 Jan 2017 13:26:38 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[easyrsa]]></category>
		<category><![CDATA[openvpn]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=2084</guid>

					<description><![CDATA[<p>時隔 10 年發現 Key 過期了, 所以跑回來加一下 Updater Key 的資訊 安裝 easy-rsa [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/01/18/2084/openvpn-easy-rsa-%e7%ad%86%e8%a8%98/">OpenVPN Easy RSA  筆記</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>時隔 10 年發現 Key 過期了, 所以跑回來加一下 Updater Key 的資訊</p>
<p>安裝 easy-rsa 套件</p>
<pre lang=bash> 
$ emerge --ask app-crypt/easy-rsa
</pre>
<p>copy easy-rsa 套件到 openvpn 下</p>
<pre lang=bash>
$ cd /etc/openvpn
$ cp -a /usr/share/easy-rsa .
$ cd easy-rsa
$ mv vars.example vars
</pre>
<p>修改 vars 內, 我比較傳統, 走舊式的方式</p>
<pre lang=text>
set_var EASYRSA_DN      "org"
set_var EASYRSA_REQ_COUNTRY     "TW"
set_var EASYRSA_REQ_PROVINCE    "Taiwan"
set_var EASYRSA_REQ_CITY        "New Taipei"
set_var EASYRSA_REQ_ORG         "domain.com"
set_var EASYRSA_REQ_EMAIL       "email@domain.com"
set_var EASYRSA_REQ_OU          "Organizational Unit"
</pre>
<p>編輯完之後 清除所有的 PKI 設定</p>
<pre lang=bash>
$ ./easyrsa init-pki
</pre>
<p>建立 ca 資訊, ca 要輸入密碼, 請記好. dh 是產生 Diffie-Hellman .pem file</p>
<pre lang=bash>
$ ./easyrsa build-ca
$ ./easyrsa gen-dh
</pre>
<p>建立 Server 和 Client Key 資訊</p>
<pre lang=bash>
$ ./easyrsa build-server-full server1 nopass
$ ./easyrsa build-client-full client1 nopass
</pre>
<p>中間有問密碼就是 ca 的密碼</p>
<p>最後, 編輯 /etc/openvpn/openvpn.conf<br />
加上</p>
<pre lang=text>
dh /etc/openvpn/easy-rsa/pki/dh.pem
ca /etc/openvpn/easy-rsa/pki/ca.crt
cert /etc/openvpn/easy-rsa/pki/issued/server1.crt
key /etc/openvpn/easy-rsa/pki/private/server1.key
</pre>
<p>這樣應該就可以了, 下次更新不知道會不會是十年後的事情了呢? </p>
<p>ref.<br />
<a href="https://wiki.gentoo.org/wiki/Create_a_Public_Key_Infrastructure_Using_the_easy-rsa_Scripts" target="_blank" rel="noopener">Create a Public Key Infrastructure Using the easy-rsa Scripts</a><br />
其實原來是參考 Arch 的文件, 不過太麻煩了<br />
https://wiki.archlinux.org/index.php/Easy-RSA</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/01/18/2084/openvpn-easy-rsa-%e7%ad%86%e8%a8%98/">OpenVPN Easy RSA  筆記</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2017/01/18/2084/openvpn-easy-rsa-%e7%ad%86%e8%a8%98/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] 替 Apache 加上 http2 支援</title>
		<link>https://blog.richliu.com/2016/10/17/2026/gentoo-%e6%9b%bf-apache-%e5%8a%a0%e4%b8%8a-http2-%e6%94%af%e6%8f%b4/</link>
					<comments>https://blog.richliu.com/2016/10/17/2026/gentoo-%e6%9b%bf-apache-%e5%8a%a0%e4%b8%8a-http2-%e6%94%af%e6%8f%b4/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 17 Oct 2016 11:45:57 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[apache2]]></category>
		<category><![CDATA[curl]]></category>
		<category><![CDATA[http/2]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=2026</guid>

					<description><![CDATA[<p>沒有很難, 因為之前弄了 Letsencrypt 就想加一下 HTTP2, 這應該也很成熟了 /etc/por [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/10/17/2026/gentoo-%e6%9b%bf-apache-%e5%8a%a0%e4%b8%8a-http2-%e6%94%af%e6%8f%b4/">[Gentoo] 替 Apache 加上 http2 支援</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>沒有很難, 因為之前弄了 Letsencrypt 就想加一下 HTTP2, 這應該也很成熟了<br />
<span id="more-2026"></span></p>
<p>/etc/portage/package.use 加上 alpn</p>
<pre lang="text">
www-servers/apache threads alpn
</pre>
<p>/etc/conf.d/apache 內的 APACHE2_OPTS 加上 -DSSL -DHTTP2, 像是</p>
<pre lang="text">
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP -DHTTP2"
</pre>
<p>然後再執行</p>
<pre lang="text">
$ emerge -av apache
$ etc-update
$ !/etc/init.d/apache restart
</pre>
<p>etc-update 一定要做, 我就忘了做這步卡很久, 花了一點時間才 debug 出來. </p>
<p>這篇 Debug 非常好用, 不過用來用去 curl debug 最好用, 但是其他的 tool 也很有趣, 像 h2c 那個可以看 session 狀態.<br />
<a href="https://blog.cloudflare.com/tools-for-debugging-testing-and-using-http-2/" target="_blank" rel="noopener">Tools for debugging, testing and using HTTP/2</a></p>
<p>我就是用這麼原始的方式才知道錯在什麼環節</p>
<pre lang="text">
$ curl -vso /dev/null --http2 https://www.cloudflare.com/ 2 >> 1.txt
$ curl -vso /dev/null --http2 https://www.yourwebsite.com/ 2 >> 2.txt
$ vimdiff 1.txt 2.txt
</pre>
<p>我是看到這一篇才想到沒有 Load mod_http2 module<br />
<a href="https://icing.github.io/mod_h2/howto.html" target="_blank" rel="noopener">how to h2 in apache </a></p>
<p>最後再到這個網站確認有沒有成功<br />
<a href="https://tools.keycdn.com/http2-test" target="_blank" rel="noopener">HTTP/2 Test Verify HTTP/2.0 Support</a><br />
<a href="https://blog.richliu.com/wp-content/uploads/2016/10/擷取.png"><img loading="lazy" decoding="async" src="https://blog.richliu.com/wp-content/uploads/2016/10/擷取-300x114.png" alt="HTT2 測試" width="300" height="114" class="aligncenter size-medium wp-image-2027" srcset="https://blog.richliu.com/wp-content/uploads/2016/10/擷取-300x114.png 300w, https://blog.richliu.com/wp-content/uploads/2016/10/擷取-768x292.png 768w, https://blog.richliu.com/wp-content/uploads/2016/10/擷取-1024x390.png 1024w, https://blog.richliu.com/wp-content/uploads/2016/10/擷取.png 1471w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>雖然沒有加快多少, 至少本小站也是支援 HTTP/2 了. </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/10/17/2026/gentoo-%e6%9b%bf-apache-%e5%8a%a0%e4%b8%8a-http2-%e6%94%af%e6%8f%b4/">[Gentoo] 替 Apache 加上 http2 支援</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2016/10/17/2026/gentoo-%e6%9b%bf-apache-%e5%8a%a0%e4%b8%8a-http2-%e6%94%af%e6%8f%b4/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] letsencrypt: acme==0.6.0.dev0 distribution was not found &#8230;</title>
		<link>https://blog.richliu.com/2016/06/12/1967/gentoo-letsencrypt-acme0-6-0-dev0-distribution-was-not-found/</link>
					<comments>https://blog.richliu.com/2016/06/12/1967/gentoo-letsencrypt-acme0-6-0-dev0-distribution-was-not-found/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 12 Jun 2016 13:01:54 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[letsencrypt]]></category>
		<category><![CDATA[python]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=1967</guid>

					<description><![CDATA[<p>今天碰到一個奇怪的問題 letsencrypt: acme==0.6.0.dev0 distribution  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/06/12/1967/gentoo-letsencrypt-acme0-6-0-dev0-distribution-was-not-found/">[Gentoo] letsencrypt: acme==0.6.0.dev0 distribution was not found &#8230;</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>今天碰到一個奇怪的問題<br />
letsencrypt: acme==0.6.0.dev0 distribution was not found &#8230;<br />
<span id="more-1967"></span></p>
<p>原始訊息</p>
<p><code>letsencrypt --help<br />
Traceback (most recent call last):<br />
  File "/usr/lib/python-exec/python2.7/letsencrypt", line 5, in <module><br />
    from pkg_resources import load_entry_point<br />
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3080, in </module><module><br />
    @_call_aside<br />
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3066, in _call_aside<br />
    f(*args, **kwargs)<br />
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 3093, in _initialize_master_working_set<br />
    working_set = WorkingSet._build_master()<br />
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 653, in _build_master<br />
    return cls._build_from_requirements(__requires__)<br />
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 666, in _build_from_requirements<br />
    dists = ws.resolve(reqs, Environment())<br />
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 839, in resolve<br />
    raise DistributionNotFound(req, requirers)<br />
pkg_resources.DistributionNotFound: The 'acme==0.6.0.dev0' distribution was not found and is required by letsencrypt </module></code></p>
<p>這是 gcc 換 5.x 之後要重新 compile 一遍, 並且舊的 letsencrypt 改名叫 certbot<br />
<code>$ revdep-rebuild --library 'libstdc++.so.6' -- --exclude gcc<br />
$ emerge -avu certbot<br />
</code></p>
<p>這樣就可以了</p>
<p>原來的錯誤訊息是我要找的, 但是點進去卻是完全不同的標題和文章, 真是神祕<br />
ref<br />
<a href="https://forums.gentoo.org/viewtopic-t-1040792-view-next.html?sid=4972e0a3afe2ea82e21e32f98b3a0ab1" target="_blank" rel="noopener">emerge klibc fails with compiler-gcc5.h missing</a><br />
<a href="https://letsencrypt.org/getting-started/" target="_blank" rel="noopener">Letsencrypt Getting Started</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/06/12/1967/gentoo-letsencrypt-acme0-6-0-dev0-distribution-was-not-found/">[Gentoo] letsencrypt: acme==0.6.0.dev0 distribution was not found &#8230;</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2016/06/12/1967/gentoo-letsencrypt-acme0-6-0-dev0-distribution-was-not-found/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] Perl 5.20.0 和 Perl 5.24.0 Conflict  的問題</title>
		<link>https://blog.richliu.com/2016/05/29/1963/gentoo-perl-5-20-0-%e5%92%8c-perl-5-24-0-conflict-%e7%9a%84%e5%95%8f%e9%a1%8c/</link>
					<comments>https://blog.richliu.com/2016/05/29/1963/gentoo-perl-5-20-0-%e5%92%8c-perl-5-24-0-conflict-%e7%9a%84%e5%95%8f%e9%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 29 May 2016 03:54:06 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[upgrade]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=1963</guid>

					<description><![CDATA[<p>最近升級系統發現的, 如果系統沒有使用 Keyword ~x86 , 系統會停留在 stable versio [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/05/29/1963/gentoo-perl-5-20-0-%e5%92%8c-perl-5-24-0-conflict-%e7%9a%84%e5%95%8f%e9%a1%8c/">[Gentoo] Perl 5.20.0 和 Perl 5.24.0 Conflict  的問題</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>最近升級系統發現的, 如果系統沒有使用 Keyword ~x86 , 系統會停留在 stable version.<br />
目前 Perl 5.20.0 是 Stable version </p>
<p>不過升級 Perl 會出現很多套件 conflict perl 5.20.0 的問題, 這時候將這些套件擋掉就可以了</p>
<p><code><br />
$ mkdir -p /etc/portage/profile/package.provided<br />
$ grep -ri 'dev-lang/perl-5.24' /usr/portage/virtual/perl-* | cut -d: -f1 | sed 's/\.ebuild//' | sed  's#/usr/portage/##' | sed 's#/perl-.*/#/#' > /etc/portage/profile/package.provided/perl-virtuals.provided<br />
</code></p>
<p>檔案 /etc/portage/profile/package.provided 未來可以刪除, 暫時解掉升級的問題</p>
<p>ref.<br />
https://forums.gentoo.org/viewtopic-p-7924260.html?sid=8808213351965bdb71ffd1d3ed4ef4f3</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/05/29/1963/gentoo-perl-5-20-0-%e5%92%8c-perl-5-24-0-conflict-%e7%9a%84%e5%95%8f%e9%a1%8c/">[Gentoo] Perl 5.20.0 和 Perl 5.24.0 Conflict  的問題</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2016/05/29/1963/gentoo-perl-5-20-0-%e5%92%8c-perl-5-24-0-conflict-%e7%9a%84%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] KDE 升級到 Plasma 5</title>
		<link>https://blog.richliu.com/2016/04/25/1949/gentoo-kde-%e5%8d%87%e7%b4%9a%e5%88%b0-plasma-5/</link>
					<comments>https://blog.richliu.com/2016/04/25/1949/gentoo-kde-%e5%8d%87%e7%b4%9a%e5%88%b0-plasma-5/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 24 Apr 2016 18:53:15 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Plasma5]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[升級]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=1949</guid>

					<description><![CDATA[<p>其實大多數照 Plasma 5 這一份文件升級即可 https://wiki.gentoo.org/wiki/ [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/04/25/1949/gentoo-kde-%e5%8d%87%e7%b4%9a%e5%88%b0-plasma-5/">[Gentoo] KDE 升級到 Plasma 5</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>其實大多數照 Plasma 5 這一份文件升級即可<br />
https://wiki.gentoo.org/wiki/KDE/Plasma_5_upgrade</p>
<p>但是過程碰到很多問題, 這邊隨意記錄一下<br />
<span id="more-1949"></span></p>
<p>首先要照 Plasma 5 那份文件做</p>
<p>升級之後要跑一次 emerge &#8211;depclean 看有些那 KDE 的 package 沒有清乾淨, dependency 要去掉<br />
所以清掉舊的 KDE4 的 Library<br />
另外, 如果有 ruby 1.9, 記得也要升級成新版, 可能會造成 qtwebkit compile 錯誤</p>
<p>如果同時 gcc 是從 4.9 升級到 5.3 要跑一下這個指令<br />
$ revdep-rebuild &#8211;library &#8216;libstdc++.so.6&#8217; &#8212; &#8211;exclude gcc<br />
想必我每次 read news 根本沒有看到重點</p>
<p>執行這一行升級整個系統<br />
$ emerge &#8211;update &#8211;newuse &#8211;deep &#8211;with-bdeps=y @world<br />
執行完沒問題, 執行<br />
$ emerge &#8211;depclean<br />
執行完沒問題, 執行<br />
$ emerge @preserved-rebuild</p>
<p>本人以前的升級習慣真不好 :X</p>
<p>其他錯誤訊息的解決方法, 放在這邊看有沒有人能 Google 到</p>
<blockquote><p>
# emerge -a1v kde-plasma/kinfocenter kwin plasma</p>
<p>These are the packages that would be merged, in order:</p>
<p>Calculating dependencies&#8230; done!</p>
<p>emerge: there are no ebuilds built with USE flags to satisfy &#8220;&gt;=dev-qt/qtgui-5.5.1:5[gles2]&#8221;.<br />
!!! One of the following packages is required to complete your request:<br />
&#8211; dev-qt/qtgui-5.5.1-r1::gentoo (Change USE: +gles2, this change violates use flag constraints defined by dev-qt/qtgui-5.5.1-r1: &#8216;any-of ( eglfs xcb ) accessibility? ( dbus xcb ) eglfs? ( egl ) ibus? ( dbus ) libinput? ( udev ) xcb? ( gles2? ( egl ) )&#8217;)<br />
(dependency required by &#8220;kde-plasma/kinfocenter-5.6.3::gentoo[gles]&#8221; [ebuild])<br />
(dependency required by &#8220;kde-plasma/kinfocenter&#8221; [argument])</p></blockquote>
<p>這是因為我 USE flag 有 opengl 和 gels 這二個 flag, 事實上我是 intel 的顯示卡, 不必要去管這個, 所以移掉就好了</p>
<p>在 ~/.xinitrc 放 exec startkde 執行之後會有類似這樣的訊息</p>
<blockquote><p>startkde: Starting up&#8230;<br />
QStandardPaths: wrong ownership on runtime directory (null), -2 instead of 1000<br />
kdeinit5: Aborting. bind() failed: Permission denied </p></blockquote>
<p>建一個 /var/run/user 的目錄再給它 777 的權限, 改完之後就可以執行<br />
執行完一次之後再改回來也不會有問題 (這什麼怪問題)</p>
<p>升級到 5 沒有 KDM , 要改用 SDDM<br />
有碰到 sddm 沒法啟動 Plasma 暫時不想管<br />
沒想到重開機之後就 OK 了</p>
<p>ref. <a href="https://forums.gentoo.org/viewtopic-t-1039382.html" target="_blank" rel="noopener">[SOLVED] Emerging of dev-qt/qtwebkit-5.5.1-r1::gentoo fails</a><br />
<a href="https://forums.gentoo.org/viewtopic-t-1043412.html" target="_blank" rel="noopener">qtwebkit-5.5.1 [SOLVED]</a><br />
<a href="https://forum.kde.org/viewtopic.php?f=287&#038;t=121306" target="_blank" rel="noopener">wrong ownership on runtime directory /tmp, 0 instead of 1000</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/04/25/1949/gentoo-kde-%e5%8d%87%e7%b4%9a%e5%88%b0-plasma-5/">[Gentoo] KDE 升級到 Plasma 5</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2016/04/25/1949/gentoo-kde-%e5%8d%87%e7%b4%9a%e5%88%b0-plasma-5/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Disable You Have New Mail</title>
		<link>https://blog.richliu.com/2016/04/23/1947/disable-you-have-new-mail/</link>
					<comments>https://blog.richliu.com/2016/04/23/1947/disable-you-have-new-mail/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 23 Apr 2016 15:05:35 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[mail]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=1947</guid>

					<description><![CDATA[<p>每次 Login 都有這個小視窗, 非常討厭 編輯 /etc/pam.d/system-login Mark  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/04/23/1947/disable-you-have-new-mail/">Disable You Have New Mail</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>每次 Login 都有這個小視窗, 非常討厭</p>
<p>編輯 /etc/pam.d/system-login<br />
Mark 掉以下這一行就可以<br />
#session                optional        pam_mail.so</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/04/23/1947/disable-you-have-new-mail/">Disable You Have New Mail</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2016/04/23/1947/disable-you-have-new-mail/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo][Linux] Hinet PPPoE IPv6 Dual Stack 設定</title>
		<link>https://blog.richliu.com/2016/03/07/1930/hinet-pppoe-ipv6-dual-stack-%e8%a8%ad%e5%ae%9a/</link>
					<comments>https://blog.richliu.com/2016/03/07/1930/hinet-pppoe-ipv6-dual-stack-%e8%a8%ad%e5%ae%9a/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 07 Mar 2016 06:19:46 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[dhcpv6]]></category>
		<category><![CDATA[dual stack]]></category>
		<category><![CDATA[hinet]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[routing]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=1930</guid>

					<description><![CDATA[<p>自從中研院 Tunnel Broker 因為硬碟壞掉終止服務, Hinet Tunnel Broker 一直斷 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/03/07/1930/hinet-pppoe-ipv6-dual-stack-%e8%a8%ad%e5%ae%9a/">[Gentoo][Linux] Hinet PPPoE IPv6 Dual Stack 設定</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>自從中研院 Tunnel Broker 因為硬碟壞掉終止服務, Hinet Tunnel Broker 一直斷線根本不能用.<br />
己經很久沒有使用 IPv6 的服務.<br />
前二天聽到 Kenduest Lee 說到 Hinet 光世代 PPPoE 有 IPv6 的服務, 立馬就跑去申請.<br />
<span id="more-1930"></span>第一件事, 請到中華電信營業所申請 IPv6 的服務, 這邊特別提醒,<br />
不是每個服務人員都熟悉什麼叫 IPv6, 你碰到的服務人員可能不懂, 這也表示 IPv6 這個服務非常少人使用.<br />
所以如果他們不知道你在說什麼, 請查資料並多些耐心<br />
希望我今天這篇文章可以吸引更多人來用 IPv6 的服務 (目前好像也沒有什麼好處 XD)</p>
<p>剛剛長輩提示, Hinet 也可以線上申請 IPv6</p>
<p>到 <a href="https://123.cht.com.tw/ecas/B09" target="_blank" rel="noopener">中華電信網路客服中心</a> , 選更多線上服務.<br />
找到 IPv6 , 登入之後再申請即可</p>
<p>&nbsp;</p>
<p>開通之後, 快的話數個小時就會開通, 如果沒有開通, 過幾天工程人員也會打電話通知你.</p>
<p>如何知道有沒有開通, PPPoE 設定完之後, 重新撥接可以用 PPPoE or DHCP 取得 IPv6 IP.</p>
<p>如果是 ubuntu 預設套件, 請編輯 /etc/ppp/option<br />
並且加上</p>
<blockquote><p>ipv6 ,</p></blockquote>
<p>請注意有逗號, 中間有空白. 然後再重新撥接 PPPoE 就可以.</p>
<p>如果是用 Gentoo/rp-pppoe, 請編輯 /etc/ppp/option 加上這一行</p>
<blockquote><p>+ipv6 ipv6cp-use-ipaddr</p></blockquote>
<p>這樣就可以取得 IPv6 IP.</p>
<p>如果不能取得 IP, 請檢查有沒有執行 radvd<br />
Gentoo 執行 /etc/init.d/net.ppp0 restart 之後, 會自動帶起來 radvd, 這時候會造成 radvd 影響取得 IPv6 的 IP<br />
所以在 /etc/rc.conf 下將 rc_depend_strict 設 &#8220;NO&#8221; 就不會自動呼叫 radvd (其他 service dependency 也會受影響, 請注意)</p>
<p>另外還在 /etc/conf.d/net 加上 code 確保 radvd 一定沒有執行</p>
<blockquote><p>postdown() {<br />
if [ ${IFVAR} == &#8220;ppp0&#8221; ] ; then<br />
/etc/init.d/radvd stop<br />
sleep 2<br />
killall -9 radvd<br />
fi<br />
return 0<br />
}</p></blockquote>
<p>如果 Linux 這一台是 Router 時, 從 Hinet 那邊取得的 IPv6 Routing 要稍稍修改一下才能正確傳遞到內網<br />
因為預設的 Interface 是 /64 的 IP, 在 route table 那邊會多一行 /64 的 routing table, 這個 record 會讓 IPv6 Forwarding 不正常<br />
像是這樣,</p>
<blockquote><p>2001:b011:3810:cc9::/64 :: UA 256 0 0 ppp0</p></blockquote>
<p>這時候就要重新設定 ppp interface 的 IP 和 routing table.</p>
<p>所以我做了如下的設定<br />
1) 取得 IPv6/default gateway IP<br />
2) 將 ppp0 的 interface 改成 /128<br />
3) 寫入資訊到 radvd<br />
4) 啟動 radvd<br />
5) 加入原來 hinet 的 default gateway IP</p>
<p>這樣就大功告成了, 內網也可以順利的透過 Linux 連到外部去.<br />
這邊就不解釋各步驟要下什麼指令, 直接看 script 比較快</p>
<blockquote><p>WANIF=ppp0<br />
LANIF=eth1<br />
WANIP=`ifconfig ppp0 | grep inet6 | grep global | awk &#8216;{print $2}&#8217;`</p>
<p>if [ x${WANIP} == &#8220;x&#8221; ] ; then<br />
echo &#8220;NO IPv6 Address !!!!!!!&#8221;<br />
exit 0<br />
fi</p>
<p>GATEWAY=`route -n6 | grep ppp0 | grep &#8220;::\/0&#8243; | awk &#8216;{print $2}&#8217;| head -1`<br />
RADVDCFG=&#8221;/etc/radvd.conf&#8221;<br />
PREFIX=`echo ${WANIP}| cut -d &#8216;:&#8217; -f1`&#8221;:&#8221;`echo ${WANIP}| cut -d &#8216;:&#8217; -f2`&#8221;:&#8221;`echo ${WANIP}| cut -d &#8216;:&#8217; -f3`&#8221;:&#8221;`echo ${WANIP}| cut -d &#8216;:&#8217; -f4`<br />
echo &#8220;WANIP : ${WANIP}&#8221;<br />
echo &#8220;GATEWAY : ${GATEWAY}&#8221;<br />
echo ${PREFIX}<br />
# Create RADVD configuration file<br />
cat&gt;${RADVDCFG}&lt;&lt;EOL<br />
interface ${LANIF}<br />
{<br />
AdvSendAdvert on;<br />
prefix ${PREFIX}::/64<br />
{<br />
AdvOnLink on;<br />
AdvRouterAddr on;<br />
AdvAutonomous on;<br />
};<br />
};<br />
EOL</p>
<p>ifconfig ${WANIF} inet6 del ${WANIP}/64<br />
ifconfig ${WANIF} inet6 add ${WANIP}/128<br />
# assign one for LAN to avoid routing problem<br />
ifconfig $(LANIF) inet6 add ${PREFIX}::1/64</p>
<p>ip -6 route del ${PREFIX}::/64 dev ppp0<br />
sleep 1<br />
/etc/init.d/radvd start<br />
sleep 1</p>
<p>route -A inet6 add default gw ${GATEWAY} dev ${WANIF}</p></blockquote>
<p>有防火牆也可以參考這個 script 取得目前的 IP .</p>
<p>在 /etc/conf.d/net 加上一些 code 讓他呼叫這個 scrip.</p>
<blockquote><p>postup() {</p>
<p>if [ ${IFVAR} == &#8220;ppp0&#8221; ] ; then<br />
echo test<br />
sleep 3<br />
bash /usr/local/script/ipv6.sh<br />
fi<br />
return 0<br />
}</p></blockquote>
<p>如果是用 dhcpcd 這個套件取得 IP, 並且要設定另一個介面的 Interface , 可以參考這個設定</p>
<blockquote><p>duid<br />
noipv6rs<br />
waitip 6<br />
# Uncomment this line if you are running dhcpcd for IPv6 only.<br />
ipv6only</p>
<p># use the interface connected to WAN<br />
interface ppp0<br />
ipv6rs<br />
iaid 1<br />
# use the interface connected to your LAN<br />
ia_pd 1 eth2<br />
#ia_pd 1/::/64 eth2/0/64</p></blockquote>
<p>小州大大的 DHCP6C 配置 (偷來放 BLOG 他應該不會介意)</p>
<blockquote><p># use the interface connected to your WAN<br />
interface ppp0 {<br />
send ia-pd 0;<br />
};</p>
<p>id-assoc pd 0 {<br />
# use the interface connected to your LAN<br />
prefix-interface eth2 {<br />
sla-id 1;<br />
sla-len 8;<br />
};<br />
};</p></blockquote>
<p>之前在 Facebook 上和小州大大討論過, 他是用 PPPoE 取得第一段 IPv6 , 用 DHCPv6 取得第二段, 所以會拿到二組不同的 IPv6 IP.<br />
我這個方法設定麻煩, 但是只會拿到一組 IPv6 的 IP.</p>
<p>Ref.<br />
<a href="http://blog.xuite.net/zack_pan/blog/62384661-Linux透過PPPoE取得IPv6的IP" target="_blank" rel="noopener">Linux透過PPPoE取得IPv6的IP</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/03/07/1930/hinet-pppoe-ipv6-dual-stack-%e8%a8%ad%e5%ae%9a/">[Gentoo][Linux] Hinet PPPoE IPv6 Dual Stack 設定</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2016/03/07/1930/hinet-pppoe-ipv6-dual-stack-%e8%a8%ad%e5%ae%9a/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
