<?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>centos8 &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/tag/centos8/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Fri, 23 Feb 2024 15:57:10 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>CentOS8 ARM64/AARCH64 Install Docker</title>
		<link>https://richliu.com/2020/05/18/4273/centos8-arm64-aarch64-install-docker/</link>
					<comments>https://richliu.com/2020/05/18/4273/centos8-arm64-aarch64-install-docker/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 18 May 2020 15:11:17 +0000</pubDate>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[centos8]]></category>
		<category><![CDATA[docker]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4273</guid>

					<description><![CDATA[<p>It&#8217;s not complex to install docker on ARM64 platf [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2020/05/18/4273/centos8-arm64-aarch64-install-docker/">CentOS8 ARM64/AARCH64 Install Docker</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>It&#8217;s not complex to install docker on ARM64 platform and make it work, but it needs a trick</p>



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



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



<p>$  sudo yum remove docker-ce docker-ce-cli containerd.io </p>



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



<p>This is most important step, without this, docker&#8217;s install script will fail. </p>



<p>$ sudo dnf install <a href="https://download.docker.com/linux/centos/7/aarch64/stable/Packages/containerd.io-1.2.6-3.3.el7.aarch64.rpm" target="_blank" rel="noopener">https://download.docker.com/linux/centos/7/aarch64/stable/Packages/containerd.io-1.2.6-3.3.el7.aarch64.rpm</a></p>



<h2 class="wp-block-heading">Docker Script</h2>



<p>Get docker script and run it <br />$ curl -fsSL https://get.docker.com -o get-docker.sh <br />$ sudo sh get-docker.sh <br />Add your current username to docker group if not run on root account. <br />$ sudo usermod -aG docker your-user </p>



<h2 class="wp-block-heading">Restart Docker And Enable Firewall </h2>



<p>$  sudo systemctl start docker <br />$  firewall-cmd &#8211;zone=public &#8211;add-masquerade &#8211;permanent <br />$  firewall-cmd &#8211;reload </p>



<p>ref. <br />[1]  https://linuxconfig.org/how-to-install-docker-in-rhel-8 <br />[2]  https://docs.docker.com/engine/install/centos/ <br />[3]  https://serverfault.com/questions/987686/no-network-connectivity-to-from-docker-ce-container-on-centos-8 </p>
<p>The post <a rel="nofollow" href="https://richliu.com/2020/05/18/4273/centos8-arm64-aarch64-install-docker/">CentOS8 ARM64/AARCH64 Install Docker</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2020/05/18/4273/centos8-arm64-aarch64-install-docker/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>ARM64 Centos8/Ubuntu PXE Boot Install on Ubuntu Server</title>
		<link>https://richliu.com/2020/04/08/4263/arm64-centos8-pxe-boot/</link>
					<comments>https://richliu.com/2020/04/08/4263/arm64-centos8-pxe-boot/#respond</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Wed, 08 Apr 2020 08:21:38 +0000</pubDate>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[arm64]]></category>
		<category><![CDATA[centos8]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[pxe]]></category>
		<category><![CDATA[pxeboot]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://richliu.com/?p=4263</guid>

					<description><![CDATA[<p>This document will introduce how to setup a centos PXE  [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2020/04/08/4263/arm64-centos8-pxe-boot/">ARM64 Centos8/Ubuntu PXE Boot Install on Ubuntu Server</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>This document will introduce how to setup a centos PXE boot environment on ubuntu 18.04 for install centos8 to your ARM64 machine. <br /><br />In this document, it uses CentOS 8 version is 8.1.1911, it might also work on later version if you change file name accordingly .&nbsp;<br /><br />all command in this document we assume you already run with root permission.&nbsp;<br /></p>



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



<h2 class="wp-block-heading">Hardware topology&nbsp;</h2>



<p>[ARM64 CLIENT] &lt;&#8212;&#8212;-&gt; [Server]&nbsp; &lt;&#8212;&#8212;-&gt; Internet&nbsp;</p>



<p>SERVER ethernet ip is 10.0.0.1 , another interface connect to internet.&nbsp;</p>



<p></p>



<h2 class="wp-block-heading">Install necessary packages&nbsp;<br /></h2>



<p>Install TFTP, HTTP and DHCPD Server and rpm2cpio&nbsp;<br /></p>



<p>$ apt install tftpd-hpa apache2 isc-dhcp-server rpm2cpio<br /></p>



<h2 class="wp-block-heading">Modify dhcpd server configuration&nbsp;<br /></h2>



<p>$ vim /etc/dhcp/dhcpd.conf<br /></p>



<p>following is example configuration,it can be changed to fit your environment&nbsp;</p>



<pre class="wp-block-verse">authoritative;
default-lease-time&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 259200;
max-lease-time&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 518400;
option routers&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10.0.0.1;
option subnet-mask&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 255.255.255.0;
option domain-name-servers&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 168.95.1.1,8.8.8.8;
ddns-update-style &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; interim;
ignore client-updates;
allow booting;
allow bootp;
allow unknown-clients;
server-name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pxis;

subnet 10.0.0.0 netmask 255.255.255.0 {
&nbsp;&nbsp;&nbsp;&nbsp;range 10.0.0.100 10.0.0.200;
&nbsp;&nbsp;&nbsp;&nbsp;option ip-forwarding off;
&nbsp;&nbsp;&nbsp;&nbsp;option subnet-mask&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 255.255.255.0;
&nbsp;&nbsp;&nbsp;&nbsp;next-server 10.0.0.1;
&nbsp;&nbsp;&nbsp;&nbsp;filename "shim.efi";

}</pre>



<h2 class="wp-block-heading">Modify tftpd setting&nbsp;<br /></h2>



<p>$ vim /etc/default/tftpd-hpa<br /></p>



<p>Add &#8211;create to TFTP_OPTIONS and change tftp directory to /tftpboot&nbsp;<br /></p>



<p>following is example configuration file&nbsp;</p>



<pre class="wp-block-preformatted">TFTP_USERNAME="tftp"<br />TFTP_DIRECTORY="/tftpboot"<br />TFTP_ADDRESS=":69"<br />TFTP_OPTIONS="--secure&nbsp; --create"</pre>



<h2 class="wp-block-heading">Restart Service&nbsp;<br /></h2>



<pre class="wp-block-preformatted">mkdir /tftpboot&nbsp;
/etc/init.d/tftpd-hpa restart
/etc/init.d/apache2 restart
/etc/init.d/isc-dhcp-server restart
</pre>



<h2 class="wp-block-heading">Get ARM64 pxeboot file&nbsp;</h2>



<p>some times the shim and grub2-efi would be erase, just visit mirror.centos.org and find new one than download it. </p>



<pre class="wp-block-preformatted">cd /tftpboot&nbsp;
wget http://mirror.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/shim-aa64-15-15.el8_2.aarch64.rpm
wget http://mirror.centos.org/centos/8-stream/BaseOS/aarch64/os/Packages/grub2-efi-aa64-2.02-106.el8.aarch64.rpm
rpm2cpio shim-aa64-15-15.el8_2.aarch64.rpm | cpio -dimv
rpm2cpio grub2-efi-aa64-2.02-106.el8.aarch64.rpm | cpio -dimv
cp ./boot/efi/EFI/centos/shim.efi .
cp ./boot/efi/EFI/centos/grubaa64.efi .
chmod +rx *.efi</pre>



<h2 class="wp-block-heading">Configure grub.conf&nbsp;<br /></h2>



<p>$ vim /tftpboot/grub.cfg<br /></p>



<p>Following is grub.conf example&nbsp;</p>



<pre class="wp-block-verse">set timeout=60<br />menuentry 'CentOS' {<br /> &nbsp;linux images/pxeboot/vmlinuz ip=dhcp inst.repo=http://10.0.0.1/centos8/<br />&nbsp;&nbsp;initrd images/pxeboot/initrd.img<br />}</pre>



<p>If your system support secure boot and you want to do it, please replace linux with linuxefi and replace initrd with initrdefi.&nbsp;</p>



<h2 class="wp-block-heading">Get CentOS 8 stream image and copy it to web server&nbsp;</h2>



<pre class="wp-block-preformatted">cd /var/www/html&nbsp;
wget <a href="https://mirror01.idc.hinet.net/centos/8-stream/isos/aarch64/CentOS-Stream-8-aarch64-20211202-dvd1.iso" target="_blank" rel="noopener">http://ftp.twaren.net/Linux/CentOS/8-stream/isos/x86_64/CentOS-Stream-8-x86_64-20220215-dvd1.iso</a>
mkdir disk&nbsp;
mount -o loop CentOS-Stream-8-x86_64-20220215-dvd1.iso disk
cp -a disk centos8&nbsp;
umount disk&nbsp;
rmdir disk

# copy boot file into tftp directory </pre>



<p>cd /tftpboot<br />cp /var/www/html/centos8/images/ . -a<br /></p>



<p>After copy all file into http file directory, it can visit via browser on server with URL <a href="http://10.0.0.1/centos8/">http://10.0.0.1/centos8/</a> to check whether file exist or not.&nbsp;<br /></p>



<h2 class="wp-block-heading">NAT<br /></h2>



<p>Server should support NAT function to forward packet.&nbsp;<br /><br />assume interface connect to internet is wls3 <br />Following is a sample command to enable Linux NAT function which can make client to access internet or intranet .&nbsp;</p>



<p>$ echo 1 &gt; /proc/sys/net/ipv4/ip_forward ==&gt; enable it immediately&nbsp;<br />$ iptables -t nat -A POSTROUTING -o wls3 -j MASQUERADE</p>



<p></p>



<p>Now, you can choose pxeboot on your ARM64 machine. if everything successful, you can see CentOS on your console if everything is ok .&nbsp;<br /></p>



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



<h3 class="wp-block-heading">Stdin: Invalid argument</h3>



<p>My system cannot boot into the Ubuntu install program for an unknown reason. After checking the system, it seems that the issue may be caused by an inability to access internet resources for some reason, even though the DNS and network appear to be fine. An alternative solution is to put the ISO on a website and assign the argument to the parameter. Here is an example using Ubuntu 22.04.</p>



<pre class="wp-block-preformatted">menuentry 'Ubuntu22.04 Net Install' {<br />linux ubuntu2204/vmlinuz ip=dhcp url=http://10.0.0.1/ubuntu-22.04.1-live-server-arm64.iso only-ubiquity<br />initrd ubuntu2204/initrd<br />}</pre>



<h2 class="wp-block-heading">Debug&nbsp;<br /></h2>



<p>Wireshark is your good friend, use it.&nbsp;<br /></p>



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



<p>It can download Ubuntu Netboot images from this url. <br /> <a href="http://cdimage.ubuntu.com/netboot/" target="_blank" rel="noopener">http://cdimage.ubuntu.com/netboot/</a> <br /><br />Choice what you want, for example, url below is Ubuntu 18.04 for ARM64 image<br /> <a href="http://ports.ubuntu.com/ubuntu-ports/dists/bionic-updates/main/installer-arm64/current/images/netboot/" target="_blank" rel="noopener">http://ports.ubuntu.com/ubuntu-ports/dists/bionic-updates/main/installer-arm64/current/images/netboot/</a> <br />Ubuntu 20.04 Netboot file <br />http://ports.ubuntu.com/ubuntu-ports/dists/focal-updates/main/installer-arm64/current/legacy-images/netboot/netboot.tar.gz</p>



<p><br />Download netboot image to tftp directory, I prefer to put different version to different directory. </p>



<pre class="wp-block-code"><code>$ cd /tftpboot
$ wget http://ports.ubuntu.com/ubuntu-ports/dists/bionic-updates/main/installer-arm64/current/images/netboot/netboot.tar.gz
$ mkdir ubuntu1804
$ cd ubuntu1804
$ tar xvf ../netboot.tar.gz</code></pre>



<p>Modify grub.cfg and add Ubuntu option to grub.cfg, save it, now, this server can also provide ubuntu net install</p>



<pre class="wp-block-code"><code>set timeout=60
menuentry 'CentOS8 Install' {
  linux images/pxeboot/vmlinuz ip=dhcp inst.repo=http://10.0.0.1/centos8/
  initrd images/pxeboot/initrd.img
}
menuentry 'Ubuntu18.04 Install' {
  linux ubuntu1804/ubuntu-installer/arm64/linux ip=dhcp
  initrd ubuntu1804/ubuntu-installer/arm64/initrd.gz
}
</code></pre>



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



<p>It can download iso file and use the iso file as install media. <br /><br />in Linux, download Ubuntu 20.04 ARM64 iso file</p>



<pre class="wp-block-preformatted">$ wget https://cdimage.ubuntu.com/releases/20.04/release/ubuntu-20.04.3-live-server-arm64.iso
$ mount -o loop ubuntu-20.04.3-live-server-arm64.iso disk
$ mkdir ubuntu2004
$ cp disk/casper ubuntu2004/ -a 
$ umount disk</pre>



<p>Modify grub.cfg as below (not test)</p>



<pre class="wp-block-preformatted">set timeout=60
menuentry 'CentOS8 Install' {
  linux images/pxeboot/vmlinuz ip=dhcp inst.repo=http://10.0.0.1/centos8/
  initrd images/pxeboot/initrd.img
}
menuentry 'Ubuntu20.04 Install' {
  linux ubuntu2004/casper/vmlinuz ip=dhcp
  initrd ubuntu2004/casper/initrd
}
</pre>



<p>It also can use HWE kernel </p>



<pre class="wp-block-preformatted">menuentry 'Ubuntu20.04 Install' {
  linux ubuntu2004/casper/hwe-vmlinux ip=dhcp
  initrd ubuntu2004/casper/hwe-initrd
}

</pre>



<h2 class="wp-block-heading">Note for GRUB Install Command</h2>



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



<pre class="wp-block-preformatted">svr=10.0.0.1; root=boot/centos8/images/pxeboot
linux (http,$svr)/$root/vmlinuz inst.stage2=http://$svr/boot/centos8 text
initrd (http,$svr)/$root/initrd.img
</pre>



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



<pre class="wp-block-preformatted">svr=192.168.110.254; root=boot/ubuntu2004/casper
iso=ubuntu-20.04.3-live-server-arm64.iso
linux (http,$svr)/$root/vmlinuz url=http://192.168.110.254/boot/$iso only-ubiquity ip=dhcp ---
initrd (http,$svr)/$root/initrd

linux (http,$svr)/$root/hwe-vmlinuz url=http://192.168.110.254/boot/$iso only-ubiquity ip=dhcp ---
initrd (http,$svr)/$root/hwe-initrd

</pre>



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



<p>Fedora&#8217;s setting is more closed to CentOS, due to CentOS might be dropped recently, so, moved to Fedora environment is necessary. </p>



<h3 class="wp-block-heading">Get initrd/vmlinux image</h3>



<p>Other parts like CentOS, <br />Download the PXE initrd and vmlinuz image, free.nchc.org.tw is Taiwan local Fedora server, you can replace it with local server. </p>



<pre class="wp-block-preformatted">mkdir -p /tftpboot/f36

cd /tftpboot/f36
wget http://free.nchc.org.tw/fedora/linux/releases/36/Server/aarch64/os/images/pxeboot/initrd.img
wget http://free.nchc.org.tw/fedora/linux/releases/36/Server/aarch64/os/images/pxeboot/vmlinuz

cd /var/www/html
wget http://free.nchc.org.tw/fedora/linux/releases/36/Server/aarch64/iso/Fedora-Server-dvd-aarch64-36-1.5.iso
mkdir disk 
mount -o loop Fedora-Server-dvd-aarch64-36-1.5.iso disk
cp -a disk f36
umount disk</pre>



<h3 class="wp-block-heading">Grub Fedora Setting</h3>



<p>Add following grub entry text into /tftpboot/grub.cfg, thus, it can insert a &#8220;Fedora36&#8221; menu on pxe boot.</p>



<pre class="wp-block-preformatted">menuentry 'Fedora36' {
  linux f36/vmlinuz ip=dhcp inst.repo=http://10.0.0.1/f36/
  initrd f36/initrd.img
}
</pre>



<p>Ref.&nbsp;</p>



<p><a href="https://docs.centos.org/en-US/centos/install-guide/pxe-server/#sect-network-boot-setup-uefi" target="_blank" rel="noopener">https://docs.centos.org/en-US/centos/install-guide/pxe-server/#sect-network-boot-setup-uefi</a><br /><a href="https://docs.centos.org/en-US/8-docs/advanced-install/assembly_preparing-for-a-network-install/" target="_blank" rel="noopener">https://docs.centos.org/en-US/8-docs/advanced-install/assembly_preparing-for-a-network-install/</a><br /><a href="https://forums.opensuse.org/showthread.php/501075-error-cannot-find-commands-linuxefi-or-initrdefi" target="_blank" rel="noopener">https://forums.opensuse.org/showthread.php/501075-error-cannot-find-commands-linuxefi-or-initrdefi</a></p>
<p>The post <a rel="nofollow" href="https://richliu.com/2020/04/08/4263/arm64-centos8-pxe-boot/">ARM64 Centos8/Ubuntu PXE Boot Install on Ubuntu Server</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2020/04/08/4263/arm64-centos8-pxe-boot/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
