<?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://blog.richliu.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Wed, 12 Feb 2025 09:18:26 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>
	<item>
		<title>GPU Passthrough on ARM64 with Libvirt/Virt-manager</title>
		<link>https://blog.richliu.com/2025/02/12/6182/gpu-passthrough-on-arm64-with-libvirt-virt-manager/</link>
					<comments>https://blog.richliu.com/2025/02/12/6182/gpu-passthrough-on-arm64-with-libvirt-virt-manager/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 12 Feb 2025 09:18:24 +0000</pubDate>
				<category><![CDATA[AI]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[ALTRAD8UD]]></category>
		<category><![CDATA[AltraMax]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[DeepSeek]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nvidia]]></category>
		<category><![CDATA[ollama]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=6182</guid>

					<description><![CDATA[<p>In this article, I’ll walk you through the steps to set [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/02/12/6182/gpu-passthrough-on-arm64-with-libvirt-virt-manager/">GPU Passthrough on ARM64 with Libvirt/Virt-manager</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In this article, I’ll walk you through the steps to set up GPU passthrough on an ARM64 system using Libvirt and Virt-manager. While using the ChatGPT to search answer, the steps may seem straightforward, but missing a critical detail can cause the process to fail.</p>



<p><strong>System Specifications</strong></p>



<p><strong>Nvidia Driver</strong>: NVIDIA-Linux-aarch64-570.86.16.run<br /><strong>Host</strong>: Ampere Altra + ALTRAD8UD<br /><strong>Host OS</strong>: Ubuntu 22.04 with HWE kernel (6.8)<br /><strong>Guest OS</strong>: Ubuntu 22.04 (ubuntu-22.04-live-server-arm64.iso)<br /><strong>GPU</strong>: Nvidia RTX 4080 16GB</p>



<p><strong>Assumptions</strong></p>



<ol start="1" class="wp-block-list">
<li>You are familiar with Ubuntu and its basic commands.</li>



<li>You have experience using Virt-manager.</li>



<li>All commands are executed as the root user.</li>
</ol>



<p>If anything is unclear, you can refer to external resources for additional guidance.</p>



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



<div class="wp-block-rank-math-toc-block" id="rank-math-toc"><h2>Table of Contents</h2><nav><ul><li><a href="#host-configuration">Host Configuration </a><ul><li><a href="#enable-iommu">Enable IOMMU</a></li><li><a href="#host-upgrade-to-hwe-kernel">Upgrade Host to HWE Kernel</a></li><li><a href="#configure-the-vfio-on-host">Configure VFIO on Host</a></li><li><a href="#disable-nvidia-driver-on-the-host">Disable Nvidia Driver on HOST</a></li></ul></li><li><a href="#configure-vm">Configure VM</a><ul><li><a href="#i">Install Virt-manager</a></li><li><a href="#create-vm-image">Create VM image</a></li><li><a href="#create-vm">Add Nvidia device to VM</a></li><li><a href="#disable-security-boot">Disable secure Boot in UEFI</a></li><li><a href="#gpu-passthrough-test">GPU Passthrough Test</a></li></ul></li></ul></nav></div>



<h2 class="wp-block-heading" id="host-configuration">Host Configuration </h2>



<h3 class="wp-block-heading" id="enable-iommu">Enable IOMMU</h3>



<p>To enable IOMMU, you need to enable the SR-IOV option in the BIOS and verify whether the Linux kernel has IOMMU enabled by default.</p>



<p>You can check if IOMMU is enabled by running:</p>



<pre class="wp-block-preformatted">$ dmesg | grep -i iommu</pre>



<p>Example output:</p>



<pre class="wp-block-preformatted">[    0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-6.8.0-52-generic root=UUID=6b78fa89-a575-432d-a445-1497c3467214 ro iommu=on<br />[    0.000000] Unknown kernel command line parameters "BOOT_IMAGE=/boot/vmlinuz-6.8.0-52-generic iommu=on", will be passed to user space.<br />[   11.561684] <strong>iommu: Default domain type: Translated</strong><br />[   11.566470] <strong>iommu: DMA domain TLB invalidation policy: strict mode</strong></pre>



<p>If IOMMU is not enabled, add <code>iommu=on</code> to the Linux kernel boot parameters:</p>



<pre class="wp-block-preformatted">$ vim /etc/default/grub </pre>



<p>Modify the line:</p>



<pre class="wp-block-preformatted">GRUB_CMDLINE_LINUX_DEFAULT="iommu=on"</pre>



<p>Then update GRUB and reboot:</p>



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



<p>Additionally, enable SR-IOV in the BIOS. The exact location of this setting varies depending on the BIOS, but it is typically found under the PCIe subsystem or related options.</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="1280" height="770" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-4.png" alt="" class="wp-image-6183" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-4.png 1280w, https://blog.richliu.com/wp-content/uploads/2025/02/image-4-600x361.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-4-768x462.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-4-816x491.png 816w" sizes="(max-width: 1280px) 100vw, 1280px" /></figure>



<h3 class="wp-block-heading" id="host-upgrade-to-hwe-kernel"><strong>Upgrade Host to HWE Kernel</strong></h3>



<p>I recommend using the Hardware Enablement (HWE) kernel on the host. While I’m unsure if the regular kernel works, the HWE kernel has been reliable in my experience. Install it with:</p>



<pre class="wp-block-preformatted">sudo apt install linux-generic-hwe-22.04</pre>



<h3 class="wp-block-heading" id="configure-the-vfio-on-host">Configure VFIO on Host</h3>



<p>The VM relies on the VFIO driver for GPU passthrough. To configure VFIO, you need to pass the PCIe device information to the VFIO driver.</p>



<p>First, identify the GPU’s PCIe device IDs:</p>



<pre class="wp-block-preformatted">$ lspci -nn</pre>



<p>Example output:</p>



<pre class="wp-block-preformatted"><br /><br />0005:01:00.0 VGA compatible controller [0300]: NVIDIA Corporation Device [<strong>10de:2704</strong>] (rev a1)<br />0005:01:00.1 Audio device [0403]: NVIDIA Corporation Device [<strong>10de:22bb</strong>] (rev a1)</pre>



<p>Here, <strong><code>10de:2704</code> </strong>is the GPU’s PCIe device ID, and <code><strong>10de:22bb</strong></code> is the audio device ID. At a minimum, you need to pass through the GPU device.</p>



<p>Next, edit the VFIO configuration file to include these IDs:</p>



<pre class="wp-block-preformatted">$ vim /etc/modprobe.d/vfio.conf</pre>



<p>Add the following line:</p>



<pre class="wp-block-preformatted">options vfio-pci ids=10de:2704,10de:22bb</pre>



<h3 class="wp-block-heading" id="disable-nvidia-driver-on-the-host">Disable Nvidia Driver on HOST</h3>



<p>To prevent the host from loading the Nvidia driver, add the Nvidia modules to the kernel’s blocklist:</p>



<pre class="wp-block-preformatted">$ vim /etc/modprobe.d/blacklist.conf</pre>



<p>Add the following lines:</p>



<pre class="wp-block-preformatted">blacklist nvidia<br />blacklist nvidia_drm<br />blacklist nvidia_modeset</pre>



<p>Update the initramfs and reboot:</p>



<pre class="wp-block-preformatted">$ update-initramfs -u<br />$ reboot</pre>



<h2 class="wp-block-heading" id="configure-vm">Configure VM</h2>



<h3 class="wp-block-heading" id="i">Install Virt-manager</h3>



<p>In this article, we used virt-manager as VM manager, first step is install virt-manager, suppose Ubuntu will install all relative packages. </p>



<pre class="wp-block-preformatted">$ apt install virt-manager </pre>



<p>If you’re using SSH with X11 forwarding (e.g.,&nbsp;<code>ssh -X host</code>) or MobaXTerm on Windows, Virt-manager will display the remote X window. If neither method works, consider installing a KDE desktop on the host and accessing it via the BMC remote console.</p>



<p>(Optional) Install KDE Plasma Desktop:</p>



<pre class="wp-block-preformatted">(option)<br />$ apt install kde-plasma-desktop</pre>



<h3 class="wp-block-heading" id="create-vm-image">Create VM image</h3>



<p>Virt-manager creates fixed-size VM images by default. If you prefer dynamic allocation, create the image manually:</p>



<pre class="wp-block-preformatted">$ qemu-img create -f qcow2 ubuntu2204.qcow2 200G</pre>



<h3 class="wp-block-heading" id="create-vm">Add Nvidia device to VM</h3>



<p>If the host is configured correctly, Virt-manager will list all PCIe devices, including the Nvidia GPU. Add the GPU and its audio device (e.g., <code><strong>0005:01:00.0</strong></code> and <code><strong>0005:01:00.1</strong></code>) to the VM’s hardware list.</p>



<p>After adding the devices, proceed with the Ubuntu 22.04 installation.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1023" height="632" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-5.png" alt="" class="wp-image-6184" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-5.png 1023w, https://blog.richliu.com/wp-content/uploads/2025/02/image-5-600x371.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-5-768x474.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-5-816x504.png 816w" sizes="(max-width: 1023px) 100vw, 1023px" /></figure>



<p>After add hardware </p>



<figure class="wp-block-image size-full"><img decoding="async" width="1046" height="646" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-6.png" alt="" class="wp-image-6185" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-6.png 1046w, https://blog.richliu.com/wp-content/uploads/2025/02/image-6-600x371.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-6-768x474.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-6-816x504.png 816w" sizes="(max-width: 1046px) 100vw, 1046px" /></figure>



<p>Now, it can run begin install to install ubuntu 22.04</p>



<h3 class="wp-block-heading" id="disable-security-boot">Disable secure Boot in UEFI</h3>



<p>By default, Virt-manager enables Secure Boot. However, Nvidia drivers may not work with Secure Boot enabled. Even though the Nvidia installer includes a driver signing feature, the driver may still fail to load. To avoid issues, disable Secure Boot in the VM’s UEFI settings.</p>



<p>During the VM’s boot process, press the <strong><code>DEL</code> </strong>key to enter UEFI settings and uncheck the Secure Boot option.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="973" height="632" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-7.png" alt="" class="wp-image-6186" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-7.png 973w, https://blog.richliu.com/wp-content/uploads/2025/02/image-7-600x390.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-7-768x499.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-7-816x530.png 816w" sizes="(max-width: 973px) 100vw, 973px" /></figure>



<p>Before installing the Nvidia driver, ensure the necessary development packages are installed:</p>



<pre class="wp-block-preformatted">$ apt install build-essential</pre>



<p>Then, install the Nvidia driver and reboot the VM.</p>



<h3 class="wp-block-heading" id="gpu-passthrough-test">GPU Passthrough Test</h3>



<p>If everything is set up correctly, running <code><strong>nvidia-smi</strong></code> should display the GPU’s status.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1280" height="515" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-8.png" alt="" class="wp-image-6188" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-8.png 1280w, https://blog.richliu.com/wp-content/uploads/2025/02/image-8-600x241.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-8-768x309.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-8-816x328.png 816w" sizes="(max-width: 1280px) 100vw, 1280px" /></figure>



<p>For testing, you can use&nbsp;<strong>Ollama</strong>&nbsp;with the&nbsp;<strong>Deepseek-R1</strong>&nbsp;model. Install Ollama with:</p>



<pre class="wp-block-preformatted">curl -fsSL https://ollama.com/install.sh | sh</pre>



<p>Pull the Deepseek-R1 model. Since the GPU has 16GB of memory, the 14B model is a good choice (it requires ~10GB):</p>



<pre class="wp-block-preformatted">ollama run deepseek-r1:14b</pre>



<p>Ask a question like, “Why is the sky blue?” This will trigger the model’s Chain-of-Thought (CoT) reasoning.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1280" height="772" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-9.png" alt="" class="wp-image-6189" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-9.png 1280w, https://blog.richliu.com/wp-content/uploads/2025/02/image-9-600x362.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-9-768x463.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-9-816x492.png 816w" sizes="(max-width: 1280px) 100vw, 1280px" /></figure>



<p>Monitor the GPU’s status using <code>nvidia-smi</code> to ensure it’s functioning correctly.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1280" height="577" src="https://blog.richliu.com/wp-content/uploads/2025/02/image-10.png" alt="" class="wp-image-6190" srcset="https://blog.richliu.com/wp-content/uploads/2025/02/image-10.png 1280w, https://blog.richliu.com/wp-content/uploads/2025/02/image-10-600x270.png 600w, https://blog.richliu.com/wp-content/uploads/2025/02/image-10-768x346.png 768w, https://blog.richliu.com/wp-content/uploads/2025/02/image-10-816x368.png 816w" sizes="(max-width: 1280px) 100vw, 1280px" /></figure>



<p></p>



<p></p>



<p></p>



<p></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2025/02/12/6182/gpu-passthrough-on-arm64-with-libvirt-virt-manager/">GPU Passthrough on ARM64 with Libvirt/Virt-manager</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2025/02/12/6182/gpu-passthrough-on-arm64-with-libvirt-virt-manager/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Play Game On Ampere Altra ARM64 Platform</title>
		<link>https://blog.richliu.com/2024/02/25/5816/play-game-on-ampere-altra-arm64-platform/</link>
					<comments>https://blog.richliu.com/2024/02/25/5816/play-game-on-ampere-altra-arm64-platform/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 25 Feb 2024 04:38:53 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[GAME]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Altra]]></category>
		<category><![CDATA[ALTRAD8UD]]></category>
		<category><![CDATA[Ampere]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[Box86]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5816</guid>

					<description><![CDATA[<p>Setup Steam on Ampere Altra platform. </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/25/5816/play-game-on-ampere-altra-arm64-platform/">Play Game On Ampere Altra ARM64 Platform</a> appeared first on <a rel="nofollow" href="https://blog.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 loading="lazy" decoding="async" width="2560" height="1527" src="https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-scaled.jpg" alt="" class="wp-image-5824" style="aspect-ratio:1.676489849377865;width:367px;height:auto" srcset="https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-scaled.jpg 2560w, https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-600x358.jpg 600w, https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-768x458.jpg 768w, https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-1536x916.jpg 1536w, https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-2048x1222.jpg 2048w, https://blog.richliu.com/wp-content/uploads/2024/02/IMG_20240223_154907-1-816x487.jpg 816w" sizes="(max-width: 2560px) 100vw, 2560px" /></figure></div>


<p>In previous article on <a href="https://blog.richliu.com/2024/02/21/5808/how-to-install-stable-diffusion-gui-on-arm64-nvidia-rtx-platform/">How to Install Stable Diffusion GUI on ARM64 Nvidia RTX platform</a> , we installed the Nvidia driver and ran PyTorch on the platform. Now, this platform has Nvidia RTX gaming card, can we use it to play game? </p>



<p>The answer is yes, there are some windows x86 or x64 emulators on Linux, but the most stable solution comes from Ampere&#8217;s official release solution. Other emulators might not work as well on this combination, such as FEX, but I don&#8217;t know whether it is a driver issue or another issue.</p>



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



<p><br />Basically, following Ampere&#8217;s documentation makes it easy to install the driver and play games. Let&#8217;s combine both documents into one and simplify it in this article.<br /><br />Hardware <br />CPU: Ampere Altra <br />Board: AsRock ALTRAD8UD<br />GPU: Nvidia RTX 4080 <br /><br />Reference Ampere&#8217;s document<br /><a href="https://github.com/AmpereComputing/NVIDIA-GPU-Accelerated-Linux-Desktop-on-Ampere" target="_blank" rel="noopener">NVIDIA GPU Accelerated Linux Desktop on Ampere</a><br /><a href="https://github.com/AmpereComputing/Steam-on-Ampere" target="_blank" rel="noopener">Steam-on-Ampere</a></p>



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



<p>All the conditions are similar to those outlined in the article <a href="https://blog.richliu.com/2024/02/21/5808/how-to-install-stable-diffusion-gui-on-arm64-nvidia-rtx-platform/">How to Install Stable Diffusion GUI on ARM64 Nvidia RTX platform</a>, using Ubuntu 22.04 with a general kernel (not the HWE kernel, which Nvidia may address in the future).</p>



<p>I haven&#8217;t utilized the original document&#8217;s script; instead, I&#8217;ve copied some necessary commands from it.</p>



<pre class="wp-block-preformatted">sudo apt-get install build-essential
# Install Nvidia driver here
sudo rmmod nouveau
cat &lt;&lt; EOF | sudo tee /etc/modprobe.d/blacklist-nouveau.conf
blacklist nouveau
options nouveau modeset=0
EOF

sudo nvidia-xconfig -a --cool-bits=31 --allow-empty-initial-configuration

# Install Desktop, personally I like kde. 
sudo apt install kde-plasma-desktop
# or it can install regular ubuntu desktop 
# sudo apt install ubuntu-desktop</pre>



<p>Download <a href="https://www.nvidia.com/en-us/drivers/unix/linux-aarch64-archive/" target="_blank" rel="noopener">Nvidia ARM64 (aarch64) Display Driver </a>; the current version, 535.154.05, is acceptable. After installing the Nvidia driver, simply reboot the system. You can then use the following command to check the driver status.</p>



<pre class="wp-block-preformatted">nvidia-smi</pre>



<h2 class="wp-block-heading">Disable aspm from kernel </h2>



<p>I didn&#8217;t apply this option. Most of the time, it&#8217;s only necessary to do so if the system encounters the massive AER error issue. Here&#8217;s an example command from the original document:</p>



<pre class="wp-block-preformatted">sudo nano /etc/default/grub
# Add pcie_aspm=off to kernel parameters
# GRUB_CMDLINE_LINUX_DEFAULT="pcie_aspm=off"
sudo update-grub
</pre>



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



<p>Following commands show how to install Box86</p>



<pre class="wp-block-preformatted">sudo wget https://itai-nelken.github.io/weekly-box86-debs/debian/box86.list -O /etc/apt/sources.list.d/box86.list
wget -qO- https://itai-nelken.github.io/weekly-box86-debs/debian/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install box86:armhf -y</pre>



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



<p>Following command show how to install <a href="https://github.com/ryanfortner/box64-debs" target="_blank" rel="noopener">Box64</a>, but original instruction have update , a package name was changed. </p>



<pre class="wp-block-preformatted">sudo wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list
wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg
sudo apt update 
sudo apt install box64-arm64 -y
sudo systemctl restart systemd-binfmt</pre>



<h2 class="wp-block-heading">Installing Steam</h2>



<p>Because I am using the Ubuntu 22.04 ARM64 server version with minimal, so,  some packages might not be installed, Before Install Steam, install necessary packages</p>



<pre class="wp-block-preformatted">sudo apt install lsof

sudo apt install zenity
sudo apt install alsa
</pre>



<p>Use the following to install steam.</p>



<pre class="wp-block-code"><code>git clone https://github.com/ptitSeb/box86
cd box86
./install_steam.sh</code></pre>



<p>Now, it can use steam now. </p>



<pre class="wp-block-preformatted">/usr/local/bin/steam</pre>



<p>Okay, log in and enjoy it. However, in my experience, when installing other emulators, it might damage the box86+Steam setup, necessitating a system reinstallation to fix it.</p>



<p>Furthermore, the game&#8217;s performance seems not as good as expected, possibly due to my choice of Vampire Survivors and enabling high performance</p>



<h2 class="wp-block-heading">Xbox JoyStick controller</h2>



<p>I have an Xbox controller, and ALTRAD8UD doesn&#8217;t have Bluetooth capability, so I cannot use wireless conntions. However, it can connect via USB.</p>



<p>There are several Xbox drivers available for Linux. After testing, I found that <a href="https://atar-axis.github.io/xpadneo/" target="_blank" rel="noopener">xpadano</a> is compatible with this platform. Simply follow their instruction guide to install the Xbox driver.</p>



<pre class="wp-block-preformatted"># Install DKMS package
sudo apt-get install dkms linux-headers-`uname -r`

# download source code
git clone https://github.com/atar-axis/xpadneo.git
cd xpadneo
# use DKMS to compile the driver
sudo ./install.sh</pre>



<p>The Xbox controller driver will be installed automatically, and it works well in my tests. You can install the <code>jstest</code> package to perform a joystick test.</p>



<p>The Xbox controller functions seamlessly on Steam and Vampire Survivors. I can easily use the Xbox controller to play Vampire Survivors.</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/25/5816/play-game-on-ampere-altra-arm64-platform/">Play Game On Ampere Altra ARM64 Platform</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/02/25/5816/play-game-on-ampere-altra-arm64-platform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>AsRock ALTRAD8UD-1L2T Ampere Altra/AltraMax Note</title>
		<link>https://blog.richliu.com/2024/02/07/5766/asrock-altrad8ud-1l2t-ampere-altra-altramax-note/</link>
					<comments>https://blog.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://blog.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://blog.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://blog.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://blog.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://blog.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 loading="lazy" decoding="async" width="1220" height="952" src="https://blog.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://blog.richliu.com/wp-content/uploads/2024/02/image-13.png 1220w, https://blog.richliu.com/wp-content/uploads/2024/02/image-13-600x468.png 600w, https://blog.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://blog.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://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.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://blog.richliu.com/2024/02/04/5764/apt-cacher-ng-e-failed-to-fetch-503-connection-closed-check-dlmaxretries/</link>
					<comments>https://blog.richliu.com/2024/02/04/5764/apt-cacher-ng-e-failed-to-fetch-503-connection-closed-check-dlmaxretries/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 04 Feb 2024 01:03:35 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=5764</guid>

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



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



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



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



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



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



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



<p>ref.<br /><a href="https://askubuntu.com/questions/590151/unable-to-download-anything-from-apt-cacher-ng-proxy" target="_blank" rel="noopener">Unable to download anything from apt-cacher-ng proxy</a><br /><a href="https://stackoverflow.com/questions/19995855/increase-max-open-files-for-ubuntu-upstart-initctl" target="_blank" rel="noopener">Increase max open files for Ubuntu/Upstart (initctl)</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2024/02/04/5764/apt-cacher-ng-e-failed-to-fetch-503-connection-closed-check-dlmaxretries/">apt-cacher-ng E: Failed to fetch 503 Connection closed, check DlMaxRetries</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2024/02/04/5764/apt-cacher-ng-e-failed-to-fetch-503-connection-closed-check-dlmaxretries/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu/Fedora PXE Boot</title>
		<link>https://blog.richliu.com/2023/04/16/5181/ubuntu-fedora-pxe-boot/</link>
					<comments>https://blog.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://blog.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://blog.richliu.com/2023/04/16/5181/ubuntu-fedora-pxe-boot/">Ubuntu/Fedora PXE Boot</a> appeared first on <a rel="nofollow" href="https://blog.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://blog.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://blog.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://blog.richliu.com/2023/04/16/5181/ubuntu-fedora-pxe-boot/">Ubuntu/Fedora PXE Boot</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2023/04/16/5181/ubuntu-fedora-pxe-boot/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://blog.richliu.com/2022/09/27/4830/linux-kernel-install-fail-because-broadcom-netxtreme-100g-dkms-driver-build-failed/</link>
					<comments>https://blog.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://blog.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://blog.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://blog.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://blog.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://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.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>Build Ampere CentOS Kernel</title>
		<link>https://blog.richliu.com/2022/03/17/4555/build-ampere-centos-kernel/</link>
					<comments>https://blog.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://blog.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://blog.richliu.com/2022/03/17/4555/build-ampere-centos-kernel/">Build Ampere CentOS Kernel</a> appeared first on <a rel="nofollow" href="https://blog.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://blog.richliu.com/2022/03/17/4555/build-ampere-centos-kernel/">Build Ampere CentOS Kernel</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2022/03/17/4555/build-ampere-centos-kernel/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Visual Studio Code Development</title>
		<link>https://blog.richliu.com/2021/07/03/4483/visual-studio-code-development/</link>
					<comments>https://blog.richliu.com/2021/07/03/4483/visual-studio-code-development/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 03 Jul 2021 03:14:09 +0000</pubDate>
				<category><![CDATA[隨手札記]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ssh]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=4483</guid>

					<description><![CDATA[<p>個人筆記首先要裝對版本，Visual Studio Code ，不是 Visual Studio commun [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2021/07/03/4483/visual-studio-code-development/">Visual Studio Code Development</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>個人筆記<br />首先要裝對版本，Visual Studio Code ，不是 Visual Studio community 版本，community 沒有 remote development 可以用，不方便</p>



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



<h1 class="wp-block-heading">遠端開發</h1>



<p>在 Extension Market 裝 Remote Development, 這套件含 Remote -WSL, Remote &#8211; Container , Remote &#8211; SSH <br />我們要的就是 Remote &#8211; SSH<br /><br />裝完以後，按 F1 輸入(找到) <strong>Remote-SSH:  Add New SSH Host&#8230;</strong><br />輸入你要連結的 HOST，例如：</p>



<pre class="wp-block-preformatted">ssh user@host.example</pre>



<p>接下來選一個 config file ，預設是 c:\user\&lt;your account\.ssh\config<br />選完之後右下角會跳一個視窗，Open Config ，可以打開看一下<br /><br />接下來就選 File -&gt; Preferences -&gt; Setting  ，右上角會有一個 Open Settings(JSON) 的圖示，大概是視窗最大化的那個<br />新安裝的應該什麼設定都沒有，我要連線的目標主機是 Linux ，要加上這個設定</p>



<pre class="wp-block-preformatted">{
&nbsp;&nbsp;&nbsp;&nbsp;"remote.SSH.showLoginTerminal":&nbsp;true,
&nbsp;&nbsp;&nbsp;&nbsp;"remote.SSH.remotePlatform":&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"host.example":&nbsp;"linux",
&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp;&nbsp;&nbsp;&nbsp;
}</pre>



<p>接下來就可以連線到 Linux 遠端</p>



<h2 class="wp-block-heading">SSH Keygen</h2>



<p>每次連到遠端都還要輸入密碼也是頗煩的，如果只是不重要的開發機，使用 ssh keygen 還是比較方便的<br /><br />第一步使用 WSL 切到目錄，將 &lt;username> 換成 windows 的帳號，如果 ssh-keygen 產生的 id_rsa 和 id_rsa.pub 沒有在這個目錄，記得copy到這個目錄，最後一步，將 ssh key copy 到你的 server</p>



<pre class="wp-block-preformatted">$ cd /mnt/c/Users/&lt;username>/.ssh
$ ssh-keygen
$ ssh-copy-id &lt;username>@&lt;serverip>
</pre>



<p>這樣就可以用 VS Code 的 SSH Keygen 功能連到遠端了</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2021/07/03/4483/visual-studio-code-development/">Visual Studio Code Development</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2021/07/03/4483/visual-studio-code-development/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu 18.04 ARM64 DPDK in VM (QEMU)</title>
		<link>https://blog.richliu.com/2019/08/19/4057/ubuntu-18-04-arm64-dpdk-in-vm-qemu/</link>
					<comments>https://blog.richliu.com/2019/08/19/4057/ubuntu-18-04-arm64-dpdk-in-vm-qemu/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 19 Aug 2019 08:17:56 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[18.04]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[dpdk]]></category>
		<category><![CDATA[hugepages]]></category>
		<category><![CDATA[l3fwd]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=4057</guid>

					<description><![CDATA[<p>DPDK is a very popular infrastructure in high speed pac [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/08/19/4057/ubuntu-18-04-arm64-dpdk-in-vm-qemu/">Ubuntu 18.04 ARM64 DPDK in VM (QEMU)</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>DPDK is a very popular infrastructure in high speed packet process domain, some applications will used the same architecture to process packet, like EPC. <br /><br />For Ubuntu 18.04, it used dpdk 17.11, it not good for some other application like dpdk pktgen, but enough for testpmd and l3fwd test. here is some personal note for setup whole environment. </p>



<figure class="wp-block-image is-resized"><img loading="lazy" decoding="async" src="https://blog.richliu.com/wp-content/uploads/2019/08/image-3.png" alt="" class="wp-image-4076" width="363" height="257" srcset="https://blog.richliu.com/wp-content/uploads/2019/08/image-3.png 634w, https://blog.richliu.com/wp-content/uploads/2019/08/image-3-300x213.png 300w" sizes="(max-width: 363px) 100vw, 363px" /><figcaption>DPDK in QEMU archeticture</figcaption></figure>



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



<p>Hardware : Ampere eMag Server with 128GB Memory <br />                      Network Card: Intel i210 Gigabit NIC Card * 2 <br /><br />HOST means commands and instructions on host machines <br />VM means commands and instructions inside VM</p>



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



<h4 class="wp-block-heading">Apt source</h4>



<p>First, please add deb-src to your database, edit file /etc/apt/source.list and removed all &#8220;#&#8221; before deb-src, then, run follow commands to update apt database (suppose all commands run with sudo or root in this article)</p>



<pre class="wp-block-preformatted">sed -i 's/# deb-src/deb-src/g' sources.list
apt update</pre>



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



<p>It needs to install relative packages in host </p>



<pre class="wp-block-preformatted">sudo apt install -y dpdk dpdk-dev dpdk-doc </pre>



<p>Only needs to install on HOST.</p>



<pre class="wp-block-preformatted">sudo apt install -y qemu-efi bridge-utils</pre>



<p>It will install all necessary dpdk packages in host.</p>



<h4 class="wp-block-heading">Preload Module</h4>



<p>It needs to preload vfio-pci modules by default, run following command</p>



<pre class="wp-block-preformatted">echo "vfio-pci" &gt;&gt; /etc/modules</pre>



<h4 class="wp-block-heading">Configure Line Kernel boot command</h4>



<p>It needs to reserve hugepages memory space for Linux kernel, it reserves 32 pages and each pages 1GB, total 32GB. Please modify  /etc/default/grub , and  add hugepagesz=1GB hugepages=32 to GRUB_CMDLINE_LINUX, ex:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>GRUB_CMDLINE_LINUX=&#8221;console=tty0 hugepagesz=1GB hugepages=32&#8243;</p></blockquote>



<p>then run foloowing command to update grub.cfg</p>



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



<p>Mount hugetlbfs by default</p>



<p>If wants to use hugepage, it needs to mount hugetlbfs somewhere, we can create a directory, ex: /mnt/hugepages and mount hugetblsfs there by default. </p>



<pre class="wp-block-preformatted">mkdir -p /mnt/hugepages
echo "nodev   /mnt/hugepages                  hugetlbfs       defaults,pagesize=1G    0 0 none" &gt;&gt; /etc/fstab</pre>



<h2 class="wp-block-heading">Bind Network Card for DPDK</h2>



<p>It wants to let DPDK use current network card, it needs to bind the network card with dpdk. dpdk-devbind command is a useful command. <br />List current command </p>



<pre class="wp-block-preformatted"> $ dpdk-devbind --status
 Network devices using kernel driver
 0001:01:00.0 'I210 Gigabit Network Connection 1533' if=enP1p1s0 drv=igb unused=vfio-pci
 0002:01:00.0 'I210 Gigabit Network Connection 1533' if=enP2p1s0 drv=igb unused=vfio-pci
 0006:01:00.0 'I210 Gigabit Network Connection 1533' if=enP6p1s0 drv=igb unused=vfio-pci <em>Active</em> </pre>



<p>There are three network card in the machine, we would like to bind 1:1:0.0 and 2:1:0.0 to vfio-pci driver. please used following command to bind those network cards. </p>



<pre class="wp-block-preformatted">dpdk-devbind -b vfio-pci 0001:01:00.0 0002:01:00.0</pre>



<p>and check status again</p>



<pre class="wp-block-preformatted"> $ dpdk-devbind --status

Network devices using DPDK-compatible driver
============================================
0001:01:00.0 'I210 Gigabit Network Connection 1533' drv=vfio-pci unused=igb
0002:01:00.0 'I210 Gigabit Network Connection 1533' drv=vfio-pci unused=igb

Network devices using kernel driver
============================================
0006:01:00.0 'I210 Gigabit Network Connection 1533' if=enP6p1s0 drv=igb unused=vfio-pci <em>Active</em> </pre>



<p>Both network cards would be under  Network devices using DPDK-compatible driver  . </p>



<h2 class="wp-block-heading">Prepare QEMU environment </h2>



<h4 class="wp-block-heading">Set up bridge devices  </h4>



<p>We already install bridge-utils before, now, it should configure bridge devices. </p>



<pre class="wp-block-preformatted">mkdir -p /etc/qemu
echo "allow br0" &gt; /etc/qemu/bridge.conf</pre>



<p>Because there is only one network interface on machine, we should use this interface as bridge device, save text below and modify it to fit your environment. </p>



<pre class="wp-block-preformatted"> ORIGNIC=enP6p1s0

 ip addr flush enP6p1s0


 brctl addbr br0
 brctl addif br0 enP6p1s0
 ifconfig br0 up
 ifconfig br0 192.168.110.1 netmask 255.255.0.0
 route add default gw 192.168.1.1


 echo nameserver 8.8.8.8 >> /etc/resolv.conf </pre>



<p>Run script, command brctl show will show how whether it configure property or not. </p>



<h2 class="wp-block-heading">Prepare QEMU image</h2>



<p>Ubuntu 18.04 cloud image is here</p>



<pre class="wp-block-preformatted">wget http://ftp.yzu.edu.tw/Linux/ubuntu-cloud-images/bionic/current/bionic-server-cloudimg-arm64.img</pre>



<p>and please refer this article to change cloud image&#8217;s password <br />Change Ubuntu Cloud Image Password, before use it, don&#8217;t forget to increase cloud image size. 20G is enough for test.</p>



<pre class="wp-block-preformatted">qemu-img resize bionic-server-cloudimg-arm64.img +20G</pre>



<p>Next step is to create bios and nvram for qemu image boot. </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>



<h2 class="wp-block-heading">Run Qemu</h2>



<p>Here is qemu command, save text below and run it </p>



<pre class="wp-block-preformatted"> IMAGE=bionic-server-cloudimg-arm64.img
 sudo qemu-system-aarch64 -name vm1 \
         -machine virt,gic_version=3,accel=kvm,usb=off \
         -cpu host -m 8192 \
         -smp 12,sockets=1,cores=12,threads=1 \
         -nographic -nodefaults \
         -pflash flash0.img -pflash flash1.img \
         -device vfio-pci,host=0001:01:00.0 \
         -device vfio-pci,host=0002:01:00.0 \
         -drive file=$IMAGE,if=none,id=disk1 \
         -device virtio-blk-device,scsi=off,drive=disk1,id=virtio-disk1,bootindex=1 \
         -netdev tap,id=net0,ifname=tap0 \
         -device virtio-net-device,netdev=net0 \
         -mem-path /mnt/hugepages \
         -serial telnet::9001,server,nowait > guest1_log.txt 2>> guest1_log.txt &amp;
 sleep 5
 brctl addif br0 tap0 </pre>



<p>-m 8192 : use 8G RAM for VM<br />&#8211;mem-path will use /mnt/hugepages for VM memory<br /><br />it will create a network device tap0 for bridge device interface between VM and host.  and create a telnet server on port 9001, it can use &#8220;telnet 9001&#8221; to get console, I would like to suggest to use ssh if it can access console. </p>



<h2 class="wp-block-heading">Remove cloudinit service</h2>



<p>it needs to remove cloud-initramfs-copymods, it will copy modules from ramdisk to harddriver, and cloud-init, it&#8217;s for some cloud service like aws(?)<br /><br />removed them would help system runs better. </p>



<pre class="wp-block-preformatted">apt remove cloud-initramfs-copymods cloud-init </pre>



<h2 class="wp-block-heading">Disable Services</h2>



<p>After boot, it needs to disable some default service to improve speed, here is some services can be disabled. (needs run those command with root)</p>



<pre class="wp-block-preformatted">systemctl disable ufw
systemctl disable lxcfs
systemctl disable atd
systemctl disable cron
systemctl disable irqbalance
systemctl disable apparmor
systemctl disable apport
systemctl disable ebtables
systemctl disable grub-common
systemctl disable unattended-upgrades
systemctl disable iscsid</pre>



<p>Most import service is irqbalance, without disable it, performance will be drop down. <br /><br />Now, it can reboot VM now. </p>



<h2 class="wp-block-heading">Prepare QEMU environment </h2>



<p>Prepare QEMU environment and prepare host almost the same, only differences are</p>



<ol class="wp-block-list"><li>in QEMU, apt install doesn&#8217;t needs to install qemu-efi and bridge-utils</li><li>in QEMU, before call dpdk-devbind command, it needs to configure enable_unsafe_noiommu_mode for ARM64 platform </li><li>Hugepage size is different , in HOST it uses 32G, in VM we uses 4G</li></ol>



<p>Enable unsafe noiommu </p>



<pre class="wp-block-preformatted">echo 1 &gt; /sys/module/vfio/parameters/enable_unsafe_*</pre>



<p> To permanently enable the no-IOMMU mode, add it to modprobe.d: (<a href="https://dpdk-guide.gitlab.io/dpdk-guide/setup/binding.html" target="_blank" rel="noopener">ref</a>) </p>



<pre class="wp-block-preformatted">echo "options vfio enable_unsafe_noiommu_mode=1" &gt; /etc/modprobe.d/vfio-noiommu.conf</pre>



<p>It also needs to reserve hugepages memory space for Linux kernel for VM, it reserves 4 pages and each pages 1GB, total 4GB. Please modify  /etc/default/grub , and  add hugepagesz=1GB hugepages=4 to GRUB_CMDLINE_LINUX, ex:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>GRUB_CMDLINE_LINUX=&#8221;console=tty0 hugepagesz=1GB hugepages=4&#8243;</p></blockquote>



<p>then run foloowing command to update grub.cfg</p>



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



<h2 class="wp-block-heading">Run DPDK  l3fwd</h2>



<p>Before run l3fwd, we need to recompile it. </p>



<pre class="wp-block-preformatted">. /usr/share/dpdk/dpdk-sdk-env.sh
make -C /usr/share/dpdk/examples/l3fwd</pre>



<p>Bind network interface</p>



<pre class="wp-block-preformatted">dpdk-devbind -b vfio-pci  enp0s1
dpdk-devbind -b vfio-pci  enp0s2</pre>



<p>Run l3fwd example</p>



<pre class="wp-block-preformatted">cd /usr/share/dpdk/examples/l3fwd/build
./l3fwd -c 1 -- -p 0x3 --config="(0,0,0),(1,0,0)"</pre>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="639" src="https://blog.richliu.com/wp-content/uploads/2019/08/image-1024x639.png" alt="" class="wp-image-4072" srcset="https://blog.richliu.com/wp-content/uploads/2019/08/image-1024x639.png 1024w, https://blog.richliu.com/wp-content/uploads/2019/08/image-300x187.png 300w, https://blog.richliu.com/wp-content/uploads/2019/08/image-768x479.png 768w, https://blog.richliu.com/wp-content/uploads/2019/08/image.png 1440w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>Multi Queue example</p>



<pre class="wp-block-preformatted">./l3fwd -l 1,2,3,4 -n 4 -- -p 0x3 --config="(0,0,1),(1,0,2),(0,1,3),(1,1,4)"</pre>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="715" src="https://blog.richliu.com/wp-content/uploads/2019/08/image-1-1024x715.png" alt="" class="wp-image-4073" srcset="https://blog.richliu.com/wp-content/uploads/2019/08/image-1-1024x715.png 1024w, https://blog.richliu.com/wp-content/uploads/2019/08/image-1-300x209.png 300w, https://blog.richliu.com/wp-content/uploads/2019/08/image-1-768x536.png 768w, https://blog.richliu.com/wp-content/uploads/2019/08/image-1.png 1438w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



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



<p>There is good tool to get hugepage information </p>



<pre class="wp-block-preformatted">apt install hugepages
hugeadm --pool-list</pre>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="865" height="130" src="https://blog.richliu.com/wp-content/uploads/2019/08/image-2.png" alt="" class="wp-image-4074" srcset="https://blog.richliu.com/wp-content/uploads/2019/08/image-2.png 865w, https://blog.richliu.com/wp-content/uploads/2019/08/image-2-300x45.png 300w, https://blog.richliu.com/wp-content/uploads/2019/08/image-2-768x115.png 768w" sizes="(max-width: 865px) 100vw, 865px" /></figure>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/08/19/4057/ubuntu-18-04-arm64-dpdk-in-vm-qemu/">Ubuntu 18.04 ARM64 DPDK in VM (QEMU)</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2019/08/19/4057/ubuntu-18-04-arm64-dpdk-in-vm-qemu/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>[virtualbox] ftdi_sio ttyUSB0: failed to get modem status: -110</title>
		<link>https://blog.richliu.com/2018/01/22/2203/virtualbox-ftdi_sio-ttyusb0-failed-to-get-modem-status-110/</link>
					<comments>https://blog.richliu.com/2018/01/22/2203/virtualbox-ftdi_sio-ttyusb0-failed-to-get-modem-status-110/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 22 Jan 2018 08:30:26 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[FTDI]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=2203</guid>

					<description><![CDATA[<p>環境是 Linux 下執行 VirtualBox 如果是使用 ftdi driver , 常常會在 Linux [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2018/01/22/2203/virtualbox-ftdi_sio-ttyusb0-failed-to-get-modem-status-110/">[virtualbox] ftdi_sio ttyUSB0: failed to get modem status: -110</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>環境是 Linux 下執行 VirtualBox</p>
<p>如果是使用 ftdi driver , 常常會在 Linux kernel 內出現</p>
<blockquote><p>ftdi_sio ttyUSB0: failed to get modem status: -110</p></blockquote>
<p>這個問題困擾我很久了, 解決方法是在系統內將 USB 2.0 的設定改成 USB 3.0, 如圖</p>
<p><a href="https://blog.richliu.com/wp-content/uploads/2018/01/20180122_ftdi_error.png"><img loading="lazy" decoding="async" class="aligncenter size-large wp-image-2204" src="https://blog.richliu.com/wp-content/uploads/2018/01/20180122_ftdi_error-1024x568.png" alt="" width="620" height="344" srcset="https://blog.richliu.com/wp-content/uploads/2018/01/20180122_ftdi_error-1024x568.png 1024w, https://blog.richliu.com/wp-content/uploads/2018/01/20180122_ftdi_error-300x166.png 300w, https://blog.richliu.com/wp-content/uploads/2018/01/20180122_ftdi_error-768x426.png 768w, https://blog.richliu.com/wp-content/uploads/2018/01/20180122_ftdi_error.png 1104w" sizes="(max-width: 620px) 100vw, 620px" /></a></p>
<p>這樣就可以解決問題了, 簡單吧.</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2018/01/22/2203/virtualbox-ftdi_sio-ttyusb0-failed-to-get-modem-status-110/">[virtualbox] ftdi_sio ttyUSB0: failed to get modem status: -110</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2018/01/22/2203/virtualbox-ftdi_sio-ttyusb0-failed-to-get-modem-status-110/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux Kernel 4.7 PPTP pass through issue</title>
		<link>https://blog.richliu.com/2016/09/02/2022/linux-kernel-pptp-pass-through-issue/</link>
					<comments>https://blog.richliu.com/2016/09/02/2022/linux-kernel-pptp-pass-through-issue/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 02 Sep 2016 02:48:09 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[nat]]></category>
		<category><![CDATA[pptp]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=2022</guid>

					<description><![CDATA[<p>升級到 Linux kernel 4.7 之後, 突然 PPTP pass through 有問題. 有人提供 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/09/02/2022/linux-kernel-pptp-pass-through-issue/">Linux Kernel 4.7 PPTP pass through issue</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>升級到 Linux kernel 4.7 之後, 突然 PPTP pass through 有問題.<br />
有人提供了解決方案</p>
<p>在 /etc/sysctl.conf 加上</p>
<pre lang="text">
net.netfilter.nf_conntrack_helper=1
</pre>
<p>這樣就可以了, 不知道為什麼預設值改了.<br />
ref.<br />
<a href="https://bugzilla.kernel.org/show_bug.cgi?id=152101" target="_blank" rel="noopener">Bug 152101 &#8211; Updating from 4.6.4 to 4.7 breaks &#8220;pptp pass through&#8221;</a></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/09/02/2022/linux-kernel-pptp-pass-through-issue/">Linux Kernel 4.7 PPTP pass through issue</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2016/09/02/2022/linux-kernel-pptp-pass-through-issue/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>SIGALARM / timer_create 造成 CPU sys 100% 的問題</title>
		<link>https://blog.richliu.com/2016/09/01/2002/sigalarm-timer_create-%e9%80%a0%e6%88%90-cpu-sys-100-%e7%9a%84%e5%95%8f%e9%a1%8c/</link>
					<comments>https://blog.richliu.com/2016/09/01/2002/sigalarm-timer_create-%e9%80%a0%e6%88%90-cpu-sys-100-%e7%9a%84%e5%95%8f%e9%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 01 Sep 2016 10:19:27 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[epoll]]></category>
		<category><![CDATA[pthread]]></category>
		<category><![CDATA[sigalrm]]></category>
		<category><![CDATA[timer_create]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=2002</guid>

					<description><![CDATA[<p>最近遇到一個怪問題, 某一隻程式跑起來的時候, 有一定的機率 sys 佔有率是 100% Cpu0  :  0 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/09/01/2002/sigalarm-timer_create-%e9%80%a0%e6%88%90-cpu-sys-100-%e7%9a%84%e5%95%8f%e9%a1%8c/">SIGALARM / timer_create 造成 CPU sys 100% 的問題</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>最近遇到一個怪問題, 某一隻程式跑起來的時候, 有一定的機率 sys 佔有率是 100%</p>
<blockquote><p>Cpu0  :  0.0%us,<span style="color: #ff0000;">100.0%sy</span>,  0.0%ni,  0.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st</p></blockquote>
<p><span id="more-2002"></span></p>
<p>原來的 code 長的像是這樣</p>
<pre lang="c">#include <time .h>
#include <stdio .h>
#include <errno .h>
#include <stdlib .h>
#include <string .h>
#include <signal .h>
#include <unistd .h>
#include <pthread .h>


#ifdef USE_SEM
sem_t g_timer_sem_hdlr;
#endif


void  sig_timer_hanler(void)
{
#ifdef USE_SEM
	sem_post(&amp;g_timer_sem_hdlr);
#endif
	return ;
}

void main(){

unsigned int period=1000;
	struct itimerval it_val;	/* for setting itimer */
	int i=0;
#ifdef USE_SEM
	sem_init(&amp;g_timer_sem_hdlr,1,0);
#endif

	if (signal(SIGALRM, (void (*)(int)) sig_timer_hanler) == SIG_ERR)
	{
		perror("Unable to catch SIGALRM");
		return ;
	}
	it_val.it_value.tv_sec =  0;
	it_val.it_value.tv_usec = period;
	it_val.it_interval = it_val.it_value;
	if (setitimer(ITIMER_REAL, &amp;it_val, NULL) == -1)
	{
		perror("error calling setitimer()");
		return ;
	}
	printf("test started.\n");
	while(1){
#ifdef USE_SEM
		sem_wait(&amp;g_timer_sem_hdlr);
#else
		usleep(1000);
#endif
		if((i%1000)==0) printf("%s: hello, i=%d\n",__func__,i);
		i++;
	}
	printf("exited.\n");
	return ;
}
</pthread></unistd></signal></string></stdlib></errno></stdio></time></pre>
<p>如果用 perf 下去看, 大概長得像這樣,  kernel space 的 wait 不是真正的 wait</p>
<pre lang="text">   
66.86%  swapper  [kernel.kallsyms]  [k] r4k_wait
        |
        --- r4k_wait
        cpu_idle

32.21%    test  test               [.] main
0.12%     test  [kernel.kallsyms]  [k] finish_task_switch
        |
        --- finish_task_switch
        |
        |--54.54%-- __schedule
        |          schedule
        |          |
        |          |--83.34%-- work_resched
        |          |
        |           [--16.66%-- schedule_timeout
        |                     do_sigtimedwait
        |                     SyS_rt_sigtimedwait
        |                     handle_sys64
        |
        --45.46%-- schedule_tail
</pre>
<p>打開 kernel spin lock stat 也看不出所以然來(註: 上面是 100% sys cpu 的, 下面是正常的</p>
<p><div id="attachment_2003" style="width: 310px" class="wp-caption aligncenter"><a href="https://blog.richliu.com/wp-content/uploads/2016/08/spinlock.png"><img loading="lazy" decoding="async" aria-describedby="caption-attachment-2003" class="size-medium wp-image-2003" src="https://blog.richliu.com/wp-content/uploads/2016/08/spinlock-300x145.png" alt="spinlock" width="300" height="145" srcset="https://blog.richliu.com/wp-content/uploads/2016/08/spinlock-300x145.png 300w, https://blog.richliu.com/wp-content/uploads/2016/08/spinlock-768x371.png 768w, https://blog.richliu.com/wp-content/uploads/2016/08/spinlock-1024x495.png 1024w" sizes="(max-width: 300px) 100vw, 300px" /></a><p id="caption-attachment-2003" class="wp-caption-text">spinlock</p></div></p>
<p>所以這就讓人很困擾, 到底出了什麼問題<br />
做過一些測試, 例如:<br />
Enable Realtime option , 改用 tickless or 1000HZ tick , 檢查 spin lock deadlock ,<br />
叫出 Sysrq 出來看(看不出來有什麼特別的)<br />
不過仍然會發生, 百思不得其解.</p>
<p>除了自己的 Embedded System , 連 Ubuntu PC 也可以複製的出來,<br />
所以這就排除了 SoC vendor 的問題, 理論上我們的應用不是特別奇怪.<br />
所以心中訥悶, 這世界上這麼多人只有我們有問題嗎?</p>
<p>關於這個問題的人討論的很少, 所以可能要多翻一下 Google , 多濾一些關鍵字.</p>
<p>直到翻到這個網站, <a href="https://nativeguru.wordpress.com/2015/02/19/why-you-should-avoid-using-sigalrm-for-timer/" target="_blank" rel="noopener">WHY YOU SHOULD AVOID USING SIGALRM FOR TIMER</a><br />
他的說法是</p>
<blockquote><p>The problem occurs when the signal function is triggered just before we call setitimer().<br />
The signal handler blocks, as the mutex is currently being held by do_timer_bookkeeping() and this is the deadlock.</p></blockquote>
<p>不過我們沒有 deadlock , 但是他的發想很好, 仍然可以參考他講的去做</p>
<blockquote><p>To fix it, I removed all the SIGALRM code and replaced it with setitimer.<br />
I set the previous SIGALRM handler as the thread that will be spawned whenever the timer expired.</p></blockquote>
<p>看起來是好主義</p>
<p>所以我就用 timer_create 改寫了一下這隻程式,<br />
好的事情是, 情況有改善, 不會在 10 分鐘就發生,<br />
壞的事情是, 仍然會發生. 雖然極難複製這個問題, 但是會發生就是很討厭, 會留一個尾巴沒有辦法收尾.</p>
<p>所以持續在看有沒有其他的解決方案.<br />
(timer_create 的寫法可以參考<a href="https://wirelessr.gitbooks.io/working-life/content/linux_timer.html" target="_blank" rel="noopener"> Linux timer</a>)</p>
<p>中間有翻到 pthread 的 sigmask 用 thread 處理 SIGALRM 訊號,<br />
不過多想一下, 個人認為應該也會踏到同樣的問題, 所以做完功課之後, 這個方式晚一點再說.</p>
<p>又翻到這一篇<a href="http://stackoverflow.com/questions/2586926/setitimer-sigalrm-multithread-process-linux-c" target="_blank" rel="noopener">setitimer, SIGALRM &amp; multithread process (linux, c) </a>其中有說到,</p>
<blockquote><p>In the topic, Andi Kleen (Intel) <a href="https://lkml.org/lkml/2010/4/11/81" rel="nofollow noopener" target="_blank">recommends to switch to</a> &#8220;<em>POSIX timers (<a href="http://pubs.opengroup.org/onlinepubs/7908799/xsh/timer_create.html" rel="nofollow noopener" target="_blank"><code>timer_create</code></a>)</em>&#8220;; and in <a href="https://lkml.org/lkml/2010/4/11/92" rel="nofollow noopener" target="_blank">ML thread</a> Davide Libenzi suggests use of <code>timerfd</code> (timerfd_create, timerfd_settime) on non-ancient Linuxes.</p></blockquote>
<p>答案就呼之欲出了, 要改用 timerfd 改寫我目前的 timer_create.<br />
不過 timerfd 是 trigger fd 用的, 不會呼叫 call back function, 所以要配合 epoll 用, 而且 epoll 是 IO event trigger , 所以要配合 pthread 去處理 epoll .</p>
<p>程式改寫完的結果, 看起來效能比 SIGALRM / timer_create 好. 但是複雜許多, 有<del>抄</del>參考別人的 sample code ,<br />
不過考量這些 code 要處理 multiple fd, 而我目地只是取代原來的 SIGALRM, 所以又再更精簡化, 一般會更複雜的.</p>
<p>程式碼</p>
<pre lang="C">#include <stdio .h>
#include <stdlib .h>
#include <sys /time.h>
#include <pthread .h>
#include <semaphore .h>
#include <signal .h>
#include <unistd .h>
#include <time .h>
#include <sys /epoll.h>
#include </sys><sys /timerfd.h>


sem_t g_timer_sem_hdlr;
int timerfd;
pthread_t sig_thread;

#define MAX_EVENT 4

static int      epfd = -1;
static struct   epoll_event events ;
static int      sig_timer;
static struct itimerspec        its;
static struct epoll_event      ev;


void *sig_epoll_wait( void *ptr){
    int numEvent=0;
    unsigned long value;
    struct event_record *pevent = NULL;
    int i;

    while(1){
        numEvent = epoll_wait( epfd, &amp;events,1 , -1 );

        for( i=0; i &lt; numEvent ; i++){

            if( epoll_ctl( epfd, EPOLL_CTL_DEL, timerfd, &amp;ev) == -1)
                perror("[1] epoll_ctl del");

            if(timerfd_settime( timerfd, 0, &amp;its, NULL ) == -1 )
                perror("[1] timerfd_settime");

            if( epoll_ctl( epfd, EPOLL_CTL_ADD, timerfd, &amp;ev) == -1)
                perror("[1] epoll_ctl add");
            sem_post(&amp;g_timer_sem_hdlr);
        }
    }

    return NULL;
}

void create_timer(int sig, int msec)
{

    timerfd = timerfd_create(CLOCK_MONOTONIC, 0);
    if( timerfd == -1)
        perror("timerfd_create");

    its.it_value.tv_sec = 0;
    its.it_value.tv_nsec = msec * 1000000;
    its.it_interval.tv_sec = its.it_value.tv_sec;
    its.it_interval.tv_nsec = its.it_value.tv_nsec;

    if ( timerfd_settime( timerfd, 0, &amp;its, NULL ) == -1 )
        perror( "timerfd_settime" );

    // Create epoll
    epfd = epoll_create( 1 );
    if ( epfd == -1 )
        perror(" epoll_create ");

    ev.data.ptr = &amp;sig_timer;
    ev.events   = EPOLLIN | EPOLLET;

    // enable epoll

    if( epoll_ctl( epfd, EPOLL_CTL_ADD, timerfd, &amp;ev) == -1)
        perror("[0] epoll_ctl");

    // Create Thread
    pthread_create(&amp;sig_thread, NULL , sig_epoll_wait , NULL);

}

void main(){
    int i=0;
    sem_init(&amp;g_timer_sem_hdlr,1,0);

    printf("Create Timer \n");
    create_timer(5566, 5);  // ms
    while(1){
        sem_wait(&amp;g_timer_sem_hdlr);
        if((i%10000)==0) printf("%s: hello, i=%d\n",__func__,i);
        i++;
    }
    printf("exited.\n");
    return ;
}


</sys></time></unistd></signal></semaphore></pthread></sys></stdlib></stdio></pre>
<p>其他有些資訊是提到 top 計算不準的問題</p>
<p>https://www.kernel.org/doc/Documentation/cpu-load.txt<br />
https://lkml.org/lkml/2007/2/12/6</p>
<p>ref.</p>
<ul>
<li><a href="https://github.com/seiyak/ssebot-samples/blob/master/sample-timerfd-epoll.c" target="_blank" rel="noopener">Linux FD Handler 以及 Timer 機制</a></li>
<li><a href="https://github.com/seiyak/ssebot-samples/blob/master/sample-timerfd-epoll.c" target="_blank" rel="noopener">ssebot-samples/sample-timerfd-epoll.c : </a>這 code 寫的不錯, 主要是學習這個的.</li>
</ul>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/09/01/2002/sigalarm-timer_create-%e9%80%a0%e6%88%90-cpu-sys-100-%e7%9a%84%e5%95%8f%e9%a1%8c/">SIGALARM / timer_create 造成 CPU sys 100% 的問題</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2016/09/01/2002/sigalarm-timer_create-%e9%80%a0%e6%88%90-cpu-sys-100-%e7%9a%84%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Disable You Have New Mail</title>
		<link>https://blog.richliu.com/2016/04/23/1947/disable-you-have-new-mail/</link>
					<comments>https://blog.richliu.com/2016/04/23/1947/disable-you-have-new-mail/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 23 Apr 2016 15:05:35 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[login]]></category>
		<category><![CDATA[mail]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=1947</guid>

					<description><![CDATA[<p>每次 Login 都有這個小視窗, 非常討厭 編輯 /etc/pam.d/system-login Mark  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/04/23/1947/disable-you-have-new-mail/">Disable You Have New Mail</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>每次 Login 都有這個小視窗, 非常討厭</p>
<p>編輯 /etc/pam.d/system-login<br />
Mark 掉以下這一行就可以<br />
#session                optional        pam_mail.so</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2016/04/23/1947/disable-you-have-new-mail/">Disable You Have New Mail</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2016/04/23/1947/disable-you-have-new-mail/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>CentOS 5.9 x64 + T420s Xorg crash problem.</title>
		<link>https://blog.richliu.com/2014/08/28/1644/centos-5-9-x64-t420s-xorg-crash-problem/</link>
					<comments>https://blog.richliu.com/2014/08/28/1644/centos-5-9-x64-t420s-xorg-crash-problem/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 28 Aug 2014 05:11:31 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[Xorg]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1644</guid>

					<description><![CDATA[<p>OS CentOS 5.9 x64 NB: Thinkpad T420s Xorg.0.log == (II) [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2014/08/28/1644/centos-5-9-x64-t420s-xorg-crash-problem/">CentOS 5.9 x64 + T420s Xorg crash problem.</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>OS CentOS 5.9 x64<br />
NB: Thinkpad T420s </p>
<p>Xorg.0.log<br />
==<br />
(II) Module ddc: vendor=&#8221;X.Org Foundation&#8221;<br />
        compiled for 7.1.1, module version = 1.0.0<br />
        ABI class: X.Org Video Driver, version 1.0<br />
(II) VESA(0): VESA VBE DDC supported<br />
(II) VESA(0): VESA VBE DDC Level none<br />
(II) VESA(0): VESA VBE DDC transfer in appr. 0 sec.<br />
(II) VESA(0): VESA VBE DDC read failed<br />
(II) VESA(0): VESA VBE PanelID read successfully<br />
(II) VESA(0): PanelID returned panel resolution 1600&#215;900</p>
<p>Backtrace:<br />
0: X(xf86SigHandler+0x71) [0x4868d1]<br />
1: /lib64/libc.so.6 [0x2b64029a72d0]<br />
2: /usr/lib64/xorg/modules/drivers/vesa_drv.so [0x2b6404b3ef09]<br />
3: X(InitOutput+0x9cd) [0x46431d]<br />
4: X(main+0x26f) [0x4335ef]<br />
5: /lib64/libc.so.6(__libc_start_main+0xf4) [0x2b64029949c4]<br />
6: X(FontFileCompleteXLFD+0x241) [0x432aa9]</p>
<p>Fatal server error:<br />
Caught signal 11.  Server aborting<br />
==</p>
<p>Solution:<br />
 $ yum install fonts-chinese.noarch</p>
<p>Why, I don&#8217;t know. </p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2014/08/28/1644/centos-5-9-x64-t420s-xorg-crash-problem/">CentOS 5.9 x64 + T420s Xorg crash problem.</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2014/08/28/1644/centos-5-9-x64-t420s-xorg-crash-problem/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] 電腦升級案 32bit -&gt; 64bit Linux</title>
		<link>https://blog.richliu.com/2013/12/26/1583/gentoo-%e9%9b%bb%e8%85%a6%e5%8d%87%e7%b4%9a%e6%a1%88-32bit-64bit-linux/</link>
					<comments>https://blog.richliu.com/2013/12/26/1583/gentoo-%e9%9b%bb%e8%85%a6%e5%8d%87%e7%b4%9a%e6%a1%88-32bit-64bit-linux/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 26 Dec 2013 15:44:19 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[4670t]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[gpt]]></category>
		<category><![CDATA[H87]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[Raid]]></category>
		<category><![CDATA[usb]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[安裝]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1583</guid>

					<description><![CDATA[<p>最近發現有一台電腦己經有點舊了, 首先是電源供應器的風扇掛了, 這個電源供應該應該有十年了, 印像中還沒有支援 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2013/12/26/1583/gentoo-%e9%9b%bb%e8%85%a6%e5%8d%87%e7%b4%9a%e6%a1%88-32bit-64bit-linux/">[Gentoo] 電腦升級案 32bit -&gt; 64bit Linux</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>最近發現有一台電腦己經有點舊了, 首先是電源供應器的風扇掛了, 這個電源供應該應該有十年了, 印像中還沒有支援新的 ATX 接頭, 當年好像是用很便宜的價格從瘋狂賣客買的.<br />
將電源風扇換成磁浮風扇之後, 似乎有好一點, 不過問題是, 很難開機, 還好這一台是一開就不關的 Server.<br />
但是最近工作型態改變, 而且我買了一個瓦特計(像<a href="http://smallpig01.blogspot.tw/2011/12/wanf-wf-d02a.html" target="_blank" rel="noopener">這樣</a>), 沒事就在量電腦的電量. 發現常常使用的測試用電腦瓦特數非常高, Intel Q6600 + ATI 4850 要耗用 200W 左右.</p>
<p>所以最近就在找下一代的解決方案. 目標高效低功耗PC.<br />
<span id="more-1583"></span><br />
接下來是新電腦清單<br />
CPU: <a href="http://ark.intel.com/zh-TW/products/75050/intel-core-i5-4670t-processor-6m-cache-up-to-3_30-ghz" target="_blank" rel="noopener">Intel i5-4670T 45W</a></p>
<p style="padding-left: 30px;">本來有考慮 <a href="http://ark.intel.com/zh-TW/products/75045/intel-core-i5-4570t-processor-4m-cache-up-to-3_60-ghz" target="_blank" rel="noopener">Intel i5-4570T</a>, Max TDP 少 10W, 但是速度比較快, 後來想想, 如果要 Multi-Thread 編 Code , 還要跑 VM 的話, 還是多核好一點. 所以後來就選 4670T. 不管是 4570T/4670T, 台灣都買不到, 只有向淘寶購物, 這也是我第一次跑去淘寶買東西. 不過搞進來花了不少時間, 不清楚轉運規則呀(而且淘寶網頁流程也寫的不清楚, 轉運公司更是複雜, 搞好久才知道原來洶寶上的電話才是該打的電話, 轉運公司的客服無法處理國際單). 弄進來這顆 CPU 是 QS 版, 雖然不是 ES 版(<a href="http://blog.yam.com/geniusoffice0716/article/59728220" target="_blank" rel="noopener">QS/ES差別</a>), 但是還是有點悶. (購入價是比 Tray 低一點啦, 4570T 有 BOX 價, 一般人可以考慮買這個). TRAY 的缺點是沒有風扇, 還好我之前有不小心多買一套 CPU 風扇, 所以將就著用&#8230;&#8230; Intel 為什麼不出 BOX 版&#8230; -_-!</p>
<p style="padding-left: 30px;">另外, 4670T 那個 Up To 3.3G 是指只開1核時, TurboBoost 可以到 3.3G, 四核全開只能到 2.9G. (我也被搞混一陣子過, 所以現在清楚了).<br />
詳情可以看這個網頁 <a href="http://www.intel.com/support/processors/corei5/sb/CS-032278.htm" target="_blank" rel="noopener">Intel® Core<img src="https://s.w.org/images/core/emoji/15.0.3/72x72/2122.png" alt="™" class="wp-smiley" style="height: 1em; max-height: 1em;" /> i5 Desktop Processor Turbo boost frequency table</a><br />
BIOS 還是有可以調整的選項, 我猜四核要跑 3.3G 也是可以, 只是 TDP 就不是 45W 了, Max TDP BIOS 內也可以調整(驚!!).</p>
<p>MotherBoard: <a href="https://www.google.com.tw/search?q=gigabyte+H87-D3H&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t" target="_blank" rel="noopener">Gigabyte H87-D3H</a></p>
<p style="padding-left: 30px;">之前某一次用 ASUS 接 HDMI 還是 DVI 輸出有問題, 沒有辦法正確判斷電視種類, 但是 Gigabyte 的主機板 OK, 之後就都換 Gigabyte 的, 目前二塊在我手上還活的好好的, 所以第三塊還是用 Gigabyte 的. 也沒有特別的理由. 選這塊的原因是因為內建 Intel 網卡. 不過電腦機殼就只能選 ATX 了.</p>
<p>Power: 海韻 S12G 450W 金牌</p>
<p style="padding-left: 30px;">我承認我選 Power 就是看那家貨比較齊全就買那家的, 金牌 450W 很難選, 生產的不多, 這個也沒有模組化, 不過我用過模組化的 Power , 又不是會飛天會唱歌, 所以有和沒有都 OK. 至於金牌和銅牌的論述就算了, 我自己拿來做 Server 的, 省個 5% 也高興, 反正金牌和銅牌沒有差很多, 就當買心理因素吧 XD.</p>
<p>Case : <a href="http://www.coolermaster.com/product/Detail/case/mid-tower/silencio-550.html" target="_blank" rel="noopener">Cooler Master Silencio 550</a></p>
<p style="padding-left: 30px;">上一個 Case 是買 Antec 的 P280 靜音機殼, 其實沒有感覺很安靜. 比較起來, CM 550 用料和 P280 各有優缺點, 很難說誰好誰不好, 不過CM 550 有一個 SATA 插槽, 這個還不錯, 可以拿來 hot-plug 用. 硬碟是橫置, 免螺絲, 不過還是要拆背蓋才能裝 Power 和 Cable. 這樣設計沒有比較好, OK?<br />
不過我的 Antec P280 有一個墊子壞了, 寫信問代理商沒有回, 丟 FB 也還沒有回&#8230; 呃. 希望 CM 會好一點. 對了, CM 多一個 SD 插槽, Linux 下抓的到, 算是加分吧.</p>
<p>記憶體 : 用舊的KingSton DDR3-1067 (省錢 XD)</p>
<p>HDD : Seagate NAS 64M ST3000VN000</p>
<p style="padding-left: 30px;">3T 的硬碟要搞開機有點麻煩. 不過還是要用.</p>
<p>花了一些功夫的成果照<br />
<iframe loading="lazy" src="https://www.flickr.com/photos/richliu_tw/11564910116/player/23248c6758" width="281" height="500" frameborder="0" allowfullscreen="allowfullscreen"></iframe></p>
<p>接下來來是 Gentoo 安裝心得, 各位可以 END 看最後面了.</p>
<p>在做完了基本的 memory test 之後, 接下來就是開始安裝 Gentoo.<br />
*) Use Legacy BIOS<br />
首先第一件事情, 強迫BIOS使用 Legacy BIOS, UEFI 貌似也可以用, 不過我並不打算花時間研究這個, 而且這一台電腦並沒有要裝 Windows. (剛想到, 以前都拿舊電腦裝 Linux, 現在買新的裝 Linux. 十年河東十年河西呀&#8230;)</p>
<p>因為這次是要安裝 64Bit Linux, 所以是拿 kubuntu 13.10 x64 版開機.<br />
(P.S 這不是安裝手冊, 所以我只會記錄我覺得重要的部份).</p>
<p>*) Booting Disk.<br />
如何讓 BIOS 認到 3T 的硬碟是最重要的, 要安裝套件 gdisk 取代 fdisk. 忘了 parted 吧, 那是給 geek 用的 (誤)<br />
# apt-get install gdisk<br />
這時候還是用 kubuntu 哦&#8230;.</p>
<p>重點<br />
1) 要切一個 1M Partition 給 UEFI 用(我有預留,不確定不留可不可以)<br />
2) 沒有 Primary Partition 的概念了.<br />
3) Partition Code 不一樣, 第一個 Partition ID 是 EF02, Linux Raid 是 FD00</p>
<p>系統切四個, UEFI, System , Data, Swap , 看起來像這樣</p>
<p style="padding-left: 30px;">Disk /dev/sda: 5860533168 sectors, 2.7 TiB<br />
Logical sector size: 512 bytes<br />
Disk identifier (GUID): 601175B7-D96A-4316-AA27-856D195717F4<br />
Partition table holds up to 128 entries<br />
First usable sector is 34, last usable sector is 5860533134<br />
Partitions will be aligned on 2048-sector boundaries<br />
Total free space is 2014 sectors (1007.0 KiB)</p>
<p style="padding-left: 30px;">Number Start (sector) End (sector) Size Code Name<br />
1 2048 4095 1024.0 KiB EF02 BIOS boot partition<br />
2 4096 209719295 100.0 GiB FD00 Linux RAID<br />
3 209719296 5830086655 2.6 TiB FD00 Linux RAID<br />
4 5830086656 5860533134 14.5 GiB FD00 Linux RAID</p>
<p>接下來將 sda 的 partition copy 到 sdb 去<br />
# sgdisk -R=/dev/sdb /dev/sda<br />
重新亂數產生 sdb 的 UUID<br />
# sgdisk -G /dev/sdb<br />
大功告成, 接下來就可以檢查 sdb , 沒有問題之後就可以建 Raid 了.</p>
<p>Ref:<br />
<a class="smarterwiki-linkify" href="http://en.wikipedia.org/wiki/BIOS_Boot_Partition_%28GPT%29" target="_blank" rel="noopener">http://en.wikipedia.org/wiki/BIOS_Boot_Partition_%28GPT%29</a><br />
<a class="smarterwiki-linkify" href="http://forums.funtoo.org/viewtopic.php?pid=9944" target="_blank" rel="noopener">http://forums.funtoo.org/viewtopic.php?pid=9944</a></p>
<p>*) Create Raid / Format Disk<br />
可以參考我自己以前寫的文章(<a href="http://blog.richliu.com/2011/05/16/1078/" target="_blank">Linux Software Raid 系統轉移</a>)<br />
# modprobe raid1<br />
# apt-get install mdadm<br />
GRUB2 開機一定要 0.90 的 raid partition, 我沒有找到用新版也可以的文章, 不想賭人品.<br />
# mdadm &#8211;create /dev/md1 -l 1 -n 2 &#8211;metadata=0.90 /dev/sda2 missing<br />
其他不用應該沒關係.<br />
# mdadm &#8211;create /dev/md2 -l 1 -n 2 /dev/sda3 missing<br />
# mdadm &#8211;create /dev/md3 -l 1 -n 2 /dev/sda4 missing</p>
<p>先建一顆, 等到去睡覺的時候再 Sync .</p>
<p>Grub 1.97 之後有支援 ext4, 不過在 grub 內的 module name 還是叫 ext2.mod .<br />
# mkfs.ext4 /dev/md1<br />
# mkfs.ext4 /dev/md2<br />
# mkswap /dev/md3</p>
<p>* ) Download Gentoo stage3 x64 from server<br />
<a class="smarterwiki-linkify" href="ftp://ftp.twaren.net/Linux/Gentoo/releases/amd64/current-stage3" target="_blank" rel="noopener">ftp://ftp.twaren.net/Linux/Gentoo/releases/amd64/current-stage3</a></p>
<p>* ) Modify Gentoo Configure</p>
<p># mount &#8211;bind /proc proc<br />
# mount &#8211;bind /sys sys<br />
# mount &#8211;bind /dev dev<br />
# chroot disk</p>
<p>modify /etc/portage/make.conf<br />
# nano /etc/portage/make.conf</p>
<p>GENTOO_MIRRORS=&#8221;<br />
<a class="smarterwiki-linkify" href="ftp://ftp.twaren.net/Linux/Gentoo" target="_blank" rel="noopener">ftp://ftp.twaren.net/Linux/Gentoo</a><br />
<a class="smarterwiki-linkify" href="http://gentoo.oregonstate.edu" target="_blank" rel="noopener">http://gentoo.oregonstate.edu</a><br />
<a class="smarterwiki-linkify" href="ftp://ftp.nsysu.edu.tw/Unix-like/Gentoo/" target="_blank" rel="noopener">ftp://ftp.nsysu.edu.tw/Unix-like/Gentoo/</a><br />
&#8221;</p>
<p>SYNC=&#8221;rsync://rsync.tw.gentoo.org/gentoo-portage&#8221;</p>
<p>MAKEOPTS=&#8221;-j5&#8243;</p>
<p><a class="smarterwiki-linkify" href="https://wiki.gentoo.org/wiki/AMD64/FAQ" target="_blank" rel="noopener">https://wiki.gentoo.org/wiki/AMD64/FAQ</a></p>
<p># echo &#8220;nameserver 8.8.8.8&#8243; &gt; /etc/resolv.conf<br />
# emerge sync</p>
<p>修改 /etc/fstab<br />
用 blkid dump 出來之後, 填到 fstab 去<br />
# blkid<br />
# vim /etc/fstab<br />
/dev/md1: UUID=&#8221;a12d45e4-3eab-4f12-ba6a-111111111111&#8243; TYPE=&#8221;ext4&#8243;<br />
/dev/md2: UUID=&#8221;a34bb49d-6ecd-4f34-8a1b-222222222222&#8243; TYPE=&#8221;ext4&#8243;<br />
/dev/md3: UUID=&#8221;856c43d9-00ef-4756-9732-333333333333&#8243; TYPE=&#8221;swap&#8221;</p>
<p>After installation edit /etc/default/grub:</p>
<p>GRUB_CMDLINE_LINUX_DEFAULT=&#8221;root=/dev/md1 real_root=/dev/md1 rootfstype=ext4 net.ifnames=0&#8243;<br />
有人說加 domdadm, 不過對我沒有用, net.ifnames=0 就是用傳統的 ethernet 命名方式, 要不然 Gentoo 又要用 PredictableNetworkInterfaceNames 了.<br />
我覺得這個超麻煩的, 雖然安全一點, 不過我不喜歡.<br />
Ref. <a class="smarterwiki-linkify" href="http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/" target="_blank" rel="noopener">http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/</a></p>
<p># ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules<br />
另一種 Disable PredictableNetworkInterfaceNames 的方式</p>
<p>我後來在 Kernel 內有看到 Predictable Network Interface Name 的選項, 早知道後來要改很多次 Kernel , 就直接在 Kernel compile 時閹了它.</p>
<p>setlocale: LC_ALL: cannot change locale (zh_TW.UTF-8)<br />
解法參考：<a class="smarterwiki-linkify" href="http://ubuntuforums.org/showthread.php?t=1471876" target="_blank" rel="noopener">http://ubuntuforums.org/showthread.php?t=1471876</a></p>
<p>vim /etc/locale-gen<br />
add<br />
zh_TW UTF-8<br />
zh_TW.UTF-8 UTF-8</p>
<p>than<br />
# locale-gen</p>
<p>*) Install GRUB<br />
如果在 install GRUB 時有看到奇怪的字串像是<br />
Path `/boot/grub&#8217; is not readable by GRUB on boot.<br />
記得要裝 mdadm 才會正常</p>
<p># emerge mdadm<br />
兩個目錄一樣<br />
# ln -sf /boot/grub /boot/grub2<br />
# grub2-mkconfig -o /boot/grub2/grub.cfg<br />
# grub2-install /dev/sda<br />
# grub2-install /dev/sdb</p>
<p>如果有裝完 mdadm, grub 應該安全就沒有問題了</p>
<p>*) Linux Kernel<br />
RTC 和 USBSerial 相關的 Driver 要裝一裝.</p>
<p>如果要讓 lm_sensor 可以正常運作, it87 module 要 install<br />
所以要 edit /etc/conf.d/modules , 加上.<br />
modules=&#8221;it87 intel-agp nf_nat_pptp nf_nat_proto_gre&#8221;</p>
<p>*) X<br />
這是一個神奇的經驗, 我第一次知道原來 X 是不用設定任何東西的.<br />
首先按照<br />
<a class="smarterwiki-linkify" href="https://wiki.gentoo.org/wiki/Xorg/Configuration" target="_blank" rel="noopener">https://wiki.gentoo.org/wiki/Xorg/Configuration</a><br />
在 Kernel 加上<br />
[TEXT]<br />
&lt; *&gt; Intel 8xx/9xx/G3x/G4x/HD Graphics<br />
[*] Enable modesetting on intel by default<br />
[/TEXT]<br />
這選項非常重要.</p>
<p>edit /etc/portage/package.use<br />
加上<br />
x11-drivers/xf86-video-intel dri glamor sna udev uxa xvmc<br />
全開就對了.<br />
然後 X 就莫名奇妙的動起來了 (什麼 O_O)</p>
<p>*) MySQL ==&gt; MariaDB</p>
<p>MariaDB 是從 MySQL Fork 出來的 Project .<br />
<a class="smarterwiki-linkify" href="http://en.wikipedia.org/wiki/MariaDB" target="_blank" rel="noopener">http://en.wikipedia.org/wiki/MariaDB</a></p>
<p>大家都知道, MySQL 自從被 Oracle 拿到之後, 就千方百計的想要消滅它.<br />
不過這也無可厚非, business is business.</p>
<p>這邊就是直接搬 mysql db 過去, 用 mysql_upgrade 升級<br />
不過這邊有一個問題, mysql 自己的 innodb 似乎升不過去,<br />
可能要用 mysql_dump , 我自己那些 db 都是不重要的, 所以就&#8230;&#8230;</p>
<p># /etc/init.d/mysql stop<br />
# emerge -1 mariadb<br />
# /etc/init.d/mysql start<br />
# mysql_upgrade -u root -p<br />
# mysqlcheck &#8211;repair &#8211;all-databases -u root -p</p>
<p>Ref:<br />
<a class="smarterwiki-linkify" href="http://od-eon.com/blogs/stefan/migrating-from-mysql-to-mariadb-on-gentoo/" target="_blank" rel="noopener">http://od-eon.com/blogs/stefan/migrating-from-mysql-to-mariadb-on-gentoo/</a></p>
<p>*) Samba<br />
smbpasswd 不能用了<br />
改用<br />
pdbedit -a -u user<br />
加入<br />
選項與參數：<br />
-L ：列出目前在資料庫當中的帳號與 UID 等相關資訊；<br />
-v ：需要搭配 -L 來執行，可列出更多的訊息，包括家目錄等資料；<br />
-w ：需要搭配 -L 來執行，使用舊版的 smbpasswd 格式來顯示資料；<br />
-a ：新增一個可使用 Samba 的帳號，後面的帳號需要在 /etc/passwd 內存在者；<br />
-r ：修改一個帳號的相關資訊，需搭配很多特殊參數，請 man pdbedit；<br />
-x ：刪除一個可使用 Samba 的帳號，可先用 -L 找到帳號後再刪除；<br />
-m ：後面接的是機器的代碼 (machine account)，與 domain model 有關！</p>
<p><a class="smarterwiki-linkify" href="http://linux.vbird.org/linux_server/0370samba.php" target="_blank" rel="noopener">http://linux.vbird.org/linux_server/0370samba.php</a></p>
<p>*) radvd<br />
如果有出現<br />
&#8220;radvd could not daemonize&#8221;<br />
建 radvd 的 /var/run/radvd 並且 chown radvd .</p>
<p>*) cacti<br />
抓自身的 snmp 要用 127.0.0.1 , 不能用 localhost .<br />
編輯 /etc/portage/package.use<br />
net-analyzer/net-snmp lm_sensors diskio ucd-compat netlink</p>
<p>Ref:<br />
<a class="smarterwiki-linkify" href="http://forums.cacti.net/about15067.html" target="_blank" rel="noopener">http://forums.cacti.net/about15067.html</a><br />
<a class="smarterwiki-linkify" href="http://www.powercram.com/2010/01/multi-cpu-graphing-in-cacti.html" target="_blank" rel="noopener">http://www.powercram.com/2010/01/multi-cpu-graphing-in-cacti.html</a></p>
<p>*) konqueror 一直開一直開 (我是裝 KDE)<br />
<a class="smarterwiki-linkify" href="http://forums.gentoo.org/viewtopic-t-966160-start-0.html" target="_blank" rel="noopener">http://forums.gentoo.org/viewtopic-t-966160-start-0.html</a><br />
裝 dolphin 就好了</p>
<p>*) 中文<br />
幹, 什麼年代了, 中文還是很難搞. 而且裝了還是很難用 (哭哭)<br />
# emerge scim-bridge scim-tables<br />
按照 Gentoo 的文件 http://www.gentoo-wiki.info/Input_Methods<br />
加上<br />
[Qt]<br />
DefaultInputMethod=scim-bridge</p>
<p>在 ~/.xprofile 加上<br />
[TEXT]<br />
export LC_CTYPE=zh_TW.UTF-8<br />
export GTK_IM_MODULE=scim-bridge<br />
export QT_IM_MODULE=scim-bridge<br />
export XMODIFIERS=&#8221;@im=SCIM&#8221;<br />
scim -d<br />
[/TEXT]</p>
<p>*) Dropbox<br />
emerge net-misc/dropbox<br />
再在 user mode 下執行 dropbox 就可以了.</p>
<p>*) Power/Frequency<br />
結論是, 什麼都不用動. 系統會自己跑 800Mhz~2.9G.<br />
Linux kernel version 3.12.3-gentoo. 看起來問題不大.</p>
<p>不過 cpufreq-info 回報的 CPU Frequency 是錯的, 要用 i7z 去看.<br />
如果 i7z 執行有問題, 可以參考這個網頁最後 patch 一下就可以執行了.<br />
https://bbs.archlinux.org/viewtopic.php?pid=1306943<br />
P.S 我是 patch 之後會出現 C7 State .</p>
<p>可以開啟內鍵的 Intel pstate driver, 這會啟動 pstate-drver 取代 cpufreq-acpi 管理程式. 不過i7z 內顯示的頻率就會變得很怪, 但是按照 intel 的說法 ondaemnd 己經不適合 intel 目前的管理模式了, 我現在也不太確定到底什麼是正確的.<br />
還是用原來的 cpufreq-acpi driver 跑 ondaemnd.</p>
<p>Ref.<br />
https://bbs.archlinux.org/viewtopic.php?pid=1306943<br />
http://forums.gentoo.org/viewtopic-p-7442152.html<br />
http://forums.gentoo.org/viewtopic-p-7396848.html#7396848<br />
phc-intel<br />
http://forums.gentoo.org/viewtopic-t-932096-start-0.html<br />
http://www.expreview.com/25426.html</p>
<p>*) Un-Plug SATA</p>
<p># echo 1 &gt; /sys/block/sdg/device/delete<br />
or<br />
# hdparm -F /dev/sdb # force flush write cache<br />
# hdparm -Y /dev/sdb # spin down and switch off the drive completely (until the kernel makes it spin up again)</p>
<p>不過我都是 unmount 就算了.<br />
Ref.<br />
http://forums.gentoo.org/viewtopic-p-6660527.html?sid=e63439cb70cd4c79f96cec3249590058</p>
<p>*) Vmware 抓不到 USB Device 的問題</p>
<p>在 /etc/init.d/vmware 前先執行<br />
# /etc/init.d/vmware-USBArbitrator start<br />
可以用<br />
# rc-update add vmware-USBArbitrator boot<br />
確保先執行.</p>
<p>如果沒有這個檔案, 可以解開 vmware 的 Package 再 copy 進去.</p>
<p>*) Sound<br />
預設 sound 應該就可以工作, 有一個小問題是要在 alsa 內指定 default sound device.<br />
要不然就會有如下的字樣<br />
[TEXT]<br />
ALSA lib pcm_dmix.c:1022:(snd_pcm_dmix_open) unable to open slave<br />
[/TEXT]</p>
<p>可以在 ~/.asoundrc 加入如下的內容就可以了<br />
[TEXT]<br />
defaults.pcm.!card 1<br />
defaults.pcm.!device 7</p>
<p>pcm.!default {<br />
type hw<br />
card 1<br />
}</p>
<p>ctl.!default {<br />
type hw<br />
card 1<br />
}<br />
[/TEXT]<br />
可以用<br />
# aplay -L<br />
# aplay -l<br />
查看 device 和 hw mixer 的資訊</p>
<p>Ref.<br />
Gentoo USB Device not Reconzgized<br />
https://bbs.archlinux.org/viewtopic.php?pid=1356156</p>
<p>*) Disable UltraNav Touchpad<br />
首先安裝 xinput<br />
# emerge -av xinput</p>
<p>再來就是用 xinput 列出 device<br />
[TEXT]<br />
$ DISPLAY=:0 xinput<br />
⎡ Virtual core pointer id=2 [master pointer (3)]<br />
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]<br />
⎜ ↳ Logitech USB-PS/2 Trackball id=13 [slave pointer (2)]<br />
⎜ ↳ Synaptics Inc. Composite TouchPad / TrackPoint id=10 [slave pointer (2)]<br />
⎜ ↳ Synaptics Inc. Composite TouchPad / TrackPoint id=9 [slave pointer (2)]<br />
⎣ Virtual core keyboard id=3 [master keyboard (2)]<br />
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]<br />
↳ Power Button id=6 [slave keyboard (3)]<br />
↳ Video Bus id=7 [slave keyboard (3)]<br />
↳ Power Button id=8 [slave keyboard (3)]<br />
↳ AT Translated Set 2 keyboard id=14 [slave keyboard (3)]<br />
↳ Lite-On Tech IBM USB Keyboard with UltraNav id=11 [slave keyboard (3)]<br />
↳ Lite-On Tech IBM USB Keyboard with UltraNav id=12 [slave keyboard (3)]<br />
[/TEXT]<br />
&#8220;Synaptics Inc. Composite TouchPad / TrackPoint id=9 [slave pointer (2)]&#8221; 這個就是我們要 Disable 的目標.</p>
<p>執行<br />
# xinput &#8211;set-prop 9 &#8220;Device Enabled&#8221; 0<br />
就可以 Disable touch pad, 如果要重新啟動, 就執行<br />
# xinput &#8211;set-prop 9 &#8220;Device Enabled&#8221; 1<br />
id = 10 的那個是小紅點, 如果不小心 diable 小紅點, 可以交換一下 id 試試看</p>
<p>*) 心得</p>
<p>這一台是我今年年末大升級的機器, 雖然花了將近一萬五. (驚, 有這麼多).<br />
不過在節能上還是看起來很威的.<br />
舊平台是 4850e + 780G + 4*HDDs, 當然 Power , HDD 也有差異, 不過應該相去不遠.</p>
<p>待機耗電 : 3.xW (OLD: 10W)<br />
開機不跑程式 : 58W (如果只有裝 2*HDDs, 是 3xW, OLD: 9XW)<br />
全速執行程式 : 100W (OLD: 130W)<br />
一核全速 : 6XW (只有裝 2*HDDs)</p>
<p>大概比前一個平台省了約 30~40W, 算是小弟對節能的小小貢獻.</p>
<p>若是和另一台 Q6600 + ATI 4850 顯卡比, 這一台待機就要耗 160W, 跑個程式就要耗 210W 以上. 想必新電腦省電很多很多了 :p<br />
和 Q6600 (o.c 3.0G) 比, 這台的 compile 速度也快上很多, 不過我不知道是不是我的心理因素, 我沒有去測試過. 不過應該符合我目前對這個平台速度和節能的期望了.</p>
<p>一句話: 我很滿意 <img src="https://s.w.org/images/core/emoji/15.0.3/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>==<br />
VMWARE workstation 12 or VMWARE Player 12 在新的系統有個小問題 USB Arb 有錯誤訊息, 有跑 Process 不過懶得查了, 短時間沒找到解決方案, 改用 VirtualBox</p>
<blockquote><p>2016-04-25T04:24:42.623+08:00| usbArb| I125: VMware USB Arbitration Service Version 15.1.7<br />
2016-04-25T04:24:42.623+08:00| usbArb| I125: USBGL: USB Sysfs found at /dev/bus/usb<br />
2016-04-25T04:24:42.623+08:00| usbArb| I125: USBArb: Attempting to connect to existing arbitrator on /var/run/vmware/usbarbitrator-socket.<br />
2016-04-25T04:24:42.623+08:00| usbArb| I125: SOCKET creating new socket, connecting to /var/run/vmware/usbarbitrator-socket<br />
2016-04-25T04:24:42.623+08:00| usbArb| I125: SOCKET connect failed, error 2: No such file or directory<br />
2016-04-25T04:24:42.623+08:00| usbArb| I125: USBArb: Failed to connect to the existing arbitrator.<br />
2016-04-25T04:31:01.719+08:00| usbArb| I125: USBArb: UsbArbPipeConnected: Connected to client, socket:4<br />
2016-04-25T04:31:01.730+08:00| usbArb| I125: USBArb: Closing client, error:2<br />
2016-04-25T04:31:01.730+08:00| usbArb| I125: USBArb: Client 0 disconnected</p></blockquote>
<p>&nbsp;</p>
<p><del datetime="2016-04-24T21:58:16+00:00">升級到 Linux kernel 4.5 直接安裝 app-emulation/vmware-modules 就可以了</del></p>
<p><del datetime="2016-04-23T03:17:48+00:00">後記: 升級到 Linux kernel 3.18 long term stable version </del></p>
<p>vmware 要從這邊下載 patch<br />
https://aur.archlinux.org/packages/vmware-patch/</p>
<p>記得 kvm 要關<br />
https://wiki.archlinux.org/index.php/VMware</p>
<p>Kernel 3.18 要升級到 udev 2.16 以上, userspace firmware helper 要關掉.<br />
https://wiki.gentoo.org/wiki/Udev/upgrade</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2013/12/26/1583/gentoo-%e9%9b%bb%e8%85%a6%e5%8d%87%e7%b4%9a%e6%a1%88-32bit-64bit-linux/">[Gentoo] 電腦升級案 32bit -&gt; 64bit Linux</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2013/12/26/1583/gentoo-%e9%9b%bb%e8%85%a6%e5%8d%87%e7%b4%9a%e6%a1%88-32bit-64bit-linux/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>kernel rootwait option</title>
		<link>https://blog.richliu.com/2012/11/09/1347/kermel-rootwait-option/</link>
					<comments>https://blog.richliu.com/2012/11/09/1347/kermel-rootwait-option/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Thu, 08 Nov 2012 18:40:30 +0000</pubDate>
				<category><![CDATA[Embedded]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux kernel]]></category>
		<category><![CDATA[mmc]]></category>
		<category><![CDATA[rootwait]]></category>
		<category><![CDATA[usb]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1347</guid>

					<description><![CDATA[<p>之前都不知道 Linux kernel 有 rootwait option, 比 rootdelay=? 好用 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2012/11/09/1347/kermel-rootwait-option/">kernel rootwait option</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>之前都不知道 Linux kernel 有 rootwait option, 比 rootdelay=? 好用多了. </p>
<p>尤其是用 usb or mmc 之類的 device 當作 root, 常用於 embedded system .<br />
(其實我也少用, 都混 IC vendor , rootwait 這種東西就交給系統廠去處理). </p>
<p>Example Command<br />
[TEXT]<br />
CONFIG_CMDLINE=&#8221;root=/dev/mmcblk0p1 rw init=/sbin/init mem=256M console=ttyS0,38400 rootwait&#8221;<br />
[/TEXT]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2012/11/09/1347/kermel-rootwait-option/">kernel rootwait option</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2012/11/09/1347/kermel-rootwait-option/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>[Gentoo] 升級 KDE 4.9 的問題.</title>
		<link>https://blog.richliu.com/2012/08/13/1249/gentoo-%e5%8d%87%e7%b4%9a-kde-4-9-%e7%9a%84%e5%95%8f%e9%a1%8c/</link>
					<comments>https://blog.richliu.com/2012/08/13/1249/gentoo-%e5%8d%87%e7%b4%9a-kde-4-9-%e7%9a%84%e5%95%8f%e9%a1%8c/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 13 Aug 2012 14:09:38 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[kde 4.9]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1249</guid>

					<description><![CDATA[<p>都什麼年代了, 還在手賤亂升 KDE 系統&#8230;.. 不過習慣了. 整個系統都要慢慢編, 慢慢升上去. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2012/08/13/1249/gentoo-%e5%8d%87%e7%b4%9a-kde-4-9-%e7%9a%84%e5%95%8f%e9%a1%8c/">[Gentoo] 升級 KDE 4.9 的問題.</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>都什麼年代了, 還在手賤亂升 KDE 系統&#8230;..</p>
<p><span id="more-1249"></span></p>
<p>不過習慣了. 整個系統都要慢慢編, 慢慢升上去. </p>
<p>這次升級完 KDE 4.9 之後, 系統進入 X 之後, 隨即跳出來, 並且出現錯誤訊息<br />
這搞了我一天才一個一個找到方法解決, 在這邊做個記錄. </p>
<p>[TEXT]<br />
startkde: Starting up&#8230;<br />
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)<br />
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.<br />
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.<br />
kded(1018): Communication problem with  &#8220;kded&#8221; , it probably crashed.<br />
Error message was:  &#8220;org.freedesktop.DBus.Error.NoReply&#8221; : &#8221; &#8220;Message did not receive a reply (timeout by message bus)&#8221; &#8221;</p>
<p>startkde: Shutting down&#8230;<br />
klauncher: Exiting on signal 1<br />
startkde: Running shutdown scripts&#8230;<br />
startkde: Done.<br />
xinit: connection to X server lost<br />
[/TEXT]</p>
<p>這個問題呢, 只要 emerge world 就可以解決了<br />
[BASH]<br />
# emerge -uDNv world<br />
[/BASH]<br />
ref. <a href="http://forum.kde.org/viewtopic.php?f=15&#038;t=107170&#038;p=247557#p247557" target="_blank" rel="noopener">kde 4.9 failed to start</a></p>
<p>接下來 emerge world, 碰到編 crypto++ Library 的問題, (這段是放別人的, 不過原理是一樣的)<br />
[TEXT]<br />
serpent.lo esign.lo randpool.lo  -lpthread<br />
libtool: link: x86_64-pc-linux-gnu-g++  -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/crtbeginS.o  .libs/sharkbox.o .libs/base32.o .libs/files.o .libs/hex.o .libs/gzip.o .libs/fips140.o .libs/mars.o .libs/dh2.o .libs/twofish.o .libs/eprecomp.o .libs/dsa.o .libs/polynomi.o .libs/winpipes.o .libs/vmac.o .libs/hrtimer.o .libs/md2.o .libs/fipstest.o .libs/rc5.o .libs/ccm.o .libs/simple.o .libs/queue.o .libs/xtrcrypt.o .libs/gf256.o .libs/cmac.o .libs/authenc.o .libs/des.o .libs/default.o .libs/idea.o .libs/gcm.o .libs/squaretb.o .libs/xtr.o .libs/emsa2.o .libs/sha.o .libs/network.o .libs/eax.o .libs/tea.o .libs/dessp.o .libs/algparam.o .libs/pch.o .libs/crc.o .libs/elgamal.o .libs/mqueue.o .libs/zlib.o .libs/ecp.o .libs/blowfish.o .libs/marss.o .libs/adler32.o .libs/wait.o .libs/iterhash.o .libs/safer.o .libs/wake.o .libs/gf2n.o .libs/rc2.o .libs/cryptlib_bds.o .libs/oaep.o .libs/square.o .libs/md4.o .libs/ida.o .libs/shark.o .libs/seed.o .libs/shacal2.o .libs/eccrypto.o .libs/ripemd.o .libs/camellia.o .libs/pubkey.o .libs/trdlocal.o .libs/salsa.o .libs/seal.o .libs/luc.o .libs/ttmac.o .libs/gf2_32.o .libs/mqv.o .libs/dh.o .libs/bfinit.o .libs/whrlpool.o .libs/asn.o .libs/rng.o .libs/cast.o .libs/tiger.o .libs/channels.o .libs/zinflate.o .libs/pssr.o .libs/misc.o .libs/pkcspad.o .libs/base64.o .libs/zdeflate.o .libs/basecode.o .libs/algebra.o .libs/blumshub.o .libs/ec2n.o .libs/casts.o .libs/gfpcrypt.o .libs/cryptlib.o .libs/rijndael.o .libs/strciphr.o .libs/modes.o .libs/panama.o .libs/nbtheory.o .libs/md5.o .libs/hmac.o .libs/socketft.o .libs/gost.o .libs/tigertab.o .libs/cbcmac.o .libs/tftables.o .libs/rsa.o .libs/rdtables.o .libs/rw.o .libs/3way.o .libs/rabin.o .libs/filters.o .libs/cpu.o .libs/sosemanuk.o .libs/integer.o .libs/rc6.o .libs/skipjack.o .libs/osrng.o .libs/arc4.o .libs/dll.o .libs/serpent.o .libs/esign.o .libs/randpool.o   -lpthread -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64/crtn.o  -Wl,-O1 -Wl,&#8211;as-needed -pthread   -pthread -Wl,-soname -Wl,libcrypto++.so.0 -o .libs/libcrypto++.so.0.0.0<br />
x86_64-pc-linux-gnu-g++: error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64/crti.o: No such file or directory<br />
x86_64-pc-linux-gnu-g++: error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/crtbeginS.o: No such file or directory<br />
x86_64-pc-linux-gnu-g++: error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/crtendS.o: No such file or directory<br />
x86_64-pc-linux-gnu-g++: error: /usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../lib64/crtn.o: No such file or directory<br />
make: *** [libcrypto++.la] Error 1<br />
[/TEXT]</p>
<p>原來以為是 libtool 要用 fix_libtool_files.sh 去修正它, 不過還是沒有用, 最後用了一個很鳥的方式解決, 就是重新編 libtool<br />
[BASH]<br />
# emerge -av libtool<br />
[/BASH]</p>
<p>ref.<br />
<a href="http://forums.gentoo.org/viewtopic-t-932696.html?sid=a50a690e14f6f7897845654c3c31e129" target="_blank" rel="noopener">Cannot compile amule due to crypto++</a></p>
<p>接下來就是碰到編 sys-auth/polkit-kde-agent 的問題<br />
[TEXT]<br />
Linking CXX executable polkit-kde-authentication-agent-1<br />
/usr/bin/cmake -E cmake_link_script CMakeFiles/polkit-kde-authentication-agent-1.dir/link.txt &#8211;verbose=1<br />
/usr/bin/x86_64-pc-linux-gnu-g++   -march=core2 -O2 -pipe  -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wformat-security -fno-exceptions -DQT_NO_EXCEPTIONS -fno-check-new -fno-common -Woverloaded-virtual -fno-threadsafe-statics -fvisibility=hidden -Werror=return-type -fvisibility-inlines-hidden  -Wl,&#8211;enable-new-dtags  -Wl,-O1 -Wl,&#8211;as-needed CMakeFiles/polkit-kde-authentication-agent-1.dir/polkit-kde-authentication-agent-1_automoc.o CMakeFiles/polkit-kde-authentication-agent-1.dir/policykitkde.o CMakeFiles/polkit-kde-authentication-agent-1.dir/policykitlistener.o CMakeFiles/polkit-kde-authentication-agent-1.dir/main.o CMakeFiles/polkit-kde-authentication-agent-1.dir/AuthDialog.o CMakeFiles/polkit-kde-authentication-agent-1.dir/polkit1authagentadaptor.o  -o polkit-kde-authentication-agent-1 -rdynamic -L/usr/lib64/qt4 /usr/lib64/libkdeui.so.5.8.0 -lpolkit-qt-gui-1 -lpolkit-qt-core-1 -lpolkit-qt-agent-1 /usr/lib64/libkdecore.so.5.8.0 /usr/lib64/qt4/libQtDBus.so /usr/lib64/qt4/libQtCore.so -lpthread /usr/lib64/qt4/libQtGui.so /usr/lib64/qt4/libQtSvg.so -Wl,-rpath,/usr/lib64/qt4:<br />
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: warning: libattica.so.0.3, needed by /usr/lib64/libkdeui.so.5.8.0, not found (try using -rpath or -rpath-link)<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Person::~Person()&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Provider::~Provider()&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Person::city() const&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Person::extendedAttribute(QString const&#038;) const&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::ItemJob<attica::person>::result() const&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Metadata::~Metadata()&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::ProviderManager::ProviderManager()&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Person::country() const&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::ProviderManager::providers() const&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Provider::name() const&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Provider::Provider()&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Person::avatarUrl() const&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::ProviderManager::loadDefaultProviders()&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Metadata::error() const&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::ProviderManager::~ProviderManager()&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::BaseJob::start()&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::ProviderManager::providerByUrl(QUrl const&#038;) const&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Provider::isValid() const&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Provider::requestPerson(QString const&#038;)&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Person::homepage() const&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::Provider::operator=(Attica::Provider const&#038;)&#8217;<br />
/usr/lib64/libkdeui.so.5.8.0: undefined reference to `Attica::BaseJob::metadata() const&#8217;<br />
collect2: ld returned 1 exit status<br />
[/TEXT]</p>
<p>這個內文也是拿別人的, 不過原理還是一樣, 解決方式是重編 kdelib<br />
[BASH]<br />
# emerge -av kdelib<br />
[/BASH]</p>
<p>ref.<br />
<a href="http://forums.gentoo.org/viewtopic-t-932432-start-0.html" target="_blank" rel="noopener">[solved] polkit-kde-agent versus libattica</a></p>
<p>如果 emerge world 有中斷, 解決完問題之後, 可以加上 r 參數從斷掉的地方接下去編, 就不用每次都重來了<br />
[BASH]<br />
# emerge -uDNvr world<br />
[/BASH]<br />
編到超過一半應該就可以試著重新啟動 KDE 了.</attica::person></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2012/08/13/1249/gentoo-%e5%8d%87%e7%b4%9a-kde-4-9-%e7%9a%84%e5%95%8f%e9%a1%8c/">[Gentoo] 升級 KDE 4.9 的問題.</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2012/08/13/1249/gentoo-%e5%8d%87%e7%b4%9a-kde-4-9-%e7%9a%84%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Gentoo Gateway 連中研院的 IPv6 Tunnel Broker</title>
		<link>https://blog.richliu.com/2012/04/28/1204/gentoo-%e9%80%a3%e4%b8%ad%e7%a0%94%e9%99%a2%e7%9a%84-ipv6-tunnel-broker/</link>
					<comments>https://blog.richliu.com/2012/04/28/1204/gentoo-%e9%80%a3%e4%b8%ad%e7%a0%94%e9%99%a2%e7%9a%84-ipv6-tunnel-broker/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 27 Apr 2012 17:47:38 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[gateway]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[radvd]]></category>
		<category><![CDATA[tunnel broker]]></category>
		<category><![CDATA[中研院]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1204</guid>

					<description><![CDATA[<p>自從從中華電信固3 IP 換光世代之後就失去了 IPv6 Address. 今天剛好在某 PTT 文上看到,  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2012/04/28/1204/gentoo-%e9%80%a3%e4%b8%ad%e7%a0%94%e9%99%a2%e7%9a%84-ipv6-tunnel-broker/">Gentoo Gateway 連中研院的 IPv6 Tunnel Broker</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>自從從中華電信固3 IP 換光世代之後就失去了 IPv6 Address. </p>
<p>今天剛好在某 PTT 文上看到, 中研院的 IPv6 Tunnel Broker 有給固定 IP 和 Prefix.<br />
這樣一來就可以搞家中 IPv6 Enable 了. </p>
<p>如果有 Gentoo 做 Gateway, 想讓家中 Intranet 有 IPv6 的環境, 就需要按照這一篇設定. </p>
<p>換 IPv6 最大的好處是什麼? 用中研院的網路看 Youtube 超順的&#8230;<br />
<span id="more-1204"></span><br />
首先去 <a href="http://tb2.ipv6.ascc.net/" target="_blank" rel="noopener">http://tb2.ipv6.ascc.net/</a> 申請帳號.<br />
最好寄密碼到信箱, 要不然打錯密碼很悶的 ..</p>
<p>到 <a href="http://www.go6.net/4105/download.asp" target="_blank" rel="noopener">http://www.go6.net/4105/download.asp</a><br />
下載 Client 6.0 Platform Specific Build &#8211; Linux 和 Client 6.0 Source Code (Linux/Unix/Darwin/BSD)<br />
我是懶得 install, 所以解壓縮 Linux binary 的 gw6c 之後, 再 compile 新的, 蓋掉舊的 gw6c binary . </p>
<p>解壓縮完目錄像這樣, gw6c binary 在 bin/<br />
[TEXT]<br />
xxx gw6c # ls -lF<br />
total 16<br />
drwxr-xr-x 2 root root 4096 Apr 28 01:22 bin/<br />
drwxr-xr-x 4 root root 4096 Mar 13  2009 man/<br />
drwxr-xr-x 2 root root 4096 Apr 28 01:21 template/<br />
[/TEXT]</p>
<p>編輯 bin/gw6c.conf<br />
[TEXT]<br />
userid=< 申請帳號><br />
passwd=< 申請密碼><br />
server=tb2.ipv6.ascc.net<br />
auth_method=digest-md5<br />
host_type=router<br />
prefixlen=64<br />
if_prefix=< 網卡介面, 我是用eth1><br />
gw6_dir=< 路徑>/gw6c<br />
[/TEXT]<br />
<> 請代換成自己的參數</p>
<p>如果只是單機要連線, host_type 要設 host , if_prefix 不用設定.<br />
[TEXT]<br />
host_type=host<br />
[/TEXT]</p>
<p>Gentoo 的話記得先安裝 RADVD (host_type=host 不需要)<br />
[BASH]<br />
# emerge -av radvd<br />
[/BASH]<br />
如果是初次設定, 別忘了 ip6table 要改 MTU<br />
[BASH]<br />
# ip6tables -A FORWARD -p tcp &#8211;tcp-flags SYN,RST SYN -j TCPMSS  &#8211;clamp-mss-to-pmtu<br />
# /etc/init.d/ip6tables save<br />
# rc-update add ip6tables default<br />
[/BASH]<br />
這樣下次開機的時候就會自動設定 ip6tables </p>
<p>接下來就直接跑<br />
[BASH]<br />
# ./gw6c -f gw6c.conf<br />
# ifconfig<br />
[/BASH]<br />
如果 sit1 有起來, 表示 IPv6 設定成功,<br />
如果沒有起來, 就改 gw6c.conf加上<br />
[TEXT]<br />
log_file=3<br />
[/TEXT]<br />
重新執行一次 gw6c 看看會發生什麼事情 . Log 會記錄在 gw6c.log 內. </p>
<p>P.S Gentoo nettool 1.6 以後 ifconfig 和 route 這二個命令改位置了.<br />
如果有碰到連不上的狀況, 而且是 command 錯誤, 請修改 template/linux.sh 內這幾行<br />
[TEXT]<br />
 79 ifconfig=/bin/ifconfig<br />
 80 route=/bin/route<br />
195    ExecNoCheck $ifconfig $TSP_TUNNEL_INTERFACE add $TSP_CLIENT_ADDRESS_IPV6/$TSP_TUNNEL_PREFIXLEN<br />
196    ExecNoCheck $ifconfig $TSP_TUNNEL_INTERFACE mtu 1280<br />
[/TEXT]</p>
<p>我的 IPv6 又可以用了, 不過某些網站似乎怪怪的 :-/</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2012/04/28/1204/gentoo-%e9%80%a3%e4%b8%ad%e7%a0%94%e9%99%a2%e7%9a%84-ipv6-tunnel-broker/">Gentoo Gateway 連中研院的 IPv6 Tunnel Broker</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2012/04/28/1204/gentoo-%e9%80%a3%e4%b8%ad%e7%a0%94%e9%99%a2%e7%9a%84-ipv6-tunnel-broker/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>Thinkpad T420s 安裝 4 套 OS (Windows7 32bit/Windows7 64bit/Windows XP/Ubuntu Linux)</title>
		<link>https://blog.richliu.com/2011/07/24/1113/thinkpad-t420s-%e5%ae%89%e8%a3%9d-4-%e5%a5%97-os-windows7-32bitwindows7-64bitwindows-xpubuntu-linux/</link>
					<comments>https://blog.richliu.com/2011/07/24/1113/thinkpad-t420s-%e5%ae%89%e8%a3%9d-4-%e5%a5%97-os-windows7-32bitwindows7-64bitwindows-xpubuntu-linux/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sat, 23 Jul 2011 16:24:42 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[32bit]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[Multi]]></category>
		<category><![CDATA[MultiOS]]></category>
		<category><![CDATA[Partclone]]></category>
		<category><![CDATA[T420s]]></category>
		<category><![CDATA[Thinkpad]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[多重開機]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1113</guid>

					<description><![CDATA[<p>Thinkpad T420s 太好用了, 所以我在公司又採買了三台, 用做測試機用. 畢竟 50K 以下這一台 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2011/07/24/1113/thinkpad-t420s-%e5%ae%89%e8%a3%9d-4-%e5%a5%97-os-windows7-32bitwindows7-64bitwindows-xpubuntu-linux/">Thinkpad T420s 安裝 4 套 OS (Windows7 32bit/Windows7 64bit/Windows XP/Ubuntu Linux)</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Thinkpad T420s 太好用了, 所以我在公司又採買了三台, 用做測試機用.<br />
畢竟 50K 以下這一台的 C/P 值非常的高.</p>
<p>因為是測試機, 所以必需要裝很多 OS. 而這些 OS 要是可以復原的.<br />
以現在測試 Wifi performance 而言, 大多都要求用 Intel Ultimate 6300N 3&#215;3 wifi 測試, 以求公平. 而這樣的環境用 VM 是沒有人承認這個數據的, 所以&#8230; 在一台電腦內要安裝多套 OS 就是必需的, 不同的狀況客戶會要求不同的 OS. 例如 NAS Performance 就要 Windows 7.</p>
<p>所以接下來就是要在 T420s 安裝以下 OS</p>
<ul>
<li>Windows 7 32bit</li>
<li>Windows 7 64bit</li>
<li>Windows XP</li>
<li>Ubuntu Linux 11.04</li>
</ul>
<p><span id="more-1113"></span><br />
這份文件是我的筆記. 非常簡略. </p>
<p>1. 事前準備<br />
1.1 Windows 7 32Bits Installer<br />
1.2 Windows 7 64Bits Installer<br />
1.3 Windows XP<br />
1.4 Ubuntu Linux 11.04<br />
1.5 先用 Linux 開機切<br />
P1: 50G NTFS<br />
P2: 50G NTFS<br />
P3: 50G NTFS<br />
L5: 20G NTFS (Option)*<br />
L6: 110G ext4<br />
L7: 5G swap<br />
1.6 Intel Pro/1000 32bit/64Bit Driver.<br />
note: 先保留原設定 Linux Partition, 等到灌完 XP, Win7 64, Win 7 32 bit, 灌完以後, 再改為 NTFS. 這樣 DISK 順序就不會亂掉. </p>
<p>2. 安裝 Windows XP<br />
2.1 用 nLite 製作 WinXP SP3 + AHCI (Intel Rapid Disk Driver) (順手寫入 Serial Number)<br />
2.2 Install 安裝 Windows XP<br />
2.3 Install Intel PRO/1000 Driver<br />
2.4 Install .net 2.0 framwork<br />
2.5 Install Thinkpad system update 3.14<br />
2.6 Install Intel HD Graph Driver<br />
2.7 換 Waller paper<br />
2.8 無止盡的 Update<br />
Windows XP Update 比較麻煩, 無法自己檢查, 可以參考這一篇, 然後執行 wsusupdate.vbs 去抓最新的 Update<br />
http://forums.techarena.in/windows-update/817572.htm<br />
* XP 不支援 Nvidia NVS</p>
<p>3. 安裝 Windows 7 64Bit.<br />
3.1 安裝 Windows 7 64Bit<br />
3.2 安裝 Thinkpad Intel Gigabit network 64bit driver<br />
3.3 安裝 Thinkpad system update 4<br />
3.4 改開機名稱<br />
用 administrator 跑 cmd.exe , 下指令<br />
# bcedit /set {current} description &#8220;Windows 7 64Bit&#8221;<br />
3.6 Install Firefox<br />
3.7 WinLoader(?)<br />
3.8 無止盡的 Update .<br />
3.9 換 Waller paper </p>
<p>4. 安裝 Windows 7 64Bit.<br />
4.1 安裝 Windows 7<br />
4.2 安裝 Thinkpad system update 4<br />
4.3 改開機名稱並且修改開機順序<br />
用 administrator 跑 cmd.exe , 下指令<br />
# bcedit /set {ntldr} description &#8220;Windows XP&#8221;<br />
# bcdedit /displayorder {current} /addfirst<br />
4.4 WinLoader(?)<br />
4.5 Install Firefox<br />
4.6 無止盡的 Update .<br />
4.7 換 Waller paper </p>
<p>5. 安裝 Ubuntu 11.04<br />
5.1 Install ubuntu 11.04<br />
5.2 Change default GUI to ubuntu classic<br />
5.3 Install partclone<br />
5.4 修改開機順序<br />
# cd  /etc/grub.d/<br />
# mv 30_os-prober 09_os-prober<br />
edit 40_customer 加上 timeout=1<br />
# update-grub2</p>
<p>6. Backup Windows Partition<br />
6.1 不壓縮備份<br />
# partclone.ntfs -c -d -s /dev/sda1 -o win7-x86.img<br />
# partclone.ntfs -c -d -s /dev/sda2 -o win7-x64.img<br />
# partclone.ntfs -c -d -s /dev/sda3 -o win-xp.img</p>
<p>6.2 bzip2 壓縮備份<br />
# partclone.ntfs -c -s /dev/sda1 | bzip2 -c > win7-x86.img.bz2<br />
# partclone.ntfs -c -s /dev/sda2 | bzip2 -c > win7-x64.img.bz2<br />
# partclone.ntfs -c -s /dev/sda3 | bzip2 -c > win-xp.img.bz2</p>
<p>6.3 不壓縮 Restore Windows Partition<br />
# partclone.ntfs -r -d -s ./first/win7-x64.img -o /dev/sda2<br />
6.4 壓縮 Restore Windows Partition<br />
# cat 1.sh<br />
FILE=win7-x64.img.bz2<br />
PART=/dev/sda2<br />
bzip2 -d -c $FILE | partclone.ntfs -r -o $FILE<br />
* Note: 不知道要用 bzip2 好還是 gzip 好. 空間和時間的 Trade off. </p>
<p>後記:<br />
1) Windows 7 沒有 SP1 真的很麻煩&#8230; 要一直裝一直裝.<br />
2) T420s 的硬碟很熱, 相較之下, 我的 mSATA + HDD 沒有這麼熱<br />
3) Download Package 要花很久時間, ubuntu 可以邊下載邊 Update 很不錯.</p>
<p>ref.<br />
http://partclone.org : Partclone<br />
http://www.windows7home.net/how-to-use-bcdedit-in-windows-7/ :bcdedit sample<br />
How to use BSDEDIT<br />
http://www.sevenforums.com/tutorials/2676-bcdedit-how-use.html<br />
Thinkpad Ethernet Driver 64bit/32bit<br />
http://support.lenovo.com/en_US/downloads/detail.page?LegacyDocID=MIGR-77016</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2011/07/24/1113/thinkpad-t420s-%e5%ae%89%e8%a3%9d-4-%e5%a5%97-os-windows7-32bitwindows7-64bitwindows-xpubuntu-linux/">Thinkpad T420s 安裝 4 套 OS (Windows7 32bit/Windows7 64bit/Windows XP/Ubuntu Linux)</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2011/07/24/1113/thinkpad-t420s-%e5%ae%89%e8%a3%9d-4-%e5%a5%97-os-windows7-32bitwindows7-64bitwindows-xpubuntu-linux/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Linux Assembly</title>
		<link>https://blog.richliu.com/2011/05/23/1091/linux-assembly/</link>
					<comments>https://blog.richliu.com/2011/05/23/1091/linux-assembly/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Sun, 22 May 2011 18:31:24 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[assembly]]></category>
		<category><![CDATA[sys_nanosleep]]></category>
		<category><![CDATA[syscall]]></category>
		<guid isPermaLink="false">http://blog.richliu.com/?p=1091</guid>

					<description><![CDATA[<p>這個只是筆記, 沒有很深入的內容. Writing resident programs under Linux [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2011/05/23/1091/linux-assembly/">Linux Assembly</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>這個只是筆記,<br />
沒有很深入的內容. </p>
<p><span id="more-1091"></span></p>
<p><a href="http://rudy.mif.pg.gda.pl/~bogdro/linux/tsr_tut_linux_en.html" target="_blank" rel="noopener"><br />
Writing resident programs under Linux</a> : nanosleep 的 example<br />
<a href="http://asm.sourceforge.net/syscall.html" target="_blank" rel="noopener">List of Linux/i386 system calls</a>: 查 system call 很好用<br />
<a href="http://www.cin.ufpe.br/~if817/arquivos/asmtut/quickstart.html" target="_blank" rel="noopener">Linux Assembly Tutorial</a>: 有一些好用的範例, 適合我這種很久沒有寫 Code 的人<br />
<a href="http://www.vividmachines.com/shellcode/shellcode.html" target="_blank" rel="noopener">Shellcoding for Linux and Windows Tutorial</a>: 有我要的語法. </p>
<p>在 assembly 呼叫 nanosleep 的範例, 這會 delay 二秒.<br />
[C]<br />
        starter:<br />
        mov ebx, t1_v<br />
        mov ecx, 0<br />
        mov eax, 162    ; sys_nanosleep<br />
        int 0x80<br />
        xor eax, eax<br />
        mov al, 1       ;exit the shellcode<br />
        xor ebx,ebx<br />
        int 0x80</p>
<p>        ender:<br />
        call starter<br />
        t1_v: db 2,0,0,0,0,0,0,0</p>
<p>[/C]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2011/05/23/1091/linux-assembly/">Linux Assembly</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2011/05/23/1091/linux-assembly/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
