<?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>Linux &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/category/computer/unix/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Tue, 19 May 2026 06:07:18 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>ARM 為 Linux 準備 128-bit Page Table Entries：FEAT_D128 解讀</title>
		<link>https://richliu.com/2026/05/19/6537/arm-%e7%82%ba-linux-%e6%ba%96%e5%82%99-128-bit-page-table-entries%ef%bc%9afeat_d128-%e8%a7%a3%e8%ae%80/</link>
					<comments>https://richliu.com/2026/05/19/6537/arm-%e7%82%ba-linux-%e6%ba%96%e5%82%99-128-bit-page-table-entries%ef%bc%9afeat_d128-%e8%a7%a3%e8%ae%80/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Tue, 19 May 2026 05:57:19 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[文章分析(w/AI)]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[ARMv9]]></category>
		<category><![CDATA[FEAT_D128]]></category>
		<category><![CDATA[linux kernel]]></category>
		<category><![CDATA[MMU]]></category>
		<category><![CDATA[虛擬記憶體]]></category>
		<guid isPermaLink="false">https://richliu.com/2026/05/19/6537/arm-%e7%82%ba-linux-%e6%ba%96%e5%82%99-128-bit-page-table-entries%ef%bc%9afeat_d128-%e8%a7%a3%e8%ae%80/</guid>

					<description><![CDATA[<p>一、原文摘要 Phoronix 於 2026 年 5 月報導，ARM 正在為 Linux kernel 提交一 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2026/05/19/6537/arm-%e7%82%ba-linux-%e6%ba%96%e5%82%99-128-bit-page-table-entries%ef%bc%9afeat_d128-%e8%a7%a3%e8%ae%80/">ARM 為 Linux 準備 128-bit Page Table Entries：FEAT_D128 解讀</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<h2 class="wp-block-heading">一、原文摘要</h2>



<p>Phoronix 於 2026 年 5 月報導，ARM 正在為 Linux kernel 提交一組 RFC patch，準備支援 <strong>FEAT_D128</strong>——也就是 <strong>128-bit page table descriptor</strong> 的新翻譯系統 <strong>VMSAv9-128</strong>，這是 ARMv9.3 之後的選用特性。</p>



<p>目前 patch 還在 RFC 階段，KVM、KASAN 等子系統尚未支援。但這代表 Linux 已經為 ARM 下一個世代的虛擬記憶體架構鋪路，預計會在 ARMv9.3 silicon 上市前準備好 enablement。</p>



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



<h2 class="wp-block-heading">二、為什麼要做 D128？兩個動機</h2>



<p>ARM 之所以要把 page table descriptor 從 64 bits 加到 128 bits，不是「順便升級」，而是兩個實際撞牆問題：</p>



<h3 class="wp-block-heading">動機 1：實體位址 (PA) 撞到 52-bit 上限</h3>



<p>現有 ARMv8/v9 的 VMSAv8-64 翻譯系統，descriptor 是 64 bits，扣掉屬性位元，能拿來放 PA 的最多 52 bits，也就是 <strong>4 PB</strong>。</p>



<p>聽起來很多，但對於 CXL pooled memory、AI/HPC 大模型訓練、雲端超大記憶體機台這條路線，4 PB 是可預見的天花板。要再往上走，架構上必須換成 128-bit descriptor。</p>



<h3 class="wp-block-heading">動機 2：Descriptor 的屬性 bits 已經塞滿</h3>



<p>64-bit descriptor 裡的 AttrIdx、AP、SH、AF、nG、PXN/UXN、MTE、BTI、GP……幾乎沒有空位。每次要加新功能（更細的權限、虛擬化 metadata、安全/機密運算欄位）都要從別的欄位擠空間。</p>



<p>128 bits 一次把容器翻倍，把累積的「想加但沒地方加」的需求解決，也替未來十年的擴展留路。</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p><strong>關鍵釐清</strong>：FEAT_D128 是 <strong>descriptor 變成 128 bits</strong>，<strong>不是位址空間變成 128 bits</strong>。新規格實際支援的 PA 是 56 bits（架構可再擴展），不是 2¹²⁸ bytes 那種天文數字。</p>
</blockquote>



<h2 class="wp-block-heading">三、技術代價：page walk 從 4 層變 5 層</h2>



<p>代價不是零：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>項目</th><th>64-bit descriptor</th><th>128-bit descriptor (D128)</th></tr></thead><tbody><tr><td>Descriptor 大小</td><td>8 bytes</td><td>16 bytes</td></tr><tr><td>4KB page 內 entry 數</td><td>512 個</td><td>256 個</td></tr><tr><td>每層解析 bits</td><td>9 bits</td><td>8 bits</td></tr><tr><td>Page walk 層數</td><td>4 levels</td><td><strong>5 levels</strong></td></tr><tr><td>一次 cache line (64B) 帶回 entry 數</td><td>8 個</td><td>4 個</td></tr></tbody></table></figure>



<p>為了避免 page table 體積爆炸，ARM 把每層解析的 bits 從 9 砍到 8，所以總層數從 4 變 5。代價就是 TLB miss 時的 page walk 要多走一次記憶體存取。</p>



<h2 class="wp-block-heading">四、效能影響：拿 x86 LA57 類比</h2>



<p>ARM D128 silicon 還沒出，沒有實機數字。但可以參考 x86 從 4-level paging 走到 5-level paging（LA57，Ice Lake-SP 2019 開始）的實測：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>量測項目</th><th>4-level</th><th>5-level</th><th>變化</th></tr></thead><tbody><tr><td>Page walk per level</td><td>20–60 cycles</td><td>20–60 cycles</td><td>—</td></tr><tr><td>Worst-case full walk</td><td>~4×60 = 240 cycles</td><td>~5×60 = 300 cycles</td><td>+25%</td></tr><tr><td>實測 page fault latency 分布 (JabPerf)</td><td>256–511 ns</td><td>512–1023 ns</td><td>~2×</td></tr><tr><td>一般 server workload (SPEC / 雲端)</td><td>baseline</td><td>&lt; 1% 平均退化</td><td>幾乎沒感覺</td></tr><tr><td>Pointer-chasing 重型 workload（圖計算、稀疏 GEMM）</td><td>baseline</td><td>3–5% 退化</td><td>有感</td></tr></tbody></table></figure>



<p><strong>為什麼平均退化這麼小？</strong> 因為 page walker 自己也有 cache：<br />
&#8211; x86 叫 <strong>paging structure cache</strong><br />
&#8211; ARM 叫 <strong>intermediate translation cache</strong></p>



<p>上層的 PGD/PUD entry 幾乎都會 hit，所以實際只多 0–1 次記憶體存取。</p>



<p><strong>ARM D128 的情況可能比 x86 LA57 略糟</strong>，原因有兩個：</p>



<ol class="wp-block-list">
<li>Descriptor 從 8 bytes → 16 bytes，walker 一次 cache line 帶回的 entries 數量減半（8→4），prefetch 效率變差。</li>



<li>每層只解析 8 bits 而不是 9 bits，translation cache 的 locality 稍有不同。</li>
</ol>



<p>但 ARM 通常 TLB / walker cache 設計比 x86 還積極，會抵銷一些。<strong>整體推估：平均退化 &lt; 1%，最壞 case workload 3–5%</strong>。</p>



<h2 class="wp-block-heading">五、ARM 位址擴展演進史</h2>



<p>D128 不是憑空出現，是一條延續路線：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>特性</th><th>架構版本</th><th>PA 上限</th><th>主要改動</th></tr></thead><tbody><tr><td>原始 VMSAv8-64</td><td>Armv8.0</td><td>48 bits (256 TB)</td><td>4-level page walk</td></tr><tr><td>FEAT_LPA</td><td>Armv8.2</td><td>52 bits (4 PB)</td><td>僅限 64KB granule</td></tr><tr><td>FEAT_LPA2</td><td>Armv8.7</td><td>52 bits (4 PB)</td><td>擴展到 4KB / 16KB granule</td></tr><tr><td><strong>FEAT_D128</strong></td><td><strong>Armv9.3</strong></td><td><strong>56 bits (64 PB), 可擴展</strong></td><td><strong>128-bit descriptor, 5-level walk</strong></td></tr></tbody></table></figure>



<h2 class="wp-block-heading">六、為什麼 ARM 不直接學 x86 做 5-level paging 就好？</h2>



<p>這是和 x86 路線最關鍵的差別。</p>



<p>x86 LA57 的做法很單純：descriptor 還是 64 bits 不變，只是再多疊一層 PML5，把 VA/PA 從 48 bits 推到 57 bits。</p>



<p>ARM 不能這樣做，因為<strong>瓶頸不是「層數不夠」</strong>：<br />
&#8211; ARM 用 FEAT_LPA2 已經把 PA 推到 52 bits（在 4-level 架構內就達到了）<br />
&#8211; 真正的瓶頸是 <strong>64-bit descriptor 的 attribute bits 已經用完</strong></p>



<p>所以 ARM 必須換大的容器（descriptor 64→128 bits），不是只加層級。多出來的 64 bits 不只用來放更長的 PA，更重要的是放<strong>新功能的 metadata</strong>：擴展權限、虛擬化欄位、機密運算識別碼等等。</p>



<p>換句話說：<br />
&#8211; x86 LA57 ＝ 把瓶子疊更高<br />
&#8211; ARM D128 ＝ 換更大的瓶子</p>



<p>兩條路線解決的是不同的問題。</p>



<h2 class="wp-block-heading">七、為什麼 KVM 還沒支援？</h2>



<p>RFC patch 明確標註 KVM 暫不支援。原因不是難度高，而是工作量大。</p>



<p>ARM 虛擬化是 two-stage translation：<br />
&#8211; <strong>Stage 1</strong>：Guest VA → Guest PA（Guest 控制）<br />
&#8211; <strong>Stage 2</strong>：Guest PA → Host PA（Hypervisor 控制）</p>



<p>D128 上線後，<strong>Stage 2 的 page table 也要跟著走 D128 格式</strong>，KVM 的 page table 操作、shadow page table、IPA fault handler 全部都要改。這是另一個 patch series 的規模，所以 RFC 先把 Stage 1 (host kernel) 做出來，KVM 之後另案處理。</p>



<h2 class="wp-block-heading">八、結論</h2>



<p>FEAT_D128 不是「ARM 突發奇想做大記憶體」，而是兩個工程現實的回應：<br />
1. 4 PB 的 PA 上限在十年內可見<br />
2. 64-bit descriptor 的 metadata 空間用完了</p>



<p>代僸昢 page walk 多一層，從 x86 LA57 的實測經驗推估，平均效能退化 &lt; 1%，最壞 case 3–5%，業界普遍可接受。</p>



<p>Linux 提早動作的原因，是 ARM 一貫的節奏：kernel patch 要在 silicon 出貨前準備好，等晶片到位時 distro 已能跑。所以現在看到的是「鋪路」，不是「迫切」。</p>



<p>ARMv9.3 silicon 預計 2027 之後上市，到時就會有實機數字驗證這些推估。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">參考資料</h2>



<h3 class="wp-block-heading">原始新聞</h3>



<ul class="wp-block-list">
<li><a href="https://www.phoronix.com/news/Arm-Linux-FEAT-D128-Patches" target="_blank" rel="noopener">Arm Preparing The Linux Kernel For 128-bit Page Table Entries &#8220;FEAT_D128&#8221; — Phoronix</a></li>
</ul>



<h3 class="wp-block-heading">ARM 官方文件</h3>



<ul class="wp-block-list">
<li><a href="https://developer.arm.com/documentation/109697/latest/Feature-descriptions/The-Armv9-3-architecture-extension" target="_blank" rel="noopener">The Armv9.3 architecture extension — Arm Developer</a></li>



<li><a href="https://documentation-service.arm.com/static/67e40a154191d739c8e9ba20" target="_blank" rel="noopener">Feature names in A-profile architecture — Arm Developer</a></li>



<li><a href="https://developer.arm.com/documentation/ddi0601/latest/AArch64-Registers/TTBR0-EL1--Translation-Table-Base-Register-0--EL1-" target="_blank" rel="noopener">TTBR0_EL1, Translation Table Base Register 0 (EL1) — Arm Developer</a></li>
</ul>



<h3 class="wp-block-heading">效能對比與背景延伸閱讀</h3>



<ul class="wp-block-list">
<li><a href="https://www.jabperf.com/5-level-vs-4-level-page-tables-does-it-matter/" target="_blank" rel="noopener">5-level vs 4-level Page Tables: Does It Matter? — JabPerf</a></li>



<li><a href="https://en.wikipedia.org/wiki/Intel_5-level_paging" target="_blank" rel="noopener">Intel 5-level paging — Wikipedia</a></li>



<li><a href="https://lwn.net/Articles/716324/" target="_blank" rel="noopener">5-level paging — LWN.net</a></li>



<li><a href="https://arxiv.org/pdf/2002.01073" target="_blank" rel="noopener">TLB and Pagewalk Performance in Multicore Architectures (arXiv 2002.01073)</a></li>



<li><a href="https://arxiv.org/pdf/2310.04158" target="_blank" rel="noopener">Victima: Drastically Increasing Address Translation Reach (arXiv 2310.04158)</a></li>



<li><a href="https://krinkinmu.github.io/2024/01/14/aarch64-virtual-memory.html" target="_blank" rel="noopener">AArch64 memory and paging — Mike&#8217;s homepage</a></li>



<li><a href="https://wiki.osdev.org/ARM_Paging" target="_blank" rel="noopener">ARM Paging — OSDev Wiki</a></li>
</ul>
<p>The post <a rel="nofollow" href="https://richliu.com/2026/05/19/6537/arm-%e7%82%ba-linux-%e6%ba%96%e5%82%99-128-bit-page-table-entries%ef%bc%9afeat_d128-%e8%a7%a3%e8%ae%80/">ARM 為 Linux 準備 128-bit Page Table Entries：FEAT_D128 解讀</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2026/05/19/6537/arm-%e7%82%ba-linux-%e6%ba%96%e5%82%99-128-bit-page-table-entries%ef%bc%9afeat_d128-%e8%a7%a3%e8%ae%80/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] 2025 小升級流水帳</title>
		<link>https://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://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://richliu.com/?p=6441</guid>

					<description><![CDATA[<p>都什麼年代了，本來應該不會再寫這種升級流水帳了，不過今天當作日記寫一下吧因為今天有三件大事同時發生，總覺得該紀 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://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://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/17.0.2/72x72/1f62d.png" alt="😭" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f62d.png" alt="😭" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f62d.png" alt="😭" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f62d.png" alt="😭" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f62d.png" alt="😭" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>其它像什麼 virbr0 消失就要吃自己的狗食了<a href="https://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://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://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://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>CyberPower UPS + Apcupsd + Gafana + InfluxDB</title>
		<link>https://richliu.com/2025/05/31/6302/cyberpower-ups-apcupsd-gafana-influxdb/</link>
					<comments>https://richliu.com/2025/05/31/6302/cyberpower-ups-apcupsd-gafana-influxdb/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 31 May 2025 04:23:11 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[apcupsd]]></category>
		<category><![CDATA[Gafana]]></category>
		<category><![CDATA[influxdb]]></category>
		<category><![CDATA[UPS]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=6302</guid>

					<description><![CDATA[<p>因為最近想到不能只是接上 apcupsd ，應該要接上 Gafana 看一下 UPS 的狀況，不過目前 Gaf [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2025/05/31/6302/cyberpower-ups-apcupsd-gafana-influxdb/">CyberPower UPS + Apcupsd + Gafana + InfluxDB</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>因為最近想到不能只是接上 apcupsd ，應該要接上 Gafana 看一下 UPS 的狀況，不過目前 Gafana 預設的 Dashboard 都沒有支援 CyberPower UPS 的，所以就自己改一個，還有點怪怪的問題，不過至少主要數據都是正確的</p>



<p>用 AI 產出來的 configuration files ，DeepSeek 看起來比較正確，只是 Dashboard 跟 Grox 一樣都會錯，到是 Grox 在設定 Gafana 的 influxdB data source 的地方講對了，查詢種類要選 flux 才可以查到資料</p>



<p>試過了 Prometheus，結果發現可用的 Dashboard 更少，感覺沒過幾年世界就變了</p>



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



<p>設定檔我覺得可以丟給 AI ，畢竟我跑在 VM 內部又用 docker 跑，相對上還是麻煩了一點</p>



<p>至於 Gafana 的設定檔我就丟在這邊，堪用還有些小問題但是懶得修了，我只想看 input output 狀態而已<br /><a href="https://github.com/richliu/cp_apc_dash" target="_blank" rel="noopener">https://github.com/richliu/cp_apc_dash</a></p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="2345" height="968" src="https://richliu.com/wp-content/uploads/2025/05/image-28.png" alt="" class="wp-image-6303" srcset="https://richliu.com/wp-content/uploads/2025/05/image-28.png 2345w, https://richliu.com/wp-content/uploads/2025/05/image-28-600x248.png 600w, https://richliu.com/wp-content/uploads/2025/05/image-28-768x317.png 768w, https://richliu.com/wp-content/uploads/2025/05/image-28-1536x634.png 1536w, https://richliu.com/wp-content/uploads/2025/05/image-28-2048x845.png 2048w, https://richliu.com/wp-content/uploads/2025/05/image-28-816x337.png 816w" sizes="(max-width: 2345px) 100vw, 2345px" /></figure>
<p>The post <a rel="nofollow" href="https://richliu.com/2025/05/31/6302/cyberpower-ups-apcupsd-gafana-influxdb/">CyberPower UPS + Apcupsd + Gafana + InfluxDB</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2025/05/31/6302/cyberpower-ups-apcupsd-gafana-influxdb/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AsRock ALTRAD8UD-1L2T Ampere Altra/AltraMax Note</title>
		<link>https://richliu.com/2024/02/07/5766/asrock-altrad8ud-1l2t-ampere-altra-altramax-note/</link>
					<comments>https://richliu.com/2024/02/07/5766/asrock-altrad8ud-1l2t-ampere-altra-altramax-note/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 07 Feb 2024 04:10:41 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[ALTRAD8UD]]></category>
		<category><![CDATA[AltraMax]]></category>
		<category><![CDATA[arm64]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5766</guid>

					<description><![CDATA[<p>ALTRAD8UD-1L2T is based on Ampere Altra Max/Ampere Altr [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/02/07/5766/asrock-altrad8ud-1l2t-ampere-altra-altramax-note/">AsRock ALTRAD8UD-1L2T Ampere Altra/AltraMax Note</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>ALTRAD8UD-1L2T is based on Ampere Altra Max/Ampere Altra processors server mother board. <br />This is an interesting board. AsRock has built a small, but powerful and feature-rich server board that is suitable for homelab use. If you are looking for a pure and powerful ARM64 environment, this is the best choice right now. </p>



<p>What truly impresses me is the board&#8217;s specifications. Not only does it boast a compact Micro-ATX form factor, but it also packs a powerful punch with four PCIe 4.0 x16 lanes, easily handling even demanding homelab tasks. The dual M.2 slots and dual OCULink port can enable software RAID for your NVMe disks. As a server board, it offers a BMC for remote control and system management. While the x64 platform remains popular, this board is an exceptional choice for those who prefer the non-x64 architecture, considering the limited choices with high speed fan options in server platforms. </p>



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



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><ul><li><a href="#information">Information </a><ul><li><a href="#important-spec">Important Spec</a></li><li><a href="#where-to-buy">Where To Buy</a><ul><li><a href="#us-newegg">US/Newegg</a></li><li><a href="#uk-server-factory-ltd">UK/Server Factory Ltd</a></li></ul></li><li><a href="#news">News</a></li><li><a href="#cooling-solution">Cooling solution </a></li><li><a href="#other-reference-url">Other reference URL</a></li></ul></li><li><a href="#tricks-for-altrad-8-ud">Tricks for ALTRAD8UD</a><ul><li><a href="#open-bmc-default-username-password">OpenBMC default username password </a></li><li><a href="#serial-console-over-lan-port">Serial Console over LAN Port</a></li><li><a href="#serial-console-output-to-vga">Serial Console Output To VGA</a></li><li><a href="#ipmitool-fan-control-ref">Ipmitool Fan Control [ref]</a></li><li><a href="#nc-si-port">NC-SI Port </a></li></ul></li><li><a href="#known-issues"> Known Issues</a><ul><li><a href="#intel-x-550-massive-aer-error-messages-ref-1-ref-2">Intel X550 massive AER error messages[ref1][ref2]</a></li></ul></li></ul></nav></div>



<h2 class="wp-block-heading" id="information">Information </h2>



<h3 class="wp-block-heading" id="important-spec">Important Spec</h3>



<p><a href="https://www.asrockrack.com/general/productdetail.asp?Model=ALTRAD8UD-1L2T#Specifications" target="_blank" rel="noopener">AsRock ALTRAD8UD-1L2T Spec web site</a></p>



<h3 class="wp-block-heading" id="where-to-buy">Where To Buy</h3>



<h4 class="wp-block-heading" id="us-newegg">US/Newegg</h4>



<p><a href="https://www.newegg.com/p/N82E16813140130" target="_blank" rel="noopener">ASRock Rack ALTRAD8UD-1L2T Deep Micro-ATX Server Motherboard Single Socket (LGA 4926) Ampere Altra Max/Ampere Altra processors Dual 10G &amp; 1G Without CPU,</a> <br />Mother board only<br />USD$849.-</p>



<p><a href="https://www.newegg.com/p/N82E16813140134" target="_blank" rel="noopener">Asrock Rack Bundle ALTRAD8UD-1L2T Deep Micro-ATX Server Motherboard Single Socket (LGA 4926) with Ampere Altra Q64-22 64 cores &amp; 2U passive cooler, Dual 10G &#8211; Integrated by Asrock Rack with CPU and heatsink</a> <br />Mother board + Altra Q64-22 + 2U passive cooler(heatsink)<br />USD$1,500.-</p>



<h4 class="wp-block-heading" id="uk-server-factory-ltd">UK/Server Factory Ltd</h4>



<p><a href="https://serverfactory.com/asrock-altrad8ud-1l2t.html" target="_blank" rel="noopener">ASRock ALTRAD8UD-1L2T</a>: Board only,  Inc VAT: £870.00. </p>



<h3 class="wp-block-heading" id="news">News</h3>



<p><a href="https://www.servethehome.com/asrock-rack-altrad8ud-1l2t-review-this-is-the-ampere-arm-motherboard-you-want/" target="_blank" rel="noopener">ASRock Rack ALTRAD8UD-1L2T Review This is the Ampere Arm Motherboard You Want</a></p>



<h3 class="wp-block-heading" id="cooling-solution">Cooling solution </h3>



<p><a href="https://www.servethehome.com/making-arm-desktops-viable-ampere-altra-noctua-nh-d9-amp-4926-4u-and-nh-u14s-amp-4926/" target="_blank" rel="noopener">Making Arm Desktops Viable Ampere Altra Noctua NH-D9 AMP-4926 4U and NH-U14S AMP-4926</a> (Preview tower fan system)<br /><a href="https://richliu.com/2024/01/09/5471/ampere-altra-altramax-asrock-altrad8ud-1l2t-liquid-cooling-system/">Ampere Altra/AltraMax AsRock ALTRAD8UD-1L2T Liquid Cooling System</a> (my homemake Liquid/Water cooling system)</p>



<h3 class="wp-block-heading" id="other-reference-url">Other reference URL</h3>



<p><a href="https://wiki.bsdio.com/en/asrock-rack-altrad8ud/introduction" target="_blank" rel="noopener">ASRock Rack ALTRAD8UD Getting Started</a> : A good note to start up to use the board. </p>



<h2 class="wp-block-heading" id="tricks-for-altrad-8-ud">Tricks for ALTRAD8UD</h2>



<p>This chapter aims to guide users through using the ALTRAD8UD board, addressing potential information gaps left by the official ALTRAD8UD manual.</p>



<p>For memory compatibility reference, AsRock offers its own DRAM AVL (Approved Vendor List). Alternatively, users can access the <a href="https://amperecomputing.com/customer-connect/products/altra-family-device-documentation" target="_blank" rel="noopener">Ampere Altra family device document</a>, freely available without registration.</p>



<h3 class="wp-block-heading" id="open-bmc-default-username-password">OpenBMC default username password </h3>



<p>User: root<br />Pass: 0penBmc (first word is zero, not O).<br />both BMC console and GUI&#8217;s default username password are the same. </p>



<h3 class="wp-block-heading" id="serial-console-over-lan-port">Serial Console over LAN Port</h3>



<p>The board support Serial Port Header (9-pin COM1), it needs to use this serial port or VGA port to enter BIOS and get BMC IP. <br />After get the BMC IP, it can get more information from serial console over LAN port <br />Port 2201: ATF console <br />Port 2202: SCP console <br />Port 2203: Host console <br />Port 22: ssh console<br /><br />Here is my script to run the sol and make it more easy to use</p>



<pre class="wp-block-preformatted"># It can put following two lines to bashrc
alias oit='ipmitool -U root -P 0penBmc -I lanplus -C 17'
alias ossh="sshpass -p 0penBmc ssh -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null -oStrictHostKeyChecking=no"

# get host console 
ossh root@&lt;bmc ip> -p 2203 
# get in bmc ssh console 
ossh root@&lt;bmc ip> </pre>



<h3 class="wp-block-heading" id="serial-console-output-to-vga">Serial Console Output To VGA</h3>



<p>If you cannot see the serial console output to console port, probably it bacuase this option was enabled[<a href="https://richliu.com/2023/08/01/5267/arm64-cannot-output-linux-kernel-message-to-vga/">ref</a>], just turn it off and add console=tty0 or console=ttyAMA0 to grub.conf, ex:</p>



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



<h3 class="wp-block-heading" id="ipmitool-fan-control-ref">Ipmitool Fan Control [<a href="https://www.asrockrack.com/support/faq.tw.asp?id=38" target="_blank" rel="noopener">ref</a>]</h3>



<pre class="wp-block-preformatted">Manual Full speed
ipmitool raw 0x3a 0x01 0x64 0x64 0x64 0x64 0x64 0x64 0x64 0x64

Manual Half speed
ipmitool raw 0x3a 0x01 0x32 0x32 0x32 0x32 0x32 0x32 0x32 0x32

Auto fan control
ipmitool raw 0x3a 0x01 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0</pre>



<h3 class="wp-block-heading" id="nc-si-port">NC-SI Port </h3>



<p>In the user manual, NC-SI port is typo, the NC-SI port location is 5, in the document which marked as IPMI LAN port. if use this port, both host and BMC can use the same network cable to connect to the same ethernet. <br /></p>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img decoding="async" width="1220" height="952" src="https://richliu.com/wp-content/uploads/2024/02/image-13.png" alt="" class="wp-image-5768" style="aspect-ratio:1.281512605042017;width:364px;height:auto" srcset="https://richliu.com/wp-content/uploads/2024/02/image-13.png 1220w, https://richliu.com/wp-content/uploads/2024/02/image-13-600x468.png 600w, https://richliu.com/wp-content/uploads/2024/02/image-13-768x599.png 768w" sizes="(max-width: 1220px) 100vw, 1220px" /></figure>
</div>


<h2 class="wp-block-heading" id="known-issues"><br /><br />Known Issues</h2>



<h3 class="wp-block-heading" id="intel-x-550-massive-aer-error-messages-ref-1-ref-2">Intel X550 massive AER error messages[<a href="https://www.thomas-krenn.com/en/wiki/PCIe_Bus_Error_Status_00001100" target="_blank" rel="noopener">ref</a>1][<a href="https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1521173" target="_blank" rel="noopener">ref</a>2]</h3>



<p></p>



<p>Seems that Intel NICs have compatibility issues with non-Intel platform systems. This can cause some server safety systems, like Advanced Error Reporting (AER), to generate many alerts and experience interface problems. A temporary solution is to add aspi_aspm=off to the Linux kernel parameters, ex:</p>



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



<p>It will fix the AER issue. </p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/02/07/5766/asrock-altrad8ud-1l2t-ampere-altra-altramax-note/">AsRock ALTRAD8UD-1L2T Ampere Altra/AltraMax Note</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2024/02/07/5766/asrock-altrad8ud-1l2t-ampere-altra-altramax-note/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://richliu.com/2024/02/04/5764/apt-cacher-ng-e-failed-to-fetch-503-connection-closed-check-dlmaxretries/</link>
					<comments>https://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://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://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://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://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://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://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>Ampere Altra/AltraMax AsRock ALTRAD8UD-1L2T Liquid Cooling System</title>
		<link>https://richliu.com/2024/01/09/5471/ampere-altra-altramax-asrock-altrad8ud-1l2t-liquid-cooling-system/</link>
					<comments>https://richliu.com/2024/01/09/5471/ampere-altra-altramax-asrock-altrad8ud-1l2t-liquid-cooling-system/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Tue, 09 Jan 2024 03:20:34 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[AltraMax]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[arm64]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5471</guid>

					<description><![CDATA[<p>Chinese version Article is here (Ampere Altra/AltraMax  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/01/09/5471/ampere-altra-altramax-asrock-altrad8ud-1l2t-liquid-cooling-system/">Ampere Altra/AltraMax AsRock ALTRAD8UD-1L2T Liquid Cooling System</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img decoding="async" width="2560" height="1920" src="https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-scaled.jpg" alt="" class="wp-image-5462" style="aspect-ratio:1.3333333333333333;width:224px;height:auto" srcset="https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-scaled.jpg 2560w, https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-600x450.jpg 600w, https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-768x576.jpg 768w, https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-1536x1152.jpg 1536w, https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-2048x1536.jpg 2048w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure>
</div>


<p>Chinese version Article is <a href="ttps://blog.richliu.com/2024/01/09/5446/ampere-altra-altramax-加asrock-altrad8ud-1l2t-水冷方案/">here (Ampere Altra/AltraMax 加AsRock ALTRAD8UD-1L2T 水冷方案)</a><br />2024/01<a href="https://www.servethehome.com/making-arm-desktops-viable-ampere-altra-noctua-nh-d9-amp-4926-4u-and-nh-u14s-amp-4926/" target="_blank" rel="noopener">/31 Update: Ampere will have 2U passive cooler Making Arm Desktops Viable Ampere Altra Noctua NH-D9 AMP-4926 4U and NH-U14S AMP-4926</a></p>



<p>The Ampere Altra/AltraMax CPU features a maximum of 128 ARM64 cores, typically found in cloud server. However, cloud server Care not suitable for placement in offices or homes due to the high-speed fans used for heat dissipation. The noise generated by these fans is generally intolerable for regular users. Additionally, adapting server motherboards to standard consumer motherboards is inconvenient. If there is a desire to utilize such a CPU in a different setting, the <a href="https://www.adlinktech.com/products/Computer_on_Modules/COM-HPC-Server-Carrier-and-Starter-Kit/Ampere_Altra_Developer_Platform?lang=en" target="_blank" rel="noopener">ADLink Ampere Altra Dev Platform</a> presents a viable solution, complete with the option for liquid cooling.</p>



<p>Another solution is the <a href="https://www.newegg.com/p/N82E16813140134" target="_blank" rel="noopener">AsRock ALTRAD8UD-1L2T</a>, currently available on <a href="https://www.newegg.com/p/N82E16813140134" target="_blank" rel="noopener">Newegg</a>. Paired with an Ampere Altra Q64-22 CPU (64 cores, 2.2GHz), it comes with a complimentary 2U passive heatsink, priced at US$1,500, which can be considered affordable. However, it&#8217;s worth noting that the included heatsink is passive. If you prefer liquid cooling over installing a fan on the passive heatsink, then this article is the right guide for you.</p>



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



<p><br />The author have adding a declaration at the beginning of articles that may pose potential risks:</p>



<ul class="wp-block-list">
<li>This article is not an official endorsement by Ampere, Newegg, or any other mentioned merchants or vendors. It is solely a personal record.</li>



<li>The author has a business relationship related to the production of the mentioned motherboard.</li>



<li>The author is a first-time to use liquid cooling computer system , and the content may not be entirely accurate. Please be aware of potential risks.</li>



<li>This article is not an official document from Ampere or AsRock.</li>



<li>The original article is in Chinese, and the English translation is done using machine translation. Please forgive any inaccuracies in wording.</li>



<li><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">I am not responsible for any consequences resulting from this article; for example, losses incurred due to improper implementation of instructions provided in this article.</mark></li>
</ul>



<p>The Ampere system primarily focuses on Cloud-native CPUs, and as of now, there is no manufacturer producing general-purpose cooling systems for it. The included 2U passive heatsink in this system is designed for server use, utilizing high-speed server fans for heat dissipation. While the Q64-22 included by Newegg has lower power consumption, its only cooling method involves direct airflow from an electric fan. Alternatively, users may resort to attaching an 8-inch fan onto it. Such cooling solutions are deemed unacceptable for enthusiasts and professionals like myself.</p>



<p>If you intend to upgrade the cooling system, typical tower-type coolers require replacing the fixture on the back of the motherboard. Moreover, compatibility with the fastening mechanisms of this specific motherboard can be challenging to find. Considering that only front-facing screws can be used, the only viable cooling solution is a liquid cooling system. Therefore, I have been experimenting with a liquid cooling solution that works for this scenario. I&#8217;m sharing this information for those adventurous individuals who might encounter similar challenges, and perhaps this approach can inspire some creative solutions.</p>



<p>In the upcoming sections of this article, I will guide you on how to set up a liquid cooling system specifically tailored for the Ampere Altra on the ALTRAD8UD-1L2T motherboard. In theory, since the screw hole positions are the same, this method should be applicable to other Ampere motherboards as well. However, the focus of this content will primarily be on the ALTRAD8UD-1L2T. The article will also cover any pitfalls encountered during assembly and the items needed for the setup(Chinese website).</p>



<h2 class="wp-block-heading">Preparation</h2>



<h3 class="wp-block-heading">ALTRAD8UD-1L2T</h3>



<p><br />You can find the specifications for this motherboard online, and I won&#8217;t repeat them here. However, what might confuse some people is the term &#8220;Deep mATX.&#8221; This is a specification unique to AsRock, where they increase the depth dimension of the mATX form factor while maintaining the standard width. The purpose is to provide more space to accommodate additional components. This particular specification is commonly seen in AsRock&#8217;s server-grade motherboards.</p>



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



<p>Generally, most computer cases should work. However, I made a mistake on my end by choosing a case that was too small. The case I purchased is the Antec P110 Silent. While it has liquid cooling mounting points, it is not suitable for adding a liquid cooling system. The internal space is too limited, lacking a designated area for securing the water pump. Additionally, the Antec P110 liquid cooling radiator cannot be placed at the top as it interferes with the motherboard. Consequently, the radiator had to be positioned at the front of the case.</p>



<p>When making a purchase, it&#8217;s crucial to choose a case that is suitable for water cooling. In more extreme cases, considering a caseless system might be an option (hopefully, this can be updated in the next release).</p>



<p>Cases designed for liquid cooling systems typically have more significant internal space to accommodate a water pump, and there is ample room for fans without obstruction. Some all-in-one water cooling designs may be more compact and might not encounter this issue.</p>



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



<p><br />Liquid cooling systems have some considerations to take into account:</p>



<ul class="wp-block-list">
<li>Tubing type: Choose between soft or hard tubing. Hard tubing is suitable for experienced users, offering a longer lifespan and a more aesthetic appearance. Soft tubing is easier for assembly, making it suitable for beginners.</li>



<li>All-in-one (AIO) or custom loop: Decide whether to go for a pre-assembled AIO liquid cooling system or build a custom loop system.</li>
</ul>



<p>Since the initial focus was on researching liquid cooling, the combination chosen was a custom loop with soft tubing. Building a custom loop may encounter some issues, with one of the main challenges being the uncertainty about specifications.</p>



<p>The first crucial aspect is determining the size of the liquid cooling tubing, as additional components will depend on this size, limiting the options for procurement. Currently, the mainstream sizes are two-eighths (2/8’), three-eighths (3/8’), and four-eighths (4/8’) liquid cooling tubing. </p>



<p>Another parameter is the thickness of the tubing, thick tubing and thin tubing. <br />* thick tubing refer to 10/16mm or 3/8”-5/8” tubing. <br />* thin thbing refer to 10/13mm or 3/8”-1/2″ tubing. </p>



<p>Most common  the inner diameter specification is G 1/4, when find some liquid colling componens like pressure relief valve needs it. </p>



<p>Once you&#8217;ve confirmed your inner and outer diameter, you can proceed to purchase the necessary liquid cooling components.</p>



<p>At a minimum, you&#8217;ll need:</p>



<ul class="wp-block-list">
<li>CPU water block *1</li>



<li>Water Pump *1</li>



<li>240mm radiator *1</li>



<li>12cm fans *2</li>



<li>Liquid coolant 500cc ~ 1000cc</li>



<li>Tubing 2M</li>



<li>Thermal paste</li>



<li>Pressure relief valve</li>



<li>Fittings: Quick connectors *6, 90-degree rotary fittings *(1~2)</li>



<li>Tools for filling and draining: Filling tool, draining tool (watering can, large syringe, drainage hose)</li>
</ul>



<p>Optional components:</p>



<ul class="wp-block-list">
<li>Flow meter, temperature gauge (note: buying these requires purchasing two additional quick connectors).</li>
</ul>



<p></p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="846" height="863" src="https://richliu.com/wp-content/uploads/2024/01/image-9.png" alt="" class="wp-image-5448" style="aspect-ratio:0.9803012746234068;width:541px;height:auto" srcset="https://richliu.com/wp-content/uploads/2024/01/image-9.png 846w, https://richliu.com/wp-content/uploads/2024/01/image-9-588x600.png 588w, https://richliu.com/wp-content/uploads/2024/01/image-9-768x783.png 768w" sizes="auto, (max-width: 846px) 100vw, 846px" /></figure>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="651" height="637" src="https://richliu.com/wp-content/uploads/2024/01/image-10.png" alt="" class="wp-image-5449" srcset="https://richliu.com/wp-content/uploads/2024/01/image-10.png 651w, https://richliu.com/wp-content/uploads/2024/01/image-10-600x587.png 600w" sizes="auto, (max-width: 651px) 100vw, 651px" /></figure>



<p><br />In practical testing, if focusing solely on CPU cooling, it appears that a 240mm radiator is sufficient. The thin three-eighths (3/8”) tubing provides a large enough water flow diameter. Choosing a smaller tube diameter may not be as suitable for this purpose.</p>



<h3 class="wp-block-heading">CPU water block</h3>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="514" height="512" src="https://richliu.com/wp-content/uploads/2024/01/image-11.png" alt="" class="wp-image-5450" style="aspect-ratio:1.00390625;width:263px;height:auto" srcset="https://richliu.com/wp-content/uploads/2024/01/image-11.png 514w, https://richliu.com/wp-content/uploads/2024/01/image-11-300x300.png 300w" sizes="auto, (max-width: 514px) 100vw, 514px" /></figure>
</div>


<p>This turned out to be quite troublesome. My original plan was to purchase a 50mmx50mm heatsink and connect it to the heatsink on the right. Then, I intended to secure it to the CPU socket using the fixtures shown in the image. However, as expected, unexpected issues arose – the world isn&#8217;t always that kind.</p>



<ol class="wp-block-list">
<li>There was no water block with a 50mmx50mm connector available. So, I ended up buying a 40mmx40mm connector, one size smaller. This resulted in poorer heat dissipation performance. Fortunately, I never had the chance to test the inferior heat dissipation, so this step failed unnoticed.</li>



<li>Here&#8217;s where I made a mistake. Custom water block connectors, like the one shown, are typically 2/8&#8243; fittings. However, the main liquid cooling system I bought has 3/8&#8243; fittings, making them completely incompatible. The options were either to change the fittings or change the entire system. Changing the fittings was the more cost-effective choice, so I opted for that.</li>
</ol>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="787" height="1050" src="https://richliu.com/wp-content/uploads/2024/01/image-12.png" alt="" class="wp-image-5451" style="aspect-ratio:0.7495238095238095;width:237px;height:auto" srcset="https://richliu.com/wp-content/uploads/2024/01/image-12.png 787w, https://richliu.com/wp-content/uploads/2024/01/image-12-450x600.png 450w, https://richliu.com/wp-content/uploads/2024/01/image-12-768x1025.png 768w" sizes="auto, (max-width: 787px) 100vw, 787px" /></figure>
</div>


<p>After connecting , it looked like the image on the right – and just looking at it made me worry that water would leak out.</p>



<p>So, I bought a two-eighths(2/8&#8243;) tubing to connect to this connector. However, while it could connect, it couldn&#8217;t link up with my three-eighths(3/8&#8243;) tubing in the water cooling system. I had to reluctantly abandon the custom water block connector.</p>



<p>The final solution had nothing to do with this connector.</p>



<p></p>



<p></p>



<h3 class="wp-block-heading">Communical CPU water block</h3>



<p>During the installation, I discovered that the Bykski CPU-XPH-T8 CPU water block, along with the provided adapter bracket, could be securely attached to the Ampere Altra&#8217;s socket. This was fantastic news and saved me a great deal of effort.</p>



<p>Although it&#8217;s designed for Intel LGA1700/LGA2066 sockets, the flexibility in its hole configuration allowed for adjustments, providing me with the necessary adaptability. As for whether other CPU brackets might be compatible, it&#8217;s likely that some could work. However, I haven&#8217;t had the chance to try others yet. If you have attempted this and found success, please let me know.</p>



<p>The base of this water block is quite substantial, and my intuition tells me that the cooling performance should be excellent. Therefore, I didn&#8217;t explore other compliant CPU water blocks.</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1109" height="976" src="https://richliu.com/wp-content/uploads/2024/01/image-16.png" alt="" class="wp-image-5455" style="aspect-ratio:1.1362704918032787;width:364px;height:auto" srcset="https://richliu.com/wp-content/uploads/2024/01/image-16.png 1109w, https://richliu.com/wp-content/uploads/2024/01/image-16-600x528.png 600w, https://richliu.com/wp-content/uploads/2024/01/image-16-768x676.png 768w" sizes="auto, (max-width: 1109px) 100vw, 1109px" /></figure>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow">
<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1196" height="722" src="https://richliu.com/wp-content/uploads/2024/01/image-14.png" alt="" class="wp-image-5453" srcset="https://richliu.com/wp-content/uploads/2024/01/image-14.png 1196w, https://richliu.com/wp-content/uploads/2024/01/image-14-600x362.png 600w, https://richliu.com/wp-content/uploads/2024/01/image-14-768x464.png 768w" sizes="auto, (max-width: 1196px) 100vw, 1196px" /></figure>
</div>
</div>



<p><br />However, another issue arises. The water block is 56mmx56mm, whereas the width of the Ampere Altra CPU socket is 55mm. The water block does not fit. At this point, there are two possible solutions:</p>



<p>Upon observing the CPU&#8217;s structure, the first solution seemed unfeasible. Cutting down the thickness of this water block would compromise its structural integrity, not to mention finding the tools or a professional service for the task.</p>



<p>Thus, the only viable option is the second solution. The simplest and most intuitive way to implement this is by using a thermal pad made of silicone to transfer heat upwards from the CPU.</p>



<h3 class="wp-block-heading">Silicone Thermal Pad </h3>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="1286" height="707" src="https://richliu.com/wp-content/uploads/2024/01/image-17.png" alt="" class="wp-image-5456" style="aspect-ratio:1.818953323903819;width:322px;height:auto" srcset="https://richliu.com/wp-content/uploads/2024/01/image-17.png 1286w, https://richliu.com/wp-content/uploads/2024/01/image-17-600x330.png 600w, https://richliu.com/wp-content/uploads/2024/01/image-17-768x422.png 768w" sizes="auto, (max-width: 1286px) 100vw, 1286px" /></figure>
</div>


<p>But things couldn&#8217;t be as simple as I, a fool, initially thought. In conclusion, regular silicone thermal pads are not suitable for power monsters like the Ampere Altra. This type of thermal pad may be effective for low-power devices such as routers, switches, NVMe disks, etc., but it&#8217;s not useful for high-power CPUs.</p>



<p>In the image, there are 2mm thick silicone thermal pads, and you need two layers because the height is just that much. Essentially, this provides only a slight improvement over having no heat dissipation at all, so it&#8217;s not worth considering.</p>



<p>As for the high-efficiency silicone thermal pads available in the market, I don&#8217;t know if they would work. If you have them on hand, you can give them a try. However, I believe the chances of success are quite low.</p>



<h3 class="wp-block-heading"><br />Purple Copper Thermal Pad</h3>


<div class="wp-block-image">
<figure class="alignright size-full is-resized"><img loading="lazy" decoding="async" width="1468" height="833" src="https://richliu.com/wp-content/uploads/2024/01/image-18.png" alt="" class="wp-image-5457" style="aspect-ratio:1.7623049219687874;width:317px;height:auto" srcset="https://richliu.com/wp-content/uploads/2024/01/image-18.png 1468w, https://richliu.com/wp-content/uploads/2024/01/image-18-600x340.png 600w, https://richliu.com/wp-content/uploads/2024/01/image-18-768x436.png 768w" sizes="auto, (max-width: 1468px) 100vw, 1468px" /></figure>
</div>


<p><br />Nowadays, a common method for cooling is using purple copper heat pipes. This type of heat dissipation is quite effective, and the 2U passive heatsink included with Newegg utilizes these heat pipes. Therefore, if we can customize the heatsink, wouldn&#8217;t that solve the problem? Luckily, the country right next to my country is the world&#8217;s largest manufacturing factory, capable of customizing just about anything. This made the solution very affordable and instantly resolved my problem.</p>



<p>The dimensions of the purple copper thermal pad are: Length x Width x Height = 64x54x4mm, with a rounded R5 edge.</p>



<p>Alternatively, you can measure the dimensions of the piece under the 2U passive heatsink to get the specifications. Placing it on the original heatsink, I can say the dimensions match perfectly. The craftsmanship is quite impressive, and there are no issues when it&#8217;s actually placed.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-scaled.jpg" alt="" class="wp-image-5458" srcset="https://richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-scaled.jpg 2560w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-600x450.jpg 600w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-768x576.jpg 768w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-1536x1152.jpg 1536w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240108_235640-2048x1536.jpg 2048w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></figure>



<h2 class="wp-block-heading">Assembly</h2>



<p><br />First, place the purple copper thermal pad, and remember to apply thermal paste before doing so.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-scaled.jpg" alt="" class="wp-image-5459" srcset="https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-scaled.jpg 2560w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-600x450.jpg 600w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-768x576.jpg 768w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-1536x1152.jpg 1536w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184648-2048x1536.jpg 2048w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></figure>



<p>Apply thermal paste before placing CPU water cooling block. </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-scaled.jpg" alt="" class="wp-image-5460" srcset="https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-scaled.jpg 2560w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-600x450.jpg 600w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-768x576.jpg 768w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-1536x1152.jpg 1536w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184740-2048x1536.jpg 2048w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></figure>



<p><br />Assemble the components.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-scaled.jpg" alt="" class="wp-image-5461" srcset="https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-scaled.jpg 2560w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-600x450.jpg 600w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-768x576.jpg 768w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-1536x1152.jpg 1536w, https://richliu.com/wp-content/uploads/2024/01/IMG_20240105_184300-2048x1536.jpg 2048w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></figure>



<p>Actually, I assembled the tubing on the left side incorrectly. I&#8217;ll need to purchase materials and quick connectors to replace it when I have the time. But for now, let&#8217;s leave it as is and make do.</p>



<p>Overall view.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="2560" height="1920" src="https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-scaled.jpg" alt="" class="wp-image-5462" srcset="https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-scaled.jpg 2560w, https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-600x450.jpg 600w, https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-768x576.jpg 768w, https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-1536x1152.jpg 1536w, https://richliu.com/wp-content/uploads/2024/01/IMG_20231212_001937-2048x1536.jpg 2048w" sizes="auto, (max-width: 2560px) 100vw, 2560px" /></figure>



<p> <br />This way, it&#8217;s evident that the case isn&#8217;t ideal. It&#8217;s too cramped, affecting airflow, and it cannot accommodate the components properly.</p>



<h2 class="wp-block-heading">Shopping</h2>



<p>If you are interested in replicating my setup, all the components were purchased from Taobao. I spent extra for testing and experimenting, but in reality, you should be able to set up the entire cooling system for around US$100 or NTD$3,000. This is comparable to the cost of an efficient dual-fan tower cooler.</p>



<p>Since this is a Chinese website, I&#8217;ll keep the text in Chinese and provide English translations afterward.</p>



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



<p><a href="https://item.taobao.com/item.htm?spm=a1z09.2.0.0.17af2e8dIZLPG3&amp;id=689355457926&amp;_u=81mce81r4a19" target="_blank" rel="noopener">watertiger定制台式机电脑分体式CPU显卡水冷软管套装冷散热器</a> (&#8220;WaterTiger Custom Desktop Computer Split-Type CPU GPU Liquid Cooling Soft Tube Kit Radiator&#8221;)<br />Enter the URL choice &#8220;單 CPU 水冷 240 冷排&#8221; (&#8220;Single CPU Liquid Cooling 240 Radiator&#8221;)</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1146" height="780" src="https://richliu.com/wp-content/uploads/2024/01/image-19.png" alt="" class="wp-image-5463" srcset="https://richliu.com/wp-content/uploads/2024/01/image-19.png 1146w, https://richliu.com/wp-content/uploads/2024/01/image-19-600x408.png 600w, https://richliu.com/wp-content/uploads/2024/01/image-19-768x523.png 768w" sizes="auto, (max-width: 1146px) 100vw, 1146px" /></figure>



<p>At first, I chose this brand because the photos looked appealing, but it turned out to be a fortunate coincidence that saved me a lot of exploration time. This brand integrates various components into a set for sale, and the components they use are of decent quality. For example, they use the Enermax NEOChanger as the water pump, which is also a good pump. If you are familiar enough, you might not need these kits.</p>



<p>This kit does not include a pressure relief valve. You&#8217;ll need to purchase a pressure relief valve separately, and depending on your needs, you might want to buy additional quick connectors</p>



<h3 class="wp-block-heading">Clamping Fittings</h3>



<p>All the components can be purchased from the same place, saving the hassle of searching everywhere. It&#8217;s a good idea to buy a few extra parts to avoid trouble later on. The time cost is much higher than the cost of the components.</p>



<p><a href="https://item.taobao.com/item.htm?_u=81mce81r8034&amp;id=38513060164&amp;spm=a1z09.2.0.0.17af2e8dIZLPG3" target="_blank" rel="noopener">电脑水冷头扣具卡具CPU显卡南北桥固定笔记本散热器压条五金夹具</a> (&#8220;Computer Water Cooling Head Fastening Fixture, CPU GPU North-South Bridge Fixing, Laptop Heatsink Clamp, Hardware Clamp&#8221;)</p>



<p>Choice 台式机CPU冷头扣具(&#8220;Desktop CPU Cooling Head Fastening Fixture&#8221;) *2 </p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="543" height="358" src="https://richliu.com/wp-content/uploads/2024/01/image-20.png" alt="" class="wp-image-5464"/></figure>



<p><br /><a href="https://item.taobao.com/item.htm?_u=81mce81rb354&amp;id=39519155251&amp;spm=a1z09.2.0.0.17af2e8dIZLPG3" target="_blank" rel="noopener">M2 M3 M4不锈钢平头盘头螺丝钉水冷头水冷排机箱风扇安装长螺丝</a> (&#8220;M2 M3 M4 Stainless Steel Flat Head Countersunk Screws for Water Cooling Head, Radiator, Case Fan Installation &#8211; Long Screws&#8221;)</p>



<p>Fastening fixtures for securing CPU coolers and water blocks. The components can be increased based on requirements. The minimum required quantity includes<br />M3手拧螺母 (M3 thumb nuts)*4，M3*30 (M3 screws) *4 ，M3垫片(M3 washers) *4  ，M3六角螺母(M3 hex nuts) *4<br /></p>



<p><a href="https://item.taobao.com/item.htm?spm=a1z09.2.0.0.17af2e8dIZLPG3&amp;id=538187007087&amp;_u=81mce81r8677" target="_blank" rel="noopener">电脑水冷水流计 液冷散热器流量器 流体温度观测器透明水流指示计</a> (&#8220;Computer Liquid Cooling Flow Meter, Liquid Cooler Flow Indicator, Fluid Temperature Monitor Transparent Flow Meter&#8221;) (option)</p>



<p>Choice: 3孔水流观测器 + 温度计 (&#8220;3-Port Flow Meter + Thermometer for Water Flow Observation&#8221;)</p>



<p>Nice to have items, but it can make me feel better. </p>



<h2 class="wp-block-heading">Test Result</h2>



<p>This system feels relatively quiet and not noisy.</p>



<p>The following tests are only for verifying the liquid cooling setup and are not formal performance tests. The results are provided for liquid cooling reference and do not include testing power consumption, etc.</p>



<p>Room temperature: 25 degrees Celsius<br />CPU : Ampere AltraMax 128-30<br />Run command :  stress-ng &#8211;cpu 128 &#8211;iomix 128 &#8211;vm 128</p>



<p>Gentoo Linux kernel 6.6 ，CPU temperature is approximately，Power consumption CPU 150W/ IO 19W<br />Ubuntu 22.04 kernel 6.2(?)，CPU temperature is approximately 72 degrees，Power consumption CPU 178W/ IO 20W</p>



<p>In conclusion, I hope this article has been helpful for those eager to try it out.</p>



<h2 class="wp-block-heading">Afterword</h2>



<p>Newegg has also listed another model, which is only the motherboard version, only US$849.-<br /><a href="https://www.newegg.com/p/N82E16813140130" target="_blank" rel="noopener">ASRock Rack ALTRAD8UD-1L2T Deep Micro-ATX Server Motherboard Singel Socket (LGA 4926) Ampere Altra Max/Ampere Altra processors Dual 10G &amp; 1G</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2024/01/09/5471/ampere-altra-altramax-asrock-altrad8ud-1l2t-liquid-cooling-system/">Ampere Altra/AltraMax AsRock ALTRAD8UD-1L2T Liquid Cooling System</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2024/01/09/5471/ampere-altra-altramax-asrock-altrad8ud-1l2t-liquid-cooling-system/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ARM64 cannot output Linux kernel message to VGA</title>
		<link>https://richliu.com/2023/08/01/5267/arm64-cannot-output-linux-kernel-message-to-vga/</link>
					<comments>https://richliu.com/2023/08/01/5267/arm64-cannot-output-linux-kernel-message-to-vga/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Tue, 01 Aug 2023 12:25:08 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5267</guid>

					<description><![CDATA[<p>If you tried every way on output to Linux kernel, but n [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/08/01/5267/arm64-cannot-output-linux-kernel-message-to-vga/">ARM64 cannot output Linux kernel message to VGA</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>If you tried every way on output to Linux kernel, but nothing work. Probably that&#8217;s because <a href="https://learn.microsoft.com/en-us/windows-hardware/drivers/serports/serial-port-console-redirection-table" target="_blank" rel="noreferrer noopener">SPCR(Serial Port Console Redirection Table)</a>, and this option default is enable. </p>



<p>Just disable it in your BIOS and add &#8220;console=tty0&#8221; to /etc/default/grub, then update grub.cfg. it will work. </p>



<p>In AMI BIOS, it should be in the Advanced-&gt;Serial Port Console Redirection-&gt;Console Redirection </p>



<p>Set it to [Disabled] </p>



<p>Some Linux distrubtions might not use GRUB_CMDLINE_LINUX in the file  /etc/default/grub  with grub paramater <strong>GRUB_ENABLE_BLSCFG=true</strong>, if you this parameter in th e grub.cfg file, please disable it. </p>



<p>ref.<br /><a href="https://lore.kernel.org/linux-serial/20200430161438.17640-1-alpernebiyasak@gmail.com/T/" target="_blank" rel="noreferrer noopener">[RFC PATCH v2 0/3] Prefer working VT console over SPCR and device-tree chosen stdout-path</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/08/01/5267/arm64-cannot-output-linux-kernel-message-to-vga/">ARM64 cannot output Linux kernel message to VGA</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2023/08/01/5267/arm64-cannot-output-linux-kernel-message-to-vga/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu/Fedora PXE Boot</title>
		<link>https://richliu.com/2023/04/16/5181/ubuntu-fedora-pxe-boot/</link>
					<comments>https://richliu.com/2023/04/16/5181/ubuntu-fedora-pxe-boot/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 15 Apr 2023 16:56:38 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[pxe]]></category>
		<category><![CDATA[pxeboot]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5181</guid>

					<description><![CDATA[<p>Before setting up Ubuntu/Fedora PXE boot, it needs to p [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/04/16/5181/ubuntu-fedora-pxe-boot/">Ubuntu/Fedora PXE Boot</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Before setting up Ubuntu/Fedora PXE boot, it needs to prepare several items on your PXE server:</p>



<ul class="wp-block-list">
<li>* The Ubuntu/Fedora rootfs on tftp/nfs server:<br />It can refer to the my article <a href="https://richliu.com/2017/02/23/2098/mips_arm64_debian_ubuntu_debootstrap/" target="_blank" rel="noreferrer noopener">MIPS/ARM64 Debian/Ubuntu debootstrap</a> for building the Ubuntu rootfs. <br />If want to build the Fedora rootfs, it can install a new system on qemu and copy it from the qcow2 image.</li>
</ul>



<ul class="wp-block-list">
<li>* PXE Server:<br />You can refer my article  <a href="https://richliu.com/2020/04/08/4263/arm64-centos8-pxe-boot/" target="_blank" rel="noreferrer noopener">ARM64 Centos8/Ubuntu PXE Boot Install on Ubuntu Server</a>  to build a PXE server.</li>
</ul>



<ul class="wp-block-list">
<li>NFS Server:<br /> Assume the rootfs for Ubuntu is on /nfs/ubuntu2204 and Fedora 36 is on /nfs/fedora36.</li>
</ul>



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



<h2 class="wp-block-heading">Ubuntu PXE Boot</h2>



<p>Copy vmlinux and initramfs to tftp server. Copy your current system’s vmlinux to your tftpboot. For example, create a directory for Ubuntu 22.04 in /tftpboot/nfs/ubuntu2204, and copy the vmlinuz to the folder using the following command:</p>



<pre class="wp-block-preformatted">$ cp /boot/vmlinuz-$(uname -r) /tftpboot/nfs/ubuntu2204/vmlinuz</pre>



<p>Copy the initrd.img to the folder using the following command:</p>



<pre class="wp-block-preformatted">$ cp /boot/initrd.img-$(uname -r) /tftpboot/nfs/ubuntu2204/initrd.img</pre>



<p>Setup your PXE server’s grub.cfg and add a record. Use the following example for the record:</p>



<pre class="wp-block-preformatted">menuentry 'Ubuntu22.04 nfsboot' { 
    linux nfs/ubuntu2204/vmlinuz ip=dhcp root=/dev/nfs nfsroot=&lt;NFS server IP>:/nfs/ubuntu2204,nolock rw netboot=nfs 
    initrd nfs/ubuntu2204/initrd.img 
}
</pre>



<h2 class="wp-block-heading">Fedora PXE Boot</h2>



<p>The procedure is similar to Ubuntu, but the default Fedora initramfs doesn&#8217;t support nfs boot.<br />1. Rebuild the initramfs with dracut. You need to add nfs and network support to your Fedora initramfs using the following command:</p>



<pre class="wp-block-preformatted">$ dracut --add nfs --add network --force</pre>



<p>It will generate the same name vmlinuz and initramfs. Copy it to your directory just like Ubuntu.<br />2. Disable selinux. <br />Default Fedora selinux is enabled, but it cannot enable on nfs rootfs (or it can but needs to set up something). You can disable it by adding selinux=0 on boot kernel parameter. Use the following example for the record:</p>



<pre class="wp-block-preformatted">linux nfs/fedora36/vmlinuz boot=nfs root=/dev/nfs nfsroot=&lt;NFS server IP>:/nfs/fedora36,nolock rw netboot=nfs ip=dhcp selitarnux=0</pre>
<p>The post <a rel="nofollow" href="https://richliu.com/2023/04/16/5181/ubuntu-fedora-pxe-boot/">Ubuntu/Fedora PXE Boot</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2023/04/16/5181/ubuntu-fedora-pxe-boot/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Build CentOS 8 Kernel from Source on ARM64 Platform</title>
		<link>https://richliu.com/2022/12/08/5005/build-centos-8-kernel-from-source-on-arm64-platform/</link>
					<comments>https://richliu.com/2022/12/08/5005/build-centos-8-kernel-from-source-on-arm64-platform/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 08 Dec 2022 12:19:34 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=5005</guid>

					<description><![CDATA[<p>Due to CentOS website document cannot provide a simple  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/12/08/5005/build-centos-8-kernel-from-source-on-arm64-platform/">Build CentOS 8 Kernel from Source on ARM64 Platform</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Due to CentOS website document cannot provide a simple instruction to build CentOS 8 stream with some easy steps. So, I make a note to record these procedures about how to build it. <br /><br />Detail description and instruction, please refer to CentOS document, but if you have read the document and still don&#8217;t know how to do that, it can follow my instruction to build the kernel from <strong>CentOS 8 kernel source</strong>. <br /></p>



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



<h2 class="wp-block-heading">Install Necessary Packages </h2>



<p>On the document, it missed some packages if you want to build CentOS kernel. </p>



<pre class="wp-block-preformatted"># follow original guide to install necessary packages
yum groupinstall "Development Tools"
yum install ncurses-devel
yum install hmaccalc zlib-devel binutils-devel elfutils-libelf-devel
# Install EPEL packages
sudo yum install epel-release
# Enable powertools packages
sudo dnf config-manager --set-enabled powertools
</pre>



<h2 class="wp-block-heading">Fetch CentOS Linux Kernel Source</h2>



<p>This steps will fetch current version CentOS kernel source code.<br />It will download current kernel version of kernel.src.rpm.</p>



<pre class="wp-block-preformatted">cd ~
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
echo '%_topdir %(echo $HOME)/rpmbuild' &gt; ~/.rpmmacros

KVER=`<code>uname -r | sed 's/\.aarch64//'</code>`
rpm -i https://vault.centos.org/8-stream/BaseOS/Source/SPackages/kernel-$KVER.src.rpm</pre>



<h2 class="wp-block-heading">Install Kernel Necessary Package</h2>



<p>After get the kernel source code, it still needs some extra software packages to build the CentOS Linux kernel. If it doesn&#8217;t enable powertool on previous step, this step will fail. </p>



<pre class="wp-block-preformatted">cd ~/rpmbuild/SPECS

for pkg in `rpmbuild -bp --target=$(uname -m) kernel.spec 2&gt;&amp;1 | grep 'is needed by' |awk '{print $1}' | tr '\n' ' '`;do sudo yum install $pkg -y;done</pre>



<h2 class="wp-block-heading">Build CentOS Linux kernel</h2>



<pre class="wp-block-preformatted"># Executes  the  "%prep" stage from the spec file, will not compile it
rpmbuild -bp --target=$(uname -m) kernel.spec
# compile kernel source code
rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log
</pre>



<p>if everything is ok, the file will output on ~/rpmbuild/RPMS/aarch64/<br /><br />Install rpm command </p>



<pre class="wp-block-preformatted"># Install necessary kernel files (examples)
yum localinstall  kernel-4.18.0-408.el8.aarch64.rpm kernel-core-4.18.0-408.el8.aarch64.rpm kernel-headers-4.18.0-408.el8.aarch64.rpm kernel-modules-4.18.0-408.el8.aarch64.rpm kernel-modules-extra-4.18.0-408.el8.aarch64.rpm
# Install all relative rpms 
rpm -ivh kernel-*.rpm 
yum localinstall kernel-*.rpm
# second time install all relative rpms 
rpm -ivh --force kernel-*.rpm
</pre>



<h2 class="wp-block-heading">Apply patch for CentOS kernel</h2>



<p>Another important but less instruction talk about how to apply it. </p>



<ol class="wp-block-list"><li>Edit the kernel.spec, add new line above linux-kernel-test.patch</li></ol>



<pre class="wp-block-preformatted">## Patches needed for building this package

Patch000001: new_patch_4.18.patch

# empty final patch to facilitate testing of kernel patches
Patch999999: linux-kernel-test.patch
</pre>



<p>2. find &#8220;ApplyOptionalPatch linux-kernel-test.patch&#8221; and add new one before it. </p>



<pre class="wp-block-preformatted">ApplyOptionalPatch new_patch_4.18.patch
ApplyOptionalPatch linux-kernel-test.patch
</pre>



<p>3. Put file &#8220;new_patch_4.18.patch&#8221; to ~/rpmbuild/SOURCES/</p>



<p>4. Rebuild kernel </p>



<p>ref.<br /><a href="https://wiki.centos.org/HowTos/Custom_Kernel" target="_blank" rel="noopener">CentOS wiki : I Need to Build a Custom Kernel</a><br /><a href="https://wiki.centos.org/HowTos/I_need_the_Kernel_Source" target="_blank" rel="noopener">CentOS wiki : I Need the Kernel Source</a><br /><a href="https://medium.com/@alexanderyegorov_67403/how-to-compile-kernel-module-for-centos8-78287e9d145a" target="_blank" rel="noreferrer noopener">How to compile kernel module for CentOS8</a><br /></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/12/08/5005/build-centos-8-kernel-from-source-on-arm64-platform/">Build CentOS 8 Kernel from Source on ARM64 Platform</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2022/12/08/5005/build-centos-8-kernel-from-source-on-arm64-platform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>FF14 中華電信 LAG 問題</title>
		<link>https://richliu.com/2022/11/28/4954/ff14-%e4%b8%ad%e8%8f%af%e9%9b%bb%e4%bf%a1-lag-%e5%95%8f%e9%a1%8c/</link>
					<comments>https://richliu.com/2022/11/28/4954/ff14-%e4%b8%ad%e8%8f%af%e9%9b%bb%e4%bf%a1-lag-%e5%95%8f%e9%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 27 Nov 2022 16:12:24 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[GAME]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4954</guid>

					<description><![CDATA[<p>看到有人說改 MTU 可以解決 FF14 FFXIV 的延遲問題，【心得】中華電信FF14晚間卡頓解決方式這個 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/11/28/4954/ff14-%e4%b8%ad%e8%8f%af%e9%9b%bb%e4%bf%a1-lag-%e5%95%8f%e9%a1%8c/">FF14 中華電信 LAG 問題</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>看到有人說改 MTU 可以解決 FF14 FFXIV 的延遲問題，<a href="https://forum.gamer.com.tw/C.php?bsn=17608&amp;snA=21095&amp;tnum=1" target="_blank" rel="noreferrer noopener">【心得】中華電信FF14晚間卡頓解決方式</a><br />這個之前有看到過，但是忘了下去試</p>



<p>猜測原理應該藉由中華電信內部設定會讓小封包先通行的設定，達到穩定 ping 值的目地</p>



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



<p>Windows 下就是用系統管理員執行 CMD 之後，下 command </p>



<pre class="wp-block-preformatted">netsh interface ipv4 show subinterfaces
# 取得目前上網的 interface
netsh interface ipv4 set subinterface "需修改的連線名" mtu=576 store=persistent
</pre>



<p>上面那個方法會讓所有的網站都使用同一組 MTU ，實務上可能連到某些網站就會有問題，例如我在測試中間就無法從 github 下載檔案，猜測可能是對方的防火牆偵測到惡意行為<br />不過嘛，我們用的是 Linux ，而且自已架 Router，所以可以更精準的修改 MTU</p>



<p>每個 DC server 的網段不一樣，我是在日區的 DC Elemental 伺服器，歐洲，北美和其他伺服器可能位址不一樣，這一段就是教大家如何抓出 ff14 DC 所使用的網段<br />首先在 Windows 下執行 resmon (資源監視器)，先選網路，再執行 FF14 ，然後選中 ffxiv_dx11.exe <br />此時在下面就會出現遠端位置和延遲時間，中華電信大多數時間都是在 60ms 以內，但是在某些狀況最高我看過 700ms 的延遲，然而 packet lost 是 0 ，遠端位址是 124.150.157.26 <br /></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1864" height="757" src="https://richliu.com/wp-content/uploads/2022/11/image-4.png" alt="" class="wp-image-4956" srcset="https://richliu.com/wp-content/uploads/2022/11/image-4.png 1864w, https://richliu.com/wp-content/uploads/2022/11/image-4-600x244.png 600w, https://richliu.com/wp-content/uploads/2022/11/image-4-768x312.png 768w, https://richliu.com/wp-content/uploads/2022/11/image-4-1536x624.png 1536w" sizes="auto, (max-width: 1864px) 100vw, 1864px" /></figure>



<p>然後用這個查 AS number ，得到　124.150.152.0/21 整段都是 SquireEnix 的位置，此時再將這一段插入 iptables 的 rules 就好</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1669" height="172" src="https://richliu.com/wp-content/uploads/2022/11/image-5.png" alt="" class="wp-image-4957" srcset="https://richliu.com/wp-content/uploads/2022/11/image-5.png 1669w, https://richliu.com/wp-content/uploads/2022/11/image-5-600x62.png 600w, https://richliu.com/wp-content/uploads/2022/11/image-5-768x79.png 768w, https://richliu.com/wp-content/uploads/2022/11/image-5-1536x158.png 1536w" sizes="auto, (max-width: 1669px) 100vw, 1669px" /></figure>



<p>iptables rules example</p>



<pre class="wp-block-preformatted">iptables  -i br0 -I FORWARD -p tcp -m tcp -d 124.150.152.0/21 --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:1536 -j TCPMSS --set-mss 576
</pre>



<p>改完後試打一場開花神無延遲，會再觀察個幾天看看是不是都是無延遲，本來都要考慮買 VPN 了，如果可以用就不用買了</p>



<h3 class="wp-block-heading">世界計畫日本服 Linux Command</h3>



<p>台灣 hinet 連世界計畫日本服似乎也有類似的狀況，iPad 似乎也有支援修改 MTU 的功能，用這個值也可以用<br /><br />至於 Linux 下，查對方的 IP 似乎有點麻煩，要將 connection table dump 出來一個一個改，因為世界計劃會連到很多 server ，有 google 甚至還有 tencent <br />最後找到可能是某組 Amazon-02 的 IP 段在 13.35.24.0/23，將該段的 MTU 改小一點，似乎就變順暢了<br />這樣似乎可以賣 HINET 遊戲加速器了？</p>



<pre class="wp-block-preformatted"># 清除某個 IP 的 conntrack table 
conntrack -D conntrack --orig-src 192.168.1.63
# Dump 該 IP 的 conntrack table 
conntrack -L |grep 192.168.1.63 | grep -v 208.67| less
# 找到之後再加入 iptables 
iptables -i br0 -I FORWARD -d 13.35.24.0/23 -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1400:1536 -j TCPMSS --set-mss 576</pre>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/11/28/4954/ff14-%e4%b8%ad%e8%8f%af%e9%9b%bb%e4%bf%a1-lag-%e5%95%8f%e9%a1%8c/">FF14 中華電信 LAG 問題</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2022/11/28/4954/ff14-%e4%b8%ad%e8%8f%af%e9%9b%bb%e4%bf%a1-lag-%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>multichase on Centos 8 Compile Issue</title>
		<link>https://richliu.com/2022/11/08/4934/multichase-on-centos-8-compile-issue/</link>
					<comments>https://richliu.com/2022/11/08/4934/multichase-on-centos-8-compile-issue/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Tue, 08 Nov 2022 07:25:53 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[compile]]></category>
		<category><![CDATA[static]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4934</guid>

					<description><![CDATA[<p>muttichase is a google open source tool which can run l [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/11/08/4934/multichase-on-centos-8-compile-issue/">multichase on Centos 8 Compile Issue</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>muttichase is a google open source tool which can run latency, bandwidth and loader-latency tool,<br />it can support both x86 and ARM64 platforms. <br />but it will have compile error on CentOS 8 </p>



<p>root cause is this package needs static lib support, but regular CentOS doesn&#8217;t have it. </p>



<pre class="wp-block-preformatted"># make                                                                             cc -g -O3 -static -pthread  multichase.o permutation.o arena.o util.o  -lrt -lm -o multichase
/usr/bin/ld: cannot find -lrt                                                                                 /usr/bin/ld: cannot find -lm                                                                                  /usr/bin/ld: cannot find -lpthread
/usr/bin/ld: cannot find -lc                                                                                  collect2: error: ld returned 1 exit status                                                                    make: *** [&lt;builtin>: multichase] Error 1</pre>



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



<p>Install necessary package and download the source code </p>



<pre class="wp-block-preformatted"># Install necessary package
yum install git
yum groupinstall "Development Tools"

# Download source code
git clone https://github.com/google/multichase

# Install epel
dnf config-manager --set-enabled powertools
dnf install epel-release epel-next-release

# Install static library 
yum install glibc-static</pre>



<p>ref.<br /><a href="https://docs.fedoraproject.org/en-US/epel/#_el8" target="_blank" rel="noreferrer noopener">Extra Packages for Enterprise Linux (EPEL)</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/11/08/4934/multichase-on-centos-8-compile-issue/">multichase on Centos 8 Compile Issue</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2022/11/08/4934/multichase-on-centos-8-compile-issue/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>BMC Watchdog</title>
		<link>https://richliu.com/2022/10/27/4850/bmc-watchdog/</link>
					<comments>https://richliu.com/2022/10/27/4850/bmc-watchdog/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 27 Oct 2022 04:19:57 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[bmc]]></category>
		<category><![CDATA[watchdog]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4850</guid>

					<description><![CDATA[<p>這個時間有點久了，我也忘了很多細節，畢竟用到的次數太少，不過就將記得的寫一篇，以後可以自己回來查資料如果是有  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/10/27/4850/bmc-watchdog/">BMC Watchdog</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>這個時間有點久了，我也忘了很多細節，畢竟用到的次數太少，不過就將記得的寫一篇，以後可以自己回來查資料<br />如果是有 BMC 的機器，BMC 內部有一個 watchdog 可以監視 host 系統運行的狀況，這個拿來放在遠端重啟 host 非常好用</p>



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



<h3 class="wp-block-heading">使用 ipmitool 取得 watchdog information</h3>



<pre class="wp-block-preformatted"># 未啟動的機器
$ sudo ipmitool mc watchdog get
Watchdog Timer Use:     Reserved (0x00)
Watchdog Timer Is:      Stopped
Watchdog Timer Actions: Hard Reset (0x01)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      30 sec
Present Countdown:      30 sec

# 已啟動的機器
$ sudo ipmitool mc watchdog get
Watchdog Timer Use:     SMS/OS (0x44)
Watchdog Timer Is:      Started/Running
Watchdog Timer Actions: Hard Reset (0x01)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x00
Initial Countdown:      900 sec
Present Countdown:      850 sec


</pre>



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



<p>Debian 和 Fedora 都是叫 freeipmi-bmc-watchdog，其它 distrubtion 應該也相去不遠</p>



<pre class="wp-block-preformatted"># Debian 
$ sudo apt install freeipmi-bmc-watchdog

# Fedora 
$ sudo yum install freeipmi-bmc-watchdog
</pre>



<h3 class="wp-block-heading">bmc-watchdog 基本參數</h3>



<p>bmc-watchdog 啟動參數</p>



<pre class="wp-block-preformatted">#
$ sudo bmc-watchdog -d -u 4 -p 0 -a 1 -i 900

# Start bmc-watchdog 
$ sudo bmc-watchdog -t 
</pre>



<p>Debian 的 bmc-watchdog 設定放在 /etc/default/bmc-watchdog，不確定是不是 default configure ，但是還是放在這邊</p>



<pre class="wp-block-preformatted">OPTIONS="-d -u 4 -p 0 -a 1 -F -P -L -S -O -i 900 -e 60"</pre>



<p>設成預設啟動</p>



<pre class="wp-block-preformatted">$ sudo systemctl enable bmc-watchdog
$ sudo systemctl start bmc-watchdog
</pre>



<p>最後別忘了 enable watchdog in bmc <br />OS Watchdog Timer 那一項，如果沒事就不要開了，會一直重開</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1364" height="805" src="https://richliu.com/wp-content/uploads/2022/10/image-2.png" alt="" class="wp-image-4853" srcset="https://richliu.com/wp-content/uploads/2022/10/image-2.png 1364w, https://richliu.com/wp-content/uploads/2022/10/image-2-600x354.png 600w, https://richliu.com/wp-content/uploads/2022/10/image-2-768x453.png 768w" sizes="auto, (max-width: 1364px) 100vw, 1364px" /></figure>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/10/27/4850/bmc-watchdog/">BMC Watchdog</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2022/10/27/4850/bmc-watchdog/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux Kernel Install Fail Because Broadcom NetXtreme 100G DKMS Driver Build Failed.</title>
		<link>https://richliu.com/2022/09/27/4830/linux-kernel-install-fail-because-broadcom-netxtreme-100g-dkms-driver-build-failed/</link>
					<comments>https://richliu.com/2022/09/27/4830/linux-kernel-install-fail-because-broadcom-netxtreme-100g-dkms-driver-build-failed/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Tue, 27 Sep 2022 08:14:23 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[broadcom]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Driver]]></category>
		<category><![CDATA[kernel]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4830</guid>

					<description><![CDATA[<p>Environment is CentOS 8, broadcom 100G NetXtreme-E seri [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/09/27/4830/linux-kernel-install-fail-because-broadcom-netxtreme-100g-dkms-driver-build-failed/">Linux Kernel Install Fail Because Broadcom NetXtreme 100G DKMS Driver Build Failed.</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Environment is CentOS 8, broadcom 100G NetXtreme-E series driver . <br />Host : Ampere Altra Platform <br /><br />if rebuild the CentOS kernel and there was previous Broadcom nic driver alredy installed, it will trigger dkms to rebuild the driver on current kernel. <br /><br />make install error as following</p>



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



<pre class="wp-block-preformatted">[root@localhost linux-4.18.0-80.11.2.el8_0]# make install                                            [55/2101]
/bin/sh ./arch/arm64/boot/install.sh 4.18.0 \
arch/arm64/boot/Image System.map "/boot"
dkms: running auto installation service for kernel 4.18.0
Deprecated feature: REMAKE_INITRD
Deprecated feature: REMAKE_INITRD
Deprecated feature: REMAKE_INITRD
Sign command: /lib/modules/4.18.0/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub                                                               Deprecated feature: REMAKE_INITRD                                                                             
Building module:
Cleaning build area...(bad exit status: 2)
make -j160 KERNELRELEASE=4.18.0 -C /lib/modules/4.18.0/build M=/var/lib/dkms/bnxt_en/1.10.2.221.0.114.0/build
KVER=4.18.0...(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.18.0 (aarch64)
Consult /var/lib/dkms/bnxt_en/1.10.2.221.0.114.0/build/make.log for more information.
Sign command: /lib/modules/4.18.0/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Deprecated feature: REMAKE_INITRD

Building module:
Cleaning build area...(bad exit status: 2)
make -j160 KERNELRELEASE=4.18.0 -C /lib/modules/4.18.0/build M=/var/lib/dkms/bnxt_re/221.0.114.0/build KVER=4$
18.0 BNXT_EN_INC=/var/lib/dkms/bnxt_re/221.0.114.0/source BNXT_QPLIB_INC=/var/lib/dkms/bnxt_re/221.0.114.0/so$
rce...(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.18.0 (aarch64)
Consult /var/lib/dkms/bnxt_re/221.0.114.0/build/make.log for more information.
 Done.
</pre>



<p>And check the log file &#8220;/var/lib/dkms/bnxt_re/221.0.114.0/build/make.log&#8221;<br /><br />It shows </p>



<pre class="wp-block-preformatted">DKMS make.log for bnxt_en-1.10.2.221.0.114.0 for kernel 4.18.0 (aarch64)
Tue Sep 27 15:41:04 CST 2022
Makefile:603: arch/aarch64/Makefile: No such file or directory
make[2]: *** No rule to make target 'arch/aarch64/Makefile'.  Stop.
</pre>



<p>Seems cannot find the Makefile, that because the drvier cannot locate right Makefile, because the include architecture is arm64, not aarch64 in Linux kernel . <br /><br />By the way, basicly arm64 and aarch64 are the same thing, I don&#8217;t know why it shows aarch64 on kernel architecture and use arm64 as fold name. probably some traditional history. <br /><br />solution is easy, go to the include folder and link arm64 to aarch, DONE! ex:</p>



<pre class="wp-block-preformatted">cd /lib/modules/4.18.0/build/arch
ln -sf arm64 aarch64
</pre>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/09/27/4830/linux-kernel-install-fail-because-broadcom-netxtreme-100g-dkms-driver-build-failed/">Linux Kernel Install Fail Because Broadcom NetXtreme 100G DKMS Driver Build Failed.</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2022/09/27/4830/linux-kernel-install-fail-because-broadcom-netxtreme-100g-dkms-driver-build-failed/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>CentOS 其他</title>
		<link>https://richliu.com/2022/08/17/4794/centos-%e5%85%b6%e4%bb%96/</link>
					<comments>https://richliu.com/2022/08/17/4794/centos-%e5%85%b6%e4%bb%96/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 17 Aug 2022 04:07:25 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4794</guid>

					<description><![CDATA[<p>筆記集中文 Get NIC Device UUID nmcli connection show eth0 &#124;g [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/08/17/4794/centos-%e5%85%b6%e4%bb%96/">CentOS 其他</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>筆記集中文</p>



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



<h2 class="wp-block-heading">Get NIC Device UUID</h2>



<pre class="wp-block-preformatted">nmcli connection show eth0 |grep connection.uuid</pre>



<p>ref.<br /><a href="https://www.linuxquestions.org/questions/linux-hardware-18/finding-uuid-of-a-network-card-4175470283/" target="_blank" rel="noreferrer noopener">[SOLVED] Finding UUID of a network card</a></p>



<h2 class="wp-block-heading">Update CentOS 8.x to stream</h2>



<p>CentOS 如果不升級的 stream 有很多套件會抓不到，像是 Ansible <br /><br />升級方式 Ref. <a href="https://www.cyberciti.biz/howto/upgrade-migrate-from-centos-8-to-centos-stream-conversion/" target="_blank" rel="noreferrer noopener">How to migrate from CentOS 8 to CentOS stream conversion</a></p>



<pre class="wp-block-preformatted"># Step 1 
# check the CentOS version 
more /etc/centos-release
# Step 2 
# Upgrade to CentOS Stream
sudo dnf in centos-release-stream
# Step 3 
# Migrate to CentOS Stream 
sudo dnf swap centos-linux-repos centos-stream-repos
# Step 4
# reboot
sudo reboot
</pre>



<h2 class="wp-block-heading">Install bpftrace</h2>



<p>Ref. <br /><a href="https://installati.one/centos/8/bpftrace/" target="_blank" rel="noreferrer noopener">How To Install bpftrace on CentOS 8</a></p>



<pre class="wp-block-preformatted">sudo yum makecache --refresh
sudo yum -y install bpftrace</pre>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/08/17/4794/centos-%e5%85%b6%e4%bb%96/">CentOS 其他</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2022/08/17/4794/centos-%e5%85%b6%e4%bb%96/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ampere Altra Mt. Jade OpenBMC and EDKII build guide on ARM64 platform</title>
		<link>https://richliu.com/2022/06/23/4601/ampere-altra-mt-jade-openbmc-build-guide-on-arm64-platform/</link>
					<comments>https://richliu.com/2022/06/23/4601/ampere-altra-mt-jade-openbmc-build-guide-on-arm64-platform/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 23 Jun 2022 05:31:55 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Computer/Technical]]></category>
		<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[Ampere Computing]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[EDKII]]></category>
		<category><![CDATA[OpenBMC]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4601</guid>

					<description><![CDATA[<p>Ampere announce Altra CPU, it&#8217;s a 80 cores ARM64v [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/06/23/4601/ampere-altra-mt-jade-openbmc-build-guide-on-arm64-platform/">Ampere Altra Mt. Jade OpenBMC and EDKII build guide on ARM64 platform</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Ampere announce Altra CPU, it&#8217;s a 80 cores ARM64v8 CPU for cloud native workloads. Altra Max CPU is 128 cores. Follow the CPU, Ampere also has a CRB (customer reference board) named Mt. Jade, and Ampere also open source OpenBMC and EDKII source code for Mt. Jade platform. <br /><br />This article is personal note, all information can be found from internet. And open source project keeps going, it might be some minor differences when you find this article. </p>



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><ul><li><a href="#before-build-source-code">Before Build Source Code</a></li><li><a href="#prepare-build-environment">Prepare Build Environment</a><ul><li><a href="#get-the-ubuntu-18-04-cloud-image">Get the Ubuntu 18.04 cloud image</a></li><li><a href="#prepare-hostname-and-userdata-for-vm">Prepare hostname and userdata for VM</a></li></ul></li><li><a href="#build-mt-jade-edkii">Build Mt. Jade EDKII</a><ul><li><a href="#prepare-vm-environment">Prepare VM environment</a></li><li><a href="#get-build-environment">Get build environment</a></li><li><a href="#build-and-sign-the-image">Build and Sign the image</a></li><li><a href="#manual-build-edkii">Manual Build EDKII</a></li></ul></li><li><a href="#build-mt-jade-open-bmc">Build Mt. Jade OpenBMC</a></li><li><a href="#prepare-build-environment-1">Prepare build environment</a></li><li><a href="#build-open-bmc">Build OpenBMC</a></li><li><a href="#upgrade-firmware">Upgrade Firmware</a><ul><li><a href="#update-open-bmc-firmware">Update OpenBMC firmware</a><ul><li><a href="#update-via-url">Update via URL</a></li><li><a href="#update-via-ssh">Update via SSH</a></li></ul></li><li><a href="#update-uefi-firmware">Update UEFI firmware</a></li><li><a href="#update-scp-firmware">Update SCP firmware</a></li></ul></li><li><a href="#serial-console">Serial Console</a></li><li><a href="#reference">Reference</a></li><li><a href="#error-message">Error Message</a><ul><li><a href="#error-templateconf-value-which-is-nvme-openbmc-meta-ampere-meta-mitchell-must-point-to-meta-some-layer-conf-templates-template-name">Error: TEMPLATECONF value (which is /nvme/openbmc/meta-ampere/meta-mitchell) must point to meta-some-layer/conf/templates/template-name</a></li><li><a href="#initializing-oe-build-env">Initializing OE build env</a></li><li><a href="#">
</a></li></ul></li></ul></nav></div>



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



<h2 class="wp-block-heading" id="before-build-source-code">Before Build Source Code</h2>



<p>This procedure runs on ARM64 platform, it should be also run on x86 platform, but I have not try it. <br /><br />Build environment : Ampere eMAG CPU (32 cores) with 256G DRAM and uses 64G/128G RAM to build code, sometime if it cannot finsih compile tasks, probably your DRAM is not sufficient to build the code, I tried 16G and it doesn;t work.<br /><br />Because host is running Ubuntu 22.04, and OpenBMC and EDKII only can be built on Ubuntu 18.04, so, it needs to use either virtual machine or contianer technologies to have Ubuntu 18.04 environment. <br /><br />This note uses qemu to prepare build environment, tried docker but it doesn&#8217;t work, probably I will re-try it someday. </p>



<p>If use NFS or qemu overlayers filesystem to bridge folders ourside into VM, it might cause build problem, so, please increase disk size for you virtual machine virtual disk size, use nfs or share folder for copy images or source code only. <br /><br />If want to build a workable EDKII code and run it on Ampere Mt. Jade platform, it needs to have Ampere fimware ATF and SCP binary, it might register Ampere customer connect to download those image files, without it, it only can build OpenBMC binary. </p>



<h2 class="wp-block-heading" id="prepare-build-environment">Prepare Build Environment </h2>



<h3 class="wp-block-heading" id="get-the-ubuntu-18-04-cloud-image">Get the Ubuntu 18.04 cloud image</h3>



<pre class="wp-block-preformatted">$ wget https://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-arm64.img
$ sudo apt install qemu-efi</pre>



<h3 class="wp-block-heading" id="prepare-hostname-and-userdata-for-vm">Prepare hostname and userdata for VM</h3>



<p>it needs to prepare two files, meta-file and user-data, following is example for meta-file </p>



<pre class="wp-block-preformatted">instance-id: Image-openbmc
local-hostname: openbmc
</pre>



<p>user-data file, this example username is ubuntu, password is ubuntu</p>



<pre class="wp-block-preformatted">#cloud-config
password: ubuntu
chpasswd: { expire: False }
ssh_pwauth: True
ssh_authorized_keys:
  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+Y/6m4XFeEGKqR2H7wbsUQUVWvB0gC/+CeJqfyvOX++SETKapFtI5CiidkyW/B1GQM4XUlmE9zPlCAcolPfMpXB0CNQQ5l0F5Z+FW6b4RVjFV/KEcQ7R3XkKRa0XhC6hKkNc5P95fNhXr8Do1bSEmd9mPIiOrFaUEZ9EReO+ZTsGsytFIuQV8rOZfQjClktXrqk3F6jJ+TV3THcVNpKvnLfps56Hc/j9jdiadLv91yuifz4lCMbv/D/0hMtf4KhN5tV//QRgUxEUeC7aPW6sKD2GMYMxc9UsSyRRQ9IFWjJMkgzKyuxgNKe7u4WjERFoxEUrmFK01UsrX+lRw9e9n user@hostname
</pre>



<p>Than, it can create a configure file for QEMU</p>



<pre class="wp-block-preformatted">$ cloud-localds -v cloudinit.img user-data meta-file</pre>



<p>Increase Ubuntu cloud image disk size, bigger is better, suggest more than 200G, minimal should be around 100G.</p>



<pre class="wp-block-preformatted">$ qemu-img resize ubuntu-18.04-server-cloudimg-arm64.img +200G</pre>



<p>Prepare UEFI BIOS and storage for booting</p>



<pre class="wp-block-preformatted">dd if=/dev/zero of=flash0.img bs=1M count=64
dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
dd if=/dev/zero of=flash1.img bs=1M count=64</pre>



<p>Running the VM script, it will also create a QEMU virtfs for file sharing, but do not use that folder to build code. How to access share folder, it can reference this article <a href="https://richliu.com/2017/09/25/2173/qemu-share-directory-with-host-without-networking/" target="_blank" rel="noreferrer noopener">QEMU Share Directory with Host Without Networking</a></p>



<p></p>



<pre class="wp-block-preformatted">IMAGE1=ubuntu-18.04-server-cloudimg-arm64.img
sudo qemu-system-aarch64 -name vm1 \
         -machine virt,gic_version=3,accel=kvm,usb=off \
         -cpu host -m 128G \
         -smp 32,sockets=1,cores=32,threads=1 \
         -nographic -nodefaults \
         -pflash flash0.img -pflash flash1.img \
         -drive file=$IMAGE1,if=none,id=disk1 \
         -device virtio-blk-device,drive=disk1 \
         -drive file=cloudinit.img,if=virtio,format=raw \
         -virtfs local,path=/nvme/obmc,mount_tag=host0,security_model=passthrough,id=host0 \
         -netdev tap,id=net0,ifname=tap0 \
         -device virtio-net-device,netdev=net0,mac=52:54:00:11:11:12 \
         -serial telnet::9001,server,nowait &gt; guest_log-1.txt 2&gt;&gt; guest_log-1.txt
</pre>



<h2 class="wp-block-heading" id="build-mt-jade-edkii">Build Mt. Jade EDKII</h2>



<h3 class="wp-block-heading" id="prepare-vm-environment">Prepare VM environment</h3>



<p>After login into VM, it needs to install software to compile EDKII. <br />Command to install basic packages. </p>



<pre class="wp-block-preformatted">sudo apt update 
sudo apt install -y git vim tmux lftp net-tools ethtool bc
sudo apt install -y \
  build-essential uuid-dev acpica-tools nasm \
  python3 python3-distutils python3-pip \
  gawk
sudo apt install -y libssl-dev gnu-efi
sudo apt install bison flex
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1</pre>



<p>Next step is follow this document to download Ampere EDKII source code  and setup enviroment. <br />https://github.com/AmpereComputing/edk2.git<br /><br />First, prepare build environment parameters, if VM reboot, it needs to re-run it. </p>



<pre class="wp-block-preformatted">export WORKSPACE=/nvme/tianocore<br />mkdir -p $WORKSPACE<br />cd $WORKSPACE<br /><s>export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms</s><br /># PACKAGES_PATH is default include path, sometimes miss package can include more directories here. <br /># if still cannot find some files, try to run submodules command on next step again. <br />export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-non-osi/:$PWD/edk2-platforms/Features/</pre>



<p>Chang into that folder, clone Ampere Computiner edk2 source code. </p>



<pre class="wp-block-preformatted">cd $WORKSPACE
git clone https://github.com/AmpereComputing/edk2.git
cd edk2
git submodule init &amp;&amp; git submodule update
cd ..
git clone https://github.com/AmpereComputing/edk2-platforms.git</pre>



<h3 class="wp-block-heading" id="get-build-environment">Get build environment</h3>



<p>This step is to build the basic tools.</p>



<pre class="wp-block-preformatted">cd $WORKSPACE
. edk2/edksetup.sh

# Build BaseTool, only need to run once 
make -C edk2/BaseTools </pre>



<p>After compiled the EDK2 basic tool, next step is to prepare edk2-platforms and edk2-ampere-tools <br /><br />edk2-ampere-tools has a very good build script, <br />it can help to build the EDK2 and also package ATF into together. <br />we will introduct it on following steps. </p>



<pre class="wp-block-preformatted">cd edk2-platforms
git checkout -b test remotes/origin/ampere

# make a link to library to fix some problem
ln -sf /nvme/tianocore/edk2-platforms/Features/Intel/OutOfBandManagement .
cd ..
git clone https://github.com/AmpereComputing/edk2-ampere-tools
</pre>



<h3 class="wp-block-heading" id="build-and-sign-the-image">Build and Sign the image</h3>



<p>Because current tree Atftool migrate to OpenSSL 3.0, and Ubuntu 18.04 still use OpenSSL 1.0x, <br />I choice to roll back to old version to support OpenSSL 1.0x, support it can build Atftool on Ubuntu 22.04 or compile OpenSSL 3.0 manually, I might try it later. </p>



<pre class="wp-block-preformatted">cd /nvme/tianocore 
mkdir -p AtfTools
cd AtfTools
git init
git remote add origin -f https://github.com/ARM-software/arm-trusted-firmware.git
git config core.sparseCheckout true

echo -ne "include/tools_share\nmake_helpers\ntools/cert_create\ntools/fiptool" &gt; .git/info/sparse-checkout

git -C . checkout --track origin/master
# Due to current AtfTool only support OpenSSL 3.0 , switch to previous version 
git checkout -b test b94bf967e62b23a376a5026de69d06a0e8d6bf78
make -C tools/cert_create CRTTOOL=cert_create
$ make -C tools/fiptool FIPTOOL=fiptool</pre>



<p>configure PATH to  fiptool and cert_create</p>



<pre class="wp-block-preformatted">cd /nvme/tianocore
export PATH=$PATH:$PWD/AtfTools/tools/cert_create:$PWD/AtfTools/tools/fiptool
</pre>



<p>This step is parepare Mt. Jade ATF and SCP binary for compile, it needs to get both binary file from <a href="https://connect.amperecomputing.com/" target="_blank" rel="noreferrer noopener">Ampere customer connect</a>. and also suggest to use the same version as OpenBMC/EDKII</p>



<pre class="wp-block-preformatted">cd $WORKSPACE
mv &lt;path to&gt;/altra_atf_signed_2.06.20220426.slim .
mv &lt;path to&gt;/altra_scp_signed_2.06.20220426.slim .
cd edk2-ampere-tools
./edk2-build.sh -b RELEASE Jade --atf-image $WORKSPACE/altra_atf_signed_2.06.20220426.slim --scp-image $WORKSPACE/altra_scp_signed_2.06.20220426.slim</pre>



<p>If everything is perfect, the binary code would be looks like below. </p>



<pre class="wp-block-preformatted">Results: /nvme/tianocore/edk2-ampere-tools/BUILDS/jade_tianocore_atf_2.06.100
total 45888
-rw------- 1 root   root       3343 Jun 15 12:40 dbukey.auth
-rw------- 1 root   root       2002 Jun 15 12:40 del_dbukey.auth
-rw-r--r-- 1 root   root       2008 Jun 15 12:38 jade_board_setting.bin
-rw-rw-r-- 1 ubuntu ubuntu    14532 Jun 15 04:08 jade_board_setting.txt
-rw-r--r-- 1 root   root     670845 Jun 15 12:40 jade_scp_2.06.100.cap
-rw-r--r-- 1 root   root     262144 Jun 15 12:40 jade_scp_2.06.100.dbu.sig.img
-rw-r--r-- 1 root   root    8126464 Jun 15 12:38 jade_tianocore_2.06.100.fd
-rw-r--r-- 1 root   root   14040229 Jun 15 12:40 jade_tianocore_atf_2.06.100.cap
-rw-r--r-- 1 root   root   13631488 Jun 15 12:40 jade_tianocore_atf_2.06.100.dbu.sig.img
-rw-r--r-- 1 root   root   10225352 Jun 15 12:38 jade_tianocore_atf_2.06.100.img
------------------------------------------------------------
                          Ampere Jade (AARCH64) RELEASE pass
------------------------------------------------------------
pass    1
fail    0</pre>



<p id="block-c791d1c4-9fd3-4983-bb20-21d321ee9683">It can use the jade_tianocore_atf_2.06.100.img for firmware update. </p>



<p>Note:  When latest time I compile the edkII binary, latest version will fail to build, it need to roll back to previous version. </p>



<h3 class="wp-block-heading" id="manual-build-edkii">Manual Build EDKII</h3>



<p>If still want to build EDKII manually, here is some command can help you. </p>



<pre class="wp-block-preformatted">cd edk2-platform
build -a AARCH64 -t GCC5 -b RELEASE -D SECURE_BOOT_ENABLE -p Platform/Ampere/JadePkg/Jade.dsc
or to use all CPU to compile the EDKII.
build -n `nproc` -a AARCH64 -t GCC5 -b RELEASE -D SECURE_BOOT_ENABLE -p Platform/Ampere/JadePkg/Jade.dsc</pre>



<p>the generated image on $WORKSPACE/Build/Jade/RELEASE_GCC5/FV/BL33_JADE_UEFI.fd,<br />for this case, on the /nvme/tianocore/Build/Jade/RELEASE_GCC5/FV/BL33_JADE_UEFI.fd</p>



<p>then, it needs to use ampere special tool to generate EDKII image with Ampere ATF image.</p>



<h2 class="wp-block-heading" id="build-mt-jade-open-bmc">Build Mt. Jade OpenBMC</h2>



<h2 class="wp-block-heading" id="prepare-build-environment-1">Prepare build environment</h2>



<p>Before build OpenBMC, it needs to install necessary packages, <br />it can build both OpenBMC and EDKII on the same VM, or it can build it on different VM. <br /><br />Following is necessary packages for OpenBMC.</p>



<pre class="wp-block-preformatted">$ sudo apt-get install -yy \
     build-essential \
     chrpath \
     cpio \
     debianutils \
     diffstat \
     gawk \
     git \
     iputils-ping \
     libdata-dumper-simple-perl \
     liblz4-tool \
     libsdl1.2-dev \
     libthread-queue-any-perl \
     locales \
     python \
     python3 \
     socat \
     subversion \
     texinfo \
     wget \
     zstd</pre>



<p>Download Open BMC source code and OpenBMC build script. </p>



<pre class="wp-block-preformatted">$ cd /nvme
$ git clone https://github.com/ampere-openbmc/openbmc.git
$ git clone https://github.com/openbmc/openbmc-build-scripts.git
</pre>



<p>modify openbmc-build-scripts/build-setup.sh around line #140, <br />replace &#8220;Clone in openbmc master to ${obmc_dir}&#8221; to https://github.com/ampere-openbmc/openbmc.git<br /><br />it can download right source code. </p>



<pre class="wp-block-preformatted">git clone ${branch} https://github.com/ampere-openbmc/openbmc.git</pre>



<p>If you use more than 32 cores to build the source code, it might cause compile fail because some compile tool might have problem on build code on ARM64 massive code. A easy way to check that is run dmesg to check whether Linux kernel has OOM killer on some package compile fail message like nodejs.<br /><br />Limited CPU number to 32 , modify openbmc-build-scripts/build-setup.sh, on line 84. </p>



<pre class="wp-block-preformatted"> 84 # num_cpu=${num_cpu:-$(nproc)}
 85 num_cpu=32
</pre>



<h2 class="wp-block-heading" id="build-open-bmc">Build OpenBMC</h2>



<p>This step is to prepare test build environment </p>



<pre class="wp-block-preformatted">$ cd /nvme
$ target=mtjade WORKSPACE=/nvme/openbmc branch="--branch ampere --single-branch" ./openbmc-build-scripts/build-setup.sh</pre>



<p>Setup openbmc machine type to mt. Jade and compile OpenBMC. </p>



<pre class="wp-block-preformatted">$ <s>export TEMPLATECONF=meta-ampere/meta-jade</s>
$ export TEMPLATECONF=meta-ampere/meta-jade/conf/templates/default/
$ export TMPDIR=/nvme/temp
$ export LC_ALL=en_US.UTF-8

$ cd /nvme/openbmc
$ . openbmc-env
$ cd ..
$ source ./setup mtjade
$ bitbake obmc-phosphor-image
</pre>



<p>if system it mt.mitchell</p>



<pre class="wp-block-preformatted">$ export TEMPLATECONF=meta-ampere/meta-mitchell/conf/templates/default/
$ export TMPDIR=/nvme/temp
$ export LC_ALL=en_US.UTF-8

$ cd /nvme/openbmc
$ . openbmc-env
$ cd ..
$ source ./setup mtmitchell-dcscm
$ bitbake obmc-phosphor-image</pre>



<p>When compile, there is an openocd compile error, it cannot access to original website probably caused by the website was down. Temperory solutoin is to remove the package. <br />modify file meta-ampere/meta-common/recipes-ac01/packagegroups/packagegroup-ampere-apps.bb, find openocd and delete it, down. </p>



<p>When finish compile, the binary will locate on tmp/deploy/images/mtjade/, absoult path is /nvme/openbmc/build/mtjade/tmp/deploy/images/mtjade/<br /><br />ex: (only list partical files)</p>



<pre class="wp-block-preformatted">obmc-phosphor-image-mtjade-20220616040212.rootfs.manifest
obmc-phosphor-image-mtjade-20220616040212.rootfs.squashfs-xz
obmc-phosphor-image-mtjade-20220616040212.static.mtd
obmc-phosphor-image-mtjade-20220616040212.static.mtd.all.tar
obmc-phosphor-image-mtjade-20220616040212.static.mtd.tar
obmc-phosphor-image-mtjade-20220616040212.testdata.json
obmc-phosphor-image-mtjade.jffs2
obmc-phosphor-initramfs-mtjade-20220616004506.rootfs.cpio.xz
obmc-phosphor-initramfs-mtjade-20220616004506.rootfs.manifest
obmc-phosphor-initramfs-mtjade-20220616004506.testdata.json
</pre>



<p>obmc-phosphor-image-mtjade-20220616040212.static.mtd.tar is firmware file, it contain both obmc-phosphor-image-mtjade-20220616040212.static.mtd and obmc-phosphor-image-mtjade-20220616040212.rootfs.manifest files, and can be used for next step : firmware update.</p>



<h2 class="wp-block-heading" id="upgrade-firmware">Upgrade Firmware</h2>



<p><strong><span class="has-inline-color has-luminous-vivid-orange-color">*Notice: Update flash will take your own risk, especially physical damage your hardware.. </span></strong> <br /><br />If Mt. Jade is using AMI bios, suggest to use flash burner to update the OpenBMC firmware. <br />What I am using is GZU EZP XPro , it&#8217;s very cheap, only needs around US$30.- (please also purchase the SPI flash socket). <br /><br />This step need to un-plug BMC flash from Mt. Jade motherboard, please remeber the flash pin 1 location, it needs to follow the original position and put it back to socket. If you miss you will broken it. <br /></p>



<h3 class="wp-block-heading" id="update-open-bmc-firmware">Update OpenBMC firmware</h3>



<p>ref. <a href="https://github.com/openbmc/docs/blob/master/architecture/code-update/code-update.md" target="_blank" rel="noopener">OpenBMC Code Update</a></p>



<h4 class="wp-block-heading" id="update-via-url">Update via URL</h4>



<p>Suppose that it already has OpenBMC firmware, it can use software to upgrade firmware ,<br />first step is to get web token, then use this token on next step to upgrade firmware. <br /><br />Following is a simple script to upgrade flash, it can be integrated into your script. </p>



<pre class="wp-block-preformatted">export BMC_IP=192.168.1.190
export FWFILE=obmc-phosphor-image-mtjade-20220616040212.static.mtd.tar

export token=`curl -k -H "Content-Type: application/json" -X POST https://${BMC_IP}/login -d '{"username" :  "root", "password" :  "0penBmc"}' | grep token | awk '{print $2;}' | tr -d '"'`

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    84  100    37  100    47    116    147 --:--:-- --:--:-- --:--:--   264


curl -k -H "X-Auth-Token: $token" \
       -H "Content-Type: application/octet-stream" \
       -X POST -T ${FWFILE} \
        https://${BMC_IP}/redfish/v1/UpdateService

{
  "@odata.id": "/redfish/v1/TaskService/Tasks/1",
  "@odata.type": "#Task.v1_4_3.Task",
  "Id": "1",
  "TaskState": "Running",
  "TaskStatus": "OK"
}</pre>



<p>If  conosle doesn&#8217;t not update and reboot, please use console login the OpenBMC and run &#8220;reboot&#8221; manually. <br />It will show message like below on OpenBMC console. </p>



<pre class="wp-block-preformatted">Updating kernel...
Erasing block: 69/69 (100%)
Writing kb: 4397/4397 (100%)
Verifying kb: 4397/4397 (100%)
Updating rofs...
Erasing block: 366/366 (100%)
Writing kb: 11580/23376 (49%)
</pre>



<h4 class="wp-block-heading" id="update-via-ssh">Update via SSH</h4>



<p>Just update firmware (ex: obmc-phosphor-image-mtjade-20220616040212.static.mtd.tar) to BMC&#8217;s directory /tmp/images , it will shows a hash number like /tmp/images/d6718c8f, then run the following command</p>



<pre class="wp-block-preformatted">busctl set-property xyz.openbmc_project.Software.BMC.Updater \<br />  /xyz/openbmc_project/software/d6718c8f \<br />  xyz.openbmc_project.Software.Activation RequestedActivation s \<br />  xyz.openbmc_project.Software.Activation.RequestedActivations.Active</pre>



<h3 class="wp-block-heading" id="update-uefi-firmware">Update UEFI firmware </h3>



<p>Upgrade UEFI firmware<br />it needs to pack the UEFI image first , and it need to create MANIFEST file, looks like this </p>



<pre class="wp-block-preformatted">VER_purpose=xyz.openbmc_project.Software.Version.VersionPurpose.Host
version=jade_tianocore_atf_2.06.100
KeyType=OpenBMC
HashType=RSA-SHA256
MachineName=mtjade
</pre>



<p>make image file and MINIFEST file into the same file</p>



<pre class="wp-block-preformatted">$ tar -cvf jade_tianocore_atf_2.06.100.tar jade_tianocore_atf_2.06.100.img MANIFEST </pre>



<p>Run command below to upgrade UEFI firmware</p>



<pre class="wp-block-preformatted">export BMC_IP=192.168.1.190

export FWFILE=jade_tianocore_atf_2.06.100.tar

export token=`curl -k -H "Content-Type: application/json" -X POST https://${BMC_IP}/login -d '{"username" :  "root", "password" :  "0penBmc"}' | grep token | awk '{print $2;}' | tr -d '"'`

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    84  100    37  100    47    116    147 --:--:-- --:--:-- --:--:--   264


curl -k -H "X-Auth-Token: $token" \
       -H "Content-Type: application/octet-stream" \
       -X POST -T ${FWFILE} \
        https://${BMC_IP}/redfish/v1/UpdateService

</pre>



<p>Like OpenBMC, if it doesn&#8217;t update, just reboot to update it. <br />if stiall not work, try to upgrade it manually, yes, when I wrote this article, update via redfish doesn&#8217;t work, so, just copy it from github.</p>



<pre class="wp-block-preformatted"># on HOST
$ scp jade_tianocore_atf_2.06.100.tar root@192.168.1.190:/tmp

# on Target 
$ cd /tmp/images
$ mkdir fw
$ cd fw
$ tar xvf /tmp/jade_tianocore_atf_2.06.100.tar
$ firmware_update.sh /tmp/images/fw
--- Current Chassis State: On
--- Turning the Chassis off
--- Switch the host SPI bus to BMC.
Run update Primary Host SPI-NOR
--- Bind the ASpeed SMC driver
--- Locking power control
--- Flashing firmware to @/dev/mtd13
Erasing block: 157/157 (100%)
Writing kb: 9985/9985 (100%)
Verifying kb: 9985/9985 (100%)
--- Unlocking power control
--- Switch back to the primary Host SPI-NOR.
Turn on the Host
</pre>



<h3 class="wp-block-heading" id="update-scp-firmware">Update SCP firmware</h3>



<p>It needs to use sftp to transfer SCP firmware to target. <br />Following is example to upgrade SCP firmware.</p>



<pre class="wp-block-preformatted">On host
$ scp altra_scp_signed_2.06.20220426.slim root@192.168.1.190:/tmp

On OpenBMC side
$ ampere_firmware_upgrade.sh smpmpro /tmp/altra_scp_signed_2.06.20220426.slim</pre>



<p>After upgrade BIOS and SCP, if got any problem, suggest to reset bmc </p>



<pre class="wp-block-preformatted">$ ipmitool -U root -P 0penBmc -I lanplus -C 17 -H 192.168.2.18 mc reset cold</pre>



<h2 class="wp-block-heading" id="serial-console">Serial Console</h2>



<p>it can use command to get system CPU console.</p>



<pre class="wp-block-preformatted"># CPU console 
$ ssh root@192.168.190 -p 2200 
</pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1124" height="739" src="https://richliu.com/wp-content/uploads/2022/06/image.png" alt="" class="wp-image-4631" srcset="https://richliu.com/wp-content/uploads/2022/06/image.png 1124w, https://richliu.com/wp-content/uploads/2022/06/image-600x394.png 600w, https://richliu.com/wp-content/uploads/2022/06/image-768x505.png 768w" sizes="auto, (max-width: 1124px) 100vw, 1124px" /></figure>



<h2 class="wp-block-heading" id="reference">Reference</h2>



<p><a href="https://github.com/ampere-openbmc/openbmc" target="_blank" rel="noreferrer noopener">Ampere OpenBMC github</a><br /><a href="https://github.com/AmpereComputing/edk2-ampere-tools" target="_blank" rel="noreferrer noopener">EDK2 Ampere Tool</a><br /><a href="https://github.com/AmpereComputing/edk2" target="_blank" rel="noreferrer noopener">Ampere EDK2</a><br /><a href="https://github.com/AmpereComputing" target="_blank" rel="noreferrer noopener">Ampere Computing Github</a></p>



<h2 class="wp-block-heading" id="error-message">Error Message </h2>



<h3 class="wp-block-heading" id="error-templateconf-value-which-is-nvme-openbmc-meta-ampere-meta-mitchell-must-point-to-meta-some-layer-conf-templates-template-name">Error: TEMPLATECONF value (which is /nvme/openbmc/meta-ampere/meta-mitchell) must point to meta-some-layer/conf/templates/template-name</h3>



<p>Error message </p>



<h3 class="wp-block-heading" id="initializing-oe-build-env">Initializing OE build env</h3>



<pre class="wp-block-preformatted">Error: TEMPLATECONF value (which is /nvme/openbmc/meta-ampere/meta-mitchell) must point to meta-some-layer/conf/templates/template-name</pre>



<p>This is because followed the old configuration, it needs to point to right folder like</p>



<pre class="wp-block-preformatted">export TEMPLATECONF=meta-ampere/meta-jade/conf/templates/default/
. openbmc-env</pre>



<p>.</p>



<h3 class="wp-block-heading"><br /></h3>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/06/23/4601/ampere-altra-mt-jade-openbmc-build-guide-on-arm64-platform/">Ampere Altra Mt. Jade OpenBMC and EDKII build guide on ARM64 platform</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2022/06/23/4601/ampere-altra-mt-jade-openbmc-build-guide-on-arm64-platform/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Build Ampere CentOS Kernel</title>
		<link>https://richliu.com/2022/03/17/4555/build-ampere-centos-kernel/</link>
					<comments>https://richliu.com/2022/03/17/4555/build-ampere-centos-kernel/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 17 Mar 2022 07:44:25 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[kernel]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4555</guid>

					<description><![CDATA[<p>Personal Note Install Necessary Packages Install packag [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/03/17/4555/build-ampere-centos-kernel/">Build Ampere CentOS Kernel</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Personal Note</p>



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



<h2 class="wp-block-heading">Install Necessary Packages</h2>



<p>Install packages, it should have to install other packages like openssl-dev.<br /><br />get  package <a href="https://www.gitdetail.com/repositories/AmpereComputing/developer/646825" target="_blank" rel="noreferrer noopener">ampere-8.3.0-20191025-dynamic-nosysroot-nativetools.tar.xz</a> from Ampere customer connect or <a href="https://www.gitdetail.com/repositories/AmpereComputing/developer/646825" target="_blank" rel="noreferrer noopener">ampere development source web</a>. </p>



<pre class="wp-block-code"><code>yum groupinstall "Development Tools"

yum -y install ncurses-devel
yum -y install hmaccalc zlib-devel binutils-devel elfutils-devel libelf-devel newt-devel python-devel
yum -y install audit-libs-devel numactl-devel pciutils-devel openssl-devel
yum -y install bc bison perl-ExtUtils-Embed.noarch xmlto asciidoc
rpm –ivh kernel-4.18.0-80.11.2.el8.&lt;version>.src.rpm


mkdir -p /opt/amp
tar -xf ampere-8.3.0-20191025-dynamic-nosysroot-nativetools.tar.xz -C /opt/amp
export PATH=/opt/amp/ampere-8.3.0-20191025-dynamic-nosysroot/bin:$PATH;
which gcc
/opt/amp/ampere-8.3.0-20191025/bin/gcc
</code></pre>



<p>if gcc is not in /opt/amp, please check your directory in /opt/amy </p>



<h2 class="wp-block-heading">Build Kernel</h2>



<p>command to build kernel</p>



<pre class="wp-block-preformatted">cd /root/rpmbuild/SOURCES/
tar xvf linux-4.18.0-80.11.2.el8_0.tar.xz
cd linux-4.18.0-80.11.2.el8_0
cp ../kernel-aarch64-emag.config .config
make olddefconfig</pre>



<p>Try build once and make sure everything is ok</p>



<pre class="wp-block-preformatted">make -j `nproc`</pre>



<p>If buiild OK, generate RPM files. </p>



<pre class="wp-block-preformatted">make -j `nproc` rpm-pkg</pre>



<p>if everything is ok, the RPM files will be on /root/rpmbuild/RPMS/aarch64/</p>



<h2 class="wp-block-heading">Install RPM packages</h2>



<pre class="wp-block-preformatted">/root/rpmbuild/RPMS/aarch64
yum localinstall kernel-4.18.0-1.aarch64.rpm kernel-headers-4.18.0-1.aarch64.rpm</pre>
<p>The post <a rel="nofollow" href="https://richliu.com/2022/03/17/4555/build-ampere-centos-kernel/">Build Ampere CentOS Kernel</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2022/03/17/4555/build-ampere-centos-kernel/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Build Linux kernel 5.x on CentOS 7</title>
		<link>https://richliu.com/2021/11/15/4515/build-linux-kernel-5-x-on-centos-7/</link>
					<comments>https://richliu.com/2021/11/15/4515/build-linux-kernel-5-x-on-centos-7/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 15 Nov 2021 04:32:57 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[linux kernel]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4515</guid>

					<description><![CDATA[<p>This article&#8217;s procedure was tested in Ampere Alt [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/11/15/4515/build-linux-kernel-5-x-on-centos-7/">Build Linux kernel 5.x on CentOS 7</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This article&#8217;s procedure was tested in Ampere Altra CPU platform, but suppose that x86 system also can use this procedure. <br /><br />CentOS 7&#8217;s gcc is too old to compile Linux kernel 5.x, and it can use another package named &#8220;software collections(SCL)&#8221; to install newer gcc to build Linux kernel. </p>



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



<h2 class="wp-block-heading">Install CentOS 7 on Ampere Altra CPU</h2>



<p>Earlier CentOS 7 default OS is too old to support ARM64 CPU and SSIF driver, <br />if you have problem to install on Ampre Altra CPU, it needs to block SSIF and change PCI parameter during booting. Add parameters below on Linux kernel booting parameter when install CentOS7. </p>



<pre class="wp-block-code"><code>modprobe.blacklist=ipmi_si pci=nomsi</code></pre>



<h2 class="wp-block-heading">Prepare Build Environment</h2>



<p>Before download and build Linux kernel 5.x, it needs to run those command to prepare build environment </p>



<pre class="wp-block-code"><code>yum install -y centos-release-scl-rh
yum install -y devtoolset-9*
yum groupinstall -y "Development Tools"
yum install -y ncurses-devel
yum install -y hmaccalc zlib-devel binutils-devel elfutils-libelf-devel
yum install -y python3</code></pre>



<h2 class="wp-block-heading">Download Linux kernel</h2>



<p>Ampere LTS kernel can be download from github, here is the command to checkout Ampere LTS kernel and switch version to 5.10</p>



<pre class="wp-block-code"><code>cd /root
git clone https://github.com/AmpereComputing/ampere-lts-kernel.git
cd /ampere-lte-kernel
git checkout -b origin/linux-5.10.y 5.10.y
</code></pre>



<p>On later Linux kernel, it needs to use git switch to switch to 5.10.y</p>



<pre class="wp-block-preformatted">git switch 5.10.y</pre>



<h2 class="wp-block-heading">Build Linux kernel</h2>



<p>It&#8217;s simple to build Linux kernel</p>



<pre class="wp-block-code"><code>scl enable devtoolset-9 bash
cd /root/ampere-lte-kernel
cp arch/arm64/configs/altra_5.10_defconfig .config
make olddefconfig
make -j `nproc` &amp;&amp; make -j `nproc` modules  &amp;&amp; make modules_install &amp;&amp; make install</code></pre>



<h2 class="wp-block-heading">GRUB Setting</h2>



<p>Suggest to change default GRUB timeout to choice right kernel to boot. </p>



<pre class="wp-block-code"><code>sed -i 's/GRUB_TIMEOUT=5/GRUB_TIMEOUT=30/g' /etc/default/grub
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg</code></pre>



<p>OK, right now it can reboot your system to have try. </p>



<p>Ref: <br />Good mirror site for CentOS7 package.  <br />https://mirrors.bfsu.edu.cn/centos-altarch/7.9.2009/os/aarch64/<br /><br /></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/11/15/4515/build-linux-kernel-5-x-on-centos-7/">Build Linux kernel 5.x on CentOS 7</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2021/11/15/4515/build-linux-kernel-5-x-on-centos-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ARM64 Linux Performance Tuning</title>
		<link>https://richliu.com/2021/05/19/4477/arm64-linux-performance-tuning/</link>
					<comments>https://richliu.com/2021/05/19/4477/arm64-linux-performance-tuning/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 19 May 2021 01:54:33 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[performance]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4477</guid>

					<description><![CDATA[<p>This is personal notebook for ARM64 performance tuning. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/05/19/4477/arm64-linux-performance-tuning/">ARM64 Linux Performance Tuning</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This is personal notebook for ARM64 performance tuning.</p>



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



<h2 class="wp-block-heading">NVME 4K Write Performance</h2>



<p>Situation: <br />Run fio 4K write on 24 NVME drivers, but some drivers might not get higher IOPS performance</p>



<p>Solution:<br />It should be caused by enable SMMU, so, if doesn&#8217;t use VM, just disable iommu to get better performance<br />Add iommu.passthrough=1</p>



<h2 class="wp-block-heading">General IO performance Tuning </h2>



<p>For high bandwidth card, most time it needs to disable irq_balancing <br />$ systemctl stop irqbalance.service</p>



<h2 class="wp-block-heading">Some Performance Tuning Parameters</h2>



<pre class="wp-block-preformatted">ulimit -s unlimited 
ulimit -l 2097152 
echo 8 | sudo tee /proc/sys/vm/dirty_ratio 
echo 1 | sudo tee /proc/sys/vm/swappiness 
echo 1 | sudo tee /proc/sys/vm/zone_reclaim_mode 
echo 3 | sudo tee /proc/sys/vm/drop_caches 
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space 
echo 0 | sudo tee /proc/sys/kernel/numa_balancing 
echo never > /sys/kernel/mm/transparent_hugepage/enabled 
cpupower frequency-set -g performance 
export MALLOC_CONF=thp:always
 
</pre>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/05/19/4477/arm64-linux-performance-tuning/">ARM64 Linux Performance Tuning</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2021/05/19/4477/arm64-linux-performance-tuning/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>htop more column for mass CPUs</title>
		<link>https://richliu.com/2021/03/22/4421/htop-more-column-for-mass-cpus/</link>
					<comments>https://richliu.com/2021/03/22/4421/htop-more-column-for-mass-cpus/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 22 Mar 2021 12:35:02 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4421</guid>

					<description><![CDATA[<p>htop can support multiple columns in one screen, just p [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/03/22/4421/htop-more-column-for-mass-cpus/">htop more column for mass CPUs</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>htop can support multiple columns in one screen, just press F2 enter setup mode, and change left column and right column to CPUs (1-4/8) [Bar] and CPUs (5-8/8) [Bar] </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1824" height="1008" src="https://richliu.com/wp-content/uploads/2021/03/image-3.png" alt="" class="wp-image-4423" srcset="https://richliu.com/wp-content/uploads/2021/03/image-3.png 1824w, https://richliu.com/wp-content/uploads/2021/03/image-3-600x332.png 600w, https://richliu.com/wp-content/uploads/2021/03/image-3-768x424.png 768w, https://richliu.com/wp-content/uploads/2021/03/image-3-1536x849.png 1536w" sizes="auto, (max-width: 1824px) 100vw, 1824px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1832" height="715" src="https://richliu.com/wp-content/uploads/2021/03/image-2.png" alt="" class="wp-image-4422" srcset="https://richliu.com/wp-content/uploads/2021/03/image-2.png 1832w, https://richliu.com/wp-content/uploads/2021/03/image-2-600x234.png 600w, https://richliu.com/wp-content/uploads/2021/03/image-2-768x300.png 768w, https://richliu.com/wp-content/uploads/2021/03/image-2-1536x599.png 1536w" sizes="auto, (max-width: 1832px) 100vw, 1832px" /></figure>



<p>htoprc , put it on /etc/htoprc or ~/.config/htop/htoprc</p>



<pre class="wp-block-code"><code># Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.
fields=0 48 17 18 38 39 40 2 46 47 49 1
sort_key=1
sort_direction=1
hide_threads=0
hide_kernel_threads=1
hide_userland_threads=0
shadow_other_users=0
show_thread_names=0
show_program_path=1
highlight_base_name=0
highlight_megabytes=1
highlight_threads=1
tree_view=0
header_margin=1
detailed_cpu_time=0
cpu_count_from_zero=0
show_cpu_usage=1
show_cpu_frequency=0
update_process_names=0
account_guest_in_cpu_meter=0
color_scheme=0
enable_mouse=1
delay=15
left_meters=LeftCPUs4 Memory Swap
left_meter_modes=1 1 1
right_meters=RightCPUs4 Tasks LoadAverage Uptime
right_meter_modes=1 2 2 2
</code></pre>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/03/22/4421/htop-more-column-for-mass-cpus/">htop more column for mass CPUs</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2021/03/22/4421/htop-more-column-for-mass-cpus/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>The NVM Checksum Is Not Valid</title>
		<link>https://richliu.com/2021/02/25/4341/the-nvm-checksum-is-not-valid/</link>
					<comments>https://richliu.com/2021/02/25/4341/the-nvm-checksum-is-not-valid/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 24 Feb 2021 17:55:12 +0000</pubDate>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[firmware]]></category>
		<category><![CDATA[i350]]></category>
		<category><![CDATA[Intel]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4341</guid>

					<description><![CDATA[<p>這個是我 Intel i350-T4 最近出現的錯誤訊息，是最近 Power 壞掉之後才發生的，錯誤訊息如下  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/02/25/4341/the-nvm-checksum-is-not-valid/">The NVM Checksum Is Not Valid</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>這個是我 Intel i350-T4 最近出現的錯誤訊息，是最近 Power 壞掉之後才發生的，錯誤訊息如下</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p></p><cite>[  775.510780] igb: Intel(R) Gigabit Ethernet Network Driver &#8211; version 5.4.0-k<br /> [  775.510782] igb: Copyright (c) 2007-2014 Intel Corporation.<br /> [  775.526676] igb 0000:01:00.0: The NVM Checksum Is Not Valid<br /> [  775.602407] igb: probe of 0000:01:00.0 failed with error -5<br /> [  775.617632] igb 0000:01:00.1: The NVM Checksum Is Not Valid<br /> [  775.693405] igb: probe of 0000:01:00.1 failed with error -5<br /> [  775.708632] igb 0000:01:00.2: The NVM Checksum Is Not Valid<br /> [  775.784404] igb: probe of 0000:01:00.2 failed with error -5<br /> [  775.799632] igb 0000:01:00.3: The NVM Checksum Is Not Valid<br /> [  775.875410] igb: probe of 0000:01:00.3 failed with error -5</cite></blockquote>



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



<p>解決方法也很簡單，下載 <a rel="noreferrer noopener" aria-label="Intel® Ethernet連接啟動公用程式、預啟動映射和 EFI 驅動程式 (opens in a new tab)" href="https://downloadcenter.intel.com/zh-tw/download/29137?v=t" target="_blank">Intel® Ethernet連接啟動公用程式、預啟動映射和 EFI 驅動程式</a> 在 Linux 下解開之後，</p>



<p>$ cd APPS/BootUtil/Linux_x64<br />$ chmod +x bootutil64e<br />$ sudo ./bootutil64e<br />Connection to QV driver failed &#8211; please reinstall it!<br />Intel(R) Ethernet Flash Firmware Utility<br /> BootUtil version 1.7.26.3<br /> Copyright (C) 2003-2020 Intel Corporation</p>



<p>ERROR: The adapter (location 0:25.0) cannot be initialized due to inaccessible device memory.<br /> Update the device driver and reboot the system before running this utility again.<br /> Consult the utility documentation for more information.<br />Type BootUtil -? for help<br />Port Network Address Location Series  WOL Flash Firmware                Version<br /> ==== =============== ======== ======= === ============================= =======<br />   2   A0369FA1FB70     1:00.0 Gigabit NO  FLASH Unknown<br />   3   A0369FA1FB71     1:00.1 Gigabit N/A FLASH Disabled<br />   4   A0369FA1FB72     1:00.2 Gigabit N/A FLASH Disabled<br />   5   A0369FA1FB73     1:00.3 Gigabit N/A FLASH Disabled</p>



<p>2,3,4,5 就是我們要處理的網路卡，只要下以下指令之後再重開機就會恢復了</p>



<p>$ sudo ./bootutil64e -NIC 2 -defcfg<br />$ sudo ./bootutil64e -NIC 3 -defcfg<br />$ sudo ./bootutil64e -NIC 4 -defcfg<br />$ sudo ./bootutil64e -NIC 5 -defcfg</p>



<p>ref. <a href="https://superuser.com/questions/1104537/how-to-repair-the-checksum-of-the-non-volatile-memory-nvm-of-intel-ethernet-co" target="_blank" rel="noreferrer noopener" aria-label="How to repair the checksum of the non-volatile memory (NVM) of Intel Ethernet Controller I219-V of an ASUS laptop? (opens in a new tab)">How to repair the checksum of the non-volatile memory (NVM) of Intel Ethernet Controller I219-V of an ASUS laptop?</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2021/02/25/4341/the-nvm-checksum-is-not-valid/">The NVM Checksum Is Not Valid</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2021/02/25/4341/the-nvm-checksum-is-not-valid/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
