<?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>CentOS &#8211; richliu&#039;s blog</title>
	<atom:link href="https://blog.richliu.com/tag/centos/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Tue, 27 Sep 2022 08:21:31 +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>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>Build Linux kernel 5.x on CentOS 7</title>
		<link>https://blog.richliu.com/2021/11/15/4515/build-linux-kernel-5-x-on-centos-7/</link>
					<comments>https://blog.richliu.com/2021/11/15/4515/build-linux-kernel-5-x-on-centos-7/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 15 Nov 2021 04:32:57 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[grub]]></category>
		<category><![CDATA[linux kernel]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=4515</guid>

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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



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



<p>Ref: <br />Good mirror site for CentOS7 package.  <br />https://mirrors.bfsu.edu.cn/centos-altarch/7.9.2009/os/aarch64/<br /><br /></p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2021/11/15/4515/build-linux-kernel-5-x-on-centos-7/">Build Linux kernel 5.x on CentOS 7</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2021/11/15/4515/build-linux-kernel-5-x-on-centos-7/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>QEMU Run x86_64/AMD64 VM on ARM64/AARCH64</title>
		<link>https://blog.richliu.com/2019/08/02/4045/qemu-run-x86_64-on-arm64-server-command/</link>
					<comments>https://blog.richliu.com/2019/08/02/4045/qemu-run-x86_64-on-arm64-server-command/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Fri, 02 Aug 2019 03:33:23 +0000</pubDate>
				<category><![CDATA[ARM]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[18.04]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[amd64]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[ovfm]]></category>
		<category><![CDATA[qemu]]></category>
		<category><![CDATA[uefi]]></category>
		<category><![CDATA[x86_64]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=4045</guid>

					<description><![CDATA[<p>This is a work note for run x86_64/AM64 on ARM64/AARCH6 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/08/02/4045/qemu-run-x86_64-on-arm64-server-command/">QEMU Run x86_64/AMD64 VM on ARM64/AARCH64</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This is a work note for run x86_64/AM64 on ARM64/AARCH64 server .<br />Because they are different archeticture, so, run x86_64 on ARM server would be very slow. <br /><br />and some functions might be different when run on different platform </p>



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



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



<p>It can refer to those three articles to create a new cloud image from Ubuntu server image, remember to change ARM64 image to x86_64 image . <br /><br /><a href="https://blog.richliu.com/2018/08/25/2318/change-ubuntu-cloud-image-size">Change Ubuntu Cloud Image Size</a> (if you choice ubuntu 16.04 as your image)<br /><a href="https://blog.richliu.com/2017/08/31/2165/change-ubuntu-cloud-image-password">Change Ubuntu Cloud Image Password</a><br /><a href="https://blog.richliu.com/2017/10/17/2187/ubuntu-cloud-image-taiwan-mirror-site">Ubuntu Cloud Image Taiwan Mirror Site</a><br /></p>



<p>Install Qemu and setup bridge devices </p>



<pre class="wp-block-code"><code>apt install -y ovmf qemu bridge-utils
mkdir -p /etc/qemu
echo "allow br0" &gt; /etc/qemu/bridge.conf
echo "allow virbr0" &gt;&gt; /etc/qemu/bridge.conf</code></pre>



<p>Write this script to a file and run it. </p>



<pre class="wp-block-code"><code>SERVERFILE=xenial-server-cloudimg-amd64-uefi1.img
VERSION=`uname -r`

sudo qemu-system-x86_64 -name vm1 \
        -machine pc-i440fx-xenial,usb=off \
        -cpu qemu64 -m 8192 \
        -smp 12,sockets=1,cores=12,threads=1 \
        -nographic -nodefaults \
        -bios /usr/share/ovmf/OVMF.fd \
        -virtfs local,path=/home/work,mount_tag=host0,security_model=passthrough,id=host0 \
        -drive file=$SERVERFILE  \
        -net nic,macaddr=$macaddr \
        -net tap,ifname=tap0 \
        -serial telnet::9001,server,nowait &gt; guest1_log.txt 2&gt;&amp;1 &amp;

sleep 5

brctl addif br0 tap0</code></pre>



<p>it can use command <br />qemu-system-x86_64 &#8211;machine help<br />and<br /> qemu-system-x86_64 &#8211;cpu help<br />to get all machine and cpu options. <br /><br />it can change cpu and machine type here. <br /><br />network would be bridge on tap0<br /><br />below is good option to share folder between host and VM, below command will share /home/work with vm. </p>



<pre class="wp-block-code"><code>option 
--virtfs local,path=/home/work,mount_tag=host0,security_model=passthrough,id=host0 </code></pre>



<p>it can put this line to /etc/fstab to mount host&#8217;s folder to somewhere, in this case, just put the same directory like host does. <br /></p>



<pre class="wp-block-code"><code>host0   /home/work   9p      trans=virtio,version=9p2000.L,user,umask=000   0 0</code></pre>



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



<p>CentOS document was written on 2021, but Ubuntu document on 2019, there is some difference between it. but that&#8217;s ok, I believe both ways are works. </p>



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



<p>CentOS default application doesn&#8217;t support run x86_64 code on ARM64 server, it needs to compile manually. <br /><br />Please download qemu and compile it. </p>



<pre class="wp-block-code"><code># Install CentOS Packages
yum config-manager --set-enabled powertools
yum install -y xorg-x11-xauth python3 ninja-build
yum install -y glib2-devel libmount-devel
yum install -y git glib2-devel libfdt-devel pixman-devel zlib-devel

# Download QEMU Source Code
wget https://download.qemu.org/qemu-5.2.0.tar.xz
# Decompress it
tar xvf qemu-5.2.0.tar.xz
# 
cd qemu-5.2.0
./configure --target-list="x86_64-softmmu aarch64-softmmu aarch64-linux-user x86_64-linux-user"
make -j `nproc`
make install 
</code></pre>



<p>Then, qemu will be installed on /usr/local/bin</p>



<h3 class="wp-block-heading">Download UEFI Image</h3>



<p>It needs UEFI Image for x86_64 image boot up. It needs <a rel="noreferrer noopener" href="https://github.com/tianocore/tianocore.github.io/wiki/OVMF" data-type="URL" data-id="https://github.com/tianocore/tianocore.github.io/wiki/OVMF" target="_blank">OVMF&#8217;s tianocore</a> (Open Source UEFI BIOS) to boot up. And we  can download <a href="https://www.kraxel.org" data-type="URL" data-id="https://www.kraxel.org" target="_blank" rel="noreferrer noopener">kraxel </a>as prebuild images. </p>



<pre class="wp-block-code"><code># Install Kraxel into CentOS repos
cd /etc/yum.repos.d/
wget https://www.kraxel.org/repos/firmware.repo
yum install edk2.git-aarch64 edk2.git-ovmf-x64
cd &lt;your vm directory&gt;
cp /usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd .
cp /usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd .

</code></pre>



<h3 class="wp-block-heading">Prepare Bridge Devices</h3>



<p>It needs bridge devices to connect to internet, default qemu bridge device name is virbr0 , due to CentOS doesn&#8217;t support brctl, follow this document(<a rel="noreferrer noopener" href="https://www.tecmint.com/create-network-bridge-in-rhel-centos-8/" data-type="URL" data-id="https://www.tecmint.com/create-network-bridge-in-rhel-centos-8/" target="_blank">3 Ways to Create a Network Bridge in RHEL/CentOS 8</a>) to create a CentOS bridge devices. Below is my experiment script to create bridge device, this setting will keep in system, reboot will not be reset. </p>



<pre class="wp-block-code"><code>nmcli conn add type bridge con-name virbr0 ifname virbr0

killall dhclient
ip addr flush enP7p2s0
nmcli conn modify virbr0 ipv4.addresses '192.168.3.191/16'
nmcli conn modify br0 ipv4.gateway '192.168.1.1'
nmcli conn modify br0 ipv4.dns '8.8.8.8'
nmcli conn modify br0 ipv4.method manual
nmcli conn add type ethernet slave-type bridge con-name bridge-br0 ifname enP7p2s0 master virbr0
nmcli conn up virbr0
nmcli conn up bridge-br0

nmcli conn show  --active

# Allow QEMU to access virbr0
mkdir -p /etc/qemu
echo "allow virbr0" &gt;&gt; /etc/qemu/bridge.conf

</code></pre>



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



<p>It can refer above to prepare cloud image, I prefer to use ubuntu cloud image, but have not try CentOS image. </p>



<p>Remember Ubuntu 18.04 image won&#8217;t auto increase image size, please follow this <a href="https://blog.richliu.com/2018/08/25/2318/change-ubuntu-cloud-image-size/" data-type="post" data-id="2318">Change Ubuntu Cloud Image Size</a> to modify image size<br /></p>



<pre class="wp-block-code"><code>
qemu-system-x86_64 -m 8192 -smp 16 -nographic \
        -drive if=pflash,format=raw,unit=0,file=OVMF_CODE-pure-efi.fd,readonly=on \
        -drive if=pflash,format=raw,unit=1,file=OVMF_VARS-pure-efi.fd \

        -hdc bionic-server-cloudimg-amd64.img \
        -netdev bridge,br=virbr0,id=net0 \
        -device virtio-net,netdev=net0,mac=00:11:22:33:44:55 \
        -serial telnet::9001,server,nowait &gt; vmlog.txt 2&gt;&gt; vmlog.txt &amp;
</code></pre>



<h3 class="wp-block-heading">x86_64 application</h3>



<p>Sometimes we don&#8217;t need to run whole VM to run some application just for x86_64, it can run user mode application directly. I am a lazy guy, so just reuse cloud image as x86_64 Linux library. </p>



<pre class="wp-block-code"><code>mkdir -p /home/amd64
qemu-img convert  bionic-server-cloudimg-amd64.img bionic-server-cloudimg-amd64.raw
losetup /dev/loop0 bionic-server-cloudimg-amd64.raw
kpartx -a /dev/loop0
mount /dev/mapper/loop0p1 /home/amd64
</code></pre>



<p>Umount Image</p>



<pre class="wp-block-code"><code>umount /home/amd64
losetup -d /dev/loop0</code></pre>



<p>Run x86_64 only application </p>



<pre class="wp-block-code"><code>qemu-x86_64 -L /home/amd64/ bootutil64e
qemu-x86_64 -L /home/amd64/ nvmupdate64e -l</code></pre>



<h2 class="wp-block-heading">Unsolved Problem</h2>



<h3 class="wp-block-heading">Cannot find way to update INTEL NIC&#8217;s NVM</h3>



<p>Tried vfio and application mode, vfio cannot pass iommu to host, it will fail. <br /><br />User space application will cause mmap fail. <br /><br />If you know how to update Intel NIC&#8217;s NVM, welcome to leave a message for me. </p>



<h3 class="wp-block-heading">QEMU &#8211;static problem</h3>



<p>Add &#8211;static parameter will cause some problem, cannot solve it right now. </p>



<p><br />./configure &#8211;target-list=&#8221;x86_64-softmmu aarch64-softmmu aarch64-linux-user x86_64-linux-user&#8221; &#8211;static<br />===</p>



<p>ERROR: sizeof(size_t) doesn&#8217;t match GLIB_SIZEOF_SIZE_T.</p>



<p>&nbsp;&nbsp;&nbsp; You probably need to set PKG_CONFIG_LIBDIR</p>



<p>&nbsp;&nbsp;&nbsp; to point to the right pkg-config files for your&nbsp;&nbsp;&nbsp; build target</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2019/08/02/4045/qemu-run-x86_64-on-arm64-server-command/">QEMU Run x86_64/AMD64 VM on ARM64/AARCH64</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2019/08/02/4045/qemu-run-x86_64-on-arm64-server-command/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Centos 5.X 升級更新問題</title>
		<link>https://blog.richliu.com/2017/04/26/2142/centos-5-x-%e5%8d%87%e7%b4%9a%e6%9b%b4%e6%96%b0%e5%95%8f%e9%a1%8c/</link>
					<comments>https://blog.richliu.com/2017/04/26/2142/centos-5-x-%e5%8d%87%e7%b4%9a%e6%9b%b4%e6%96%b0%e5%95%8f%e9%a1%8c/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 26 Apr 2017 04:32:06 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[expire]]></category>
		<guid isPermaLink="false">https://blog.richliu.com/?p=2142</guid>

					<description><![CDATA[<p>今天重灌某一台機器的時候發現 CentOS 5.X 己經停止支援了，所以各大 Mirror Site 都砍掉這 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/04/26/2142/centos-5-x-%e5%8d%87%e7%b4%9a%e6%9b%b4%e6%96%b0%e5%95%8f%e9%a1%8c/">Centos 5.X 升級更新問題</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>今天重灌某一台機器的時候發現 CentOS 5.X 己經停止支援了，所以各大 Mirror Site 都砍掉這些檔案<br />
<span id="more-2142"></span></p>
<p>主要還是 yum update 不能用了, 像是</p>
<pre lang="text">
# yum update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 Eg. /
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/5/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base
</pre>
<p>這時候就要修改 mirror 檔案, mark 掉所有 mirrorlist 的地方, 改從 valut 抓檔案<br />
編輯 /etc/yum.repos.d/CentOS-Base.repo , mark 掉所有 mirrorlist=<br />
分別加上</p>
<pre lang="text">
baseurl=http://vault.centos.org/5.11/os/$basearch

baseurl=http://vault.centos.org/5.11/updates/$basearch

baseurl=http://vault.centos.org/5.11/extras/$basearch

baseurl=http://vault.centos.org/5.11/centosplus/$basearch

baseurl=http://vault.centos.org/5.11/contrib/$basearch
</pre>
<p>硬改 5.11 應該也沒有什麼關係，反正也不會再升級或是進版了</p>
<p>好像沒有什麼文章講到這件事, 所以記錄一下</p>
<p>The post <a rel="nofollow" href="https://blog.richliu.com/2017/04/26/2142/centos-5-x-%e5%8d%87%e7%b4%9a%e6%9b%b4%e6%96%b0%e5%95%8f%e9%a1%8c/">Centos 5.X 升級更新問題</a> appeared first on <a rel="nofollow" href="https://blog.richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.richliu.com/2017/04/26/2142/centos-5-x-%e5%8d%87%e7%b4%9a%e6%9b%b4%e6%96%b0%e5%95%8f%e9%a1%8c/feed/</wfw:commentRss>
			<slash:comments>1</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>
	</channel>
</rss>
