<?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>Soul Of Free Loop &#187; armhf</title>
	<atom:link href="https://zohead.com/archives/tag/armhf/feed" rel="self" type="application/rss+xml" />
	<link>https://zohead.com</link>
	<description>Uranus Zhou&#039;s Blog</description>
	<lastBuildDate>Sat, 19 Jul 2025 15:42:46 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8</generator>
	<item>
		<title>ARM64 Linux下ARM容器使用yum的问题</title>
		<link>https://zohead.com/archives/arm64-arm-container-yum/</link>
		<comments>https://zohead.com/archives/arm64-arm-container-yum/#comments</comments>
		<pubDate>Thu, 29 Oct 2020 16:52:31 +0000</pubDate>
		<dc:creator><![CDATA[Uranus Zhou]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[aarch64]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[ARM64]]></category>
		<category><![CDATA[armhf]]></category>
		<category><![CDATA[RPM]]></category>
		<category><![CDATA[YUM]]></category>
		<category><![CDATA[容器]]></category>

		<guid isPermaLink="false">https://zohead.com/?p=1689</guid>
		<description><![CDATA[ARM 容器问题 前段时间需要验证某客户的 32 位 ARM Linux 程序，由于我们只有现成的 ARM64 设备和系统，而 ARM64 兼容 32 位 armel 和 armhf，因此想到直接在 ARM64（aarch64）Linux 系统中运行 32 位 ARM（armhf）容器来进行测试。 客户程序使用的是 CentOS 7 32 位 ARM 开发环境，这里我使用 LXC 官方镜像来创建一个完整的 CentOS 7 容器系统： 32 位 ARM 容器可以正常启动，但使用 yum 安装任何软件包会报错： yum 修改 上面 yum 命令的报错提示找不到 repo 为 base/7/arm [&#8230;]]]></description>
				<content:encoded><![CDATA[<h2 id="arm-container-issue">ARM 容器问题</h2>
<p>前段时间需要验证某客户的 32 位 ARM Linux 程序，由于我们只有现成的 ARM64 设备和系统，而 ARM64 兼容 32 位 armel 和 armhf，因此想到直接在 ARM64（aarch64）Linux 系统中运行 32 位 ARM（armhf）容器来进行测试。</p>
<p>客户程序使用的是 CentOS 7 32 位 ARM 开发环境，这里我使用 LXC 官方镜像来创建一个完整的 CentOS 7 容器系统：</p>
<pre class="brush: bash; title: ; notranslate">
~ # lxc-create -n arm -t download --dir=/var/lib/lxc/arm/rootfs -- --server mirrors.tuna.tsinghua.edu.cn/lxc-images -d centos -r 7 -a armhf
</pre>
<p>32 位 ARM 容器可以正常启动，但使用 yum 安装任何软件包会报错：</p>
<pre class="brush: bash; title: ; notranslate">
bash-4.2# yum install openssh-server
Loaded plugins: fastestmirror
Determining fastest mirrors


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work &quot;fix&quot; this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=&lt;repoid&gt; ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable &lt;repoid&gt;
        or
            subscription-manager repos --disable=&lt;repoid&gt;

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=&lt;repoid&gt;.skip_if_unavailable=true

Cannot find a valid baseurl for repo: base/7/armv8l
</pre>
<h2 id="yum-patch">yum 修改</h2>
<p>上面 yum 命令的报错提示找不到 repo 为 <code>base/7/armv8l</code> 的地址，我们可以在容器中使用 <code>uname</code> 命令确认当前的系统架构为 <code>armv8l</code>（ARM64 内核运行 32 位 ARM 程序）：</p>
<pre class="brush: bash; title: ; notranslate">
bash-4.2# uname -m
armv8l
</pre>
<p>而在主机端则可以看到真正的系统架构为 <code>aarch64</code>：</p>
<pre class="brush: bash; title: ; notranslate">
~ # uname -m
aarch64
</pre>
<p>正是由于 yum 不能正确识别 <code>armv8l</code>这个特殊的系统架构，导致命令执行失败。</p>
<p>我们可以修改 <code>/usr/lib/python2.7/site-packages/rpmUtils/arch.py</code> 文件，使 yum 可以正确处理 <code>armv8l</code> 架构，以下为 patch 修改内容：</p>
<pre class="brush: diff; title: ; notranslate">
diff -rNp a/arch.py b/arch.py
*** a/arch.py   Thu Oct 29 23:46:21 2020
--- b/arch.py   Thu Oct 29 23:48:55 2020
*************** arches = {
*** 73,78 ****
--- 73,79 ----
      &quot;armv5tel&quot;: &quot;noarch&quot;,
  
      #arm hardware floating point
+     &quot;armv8l&quot;: &quot;armv7hl&quot;,
      &quot;armv7hnl&quot;: &quot;armv7hl&quot;,
      &quot;armv7hl&quot;: &quot;noarch&quot;,
  
*************** def getBaseArch(myarch=None):
*** 442,447 ****
--- 443,450 ----
          return &quot;ppc&quot;
      elif myarch.startswith(&quot;arm64&quot;):
          return &quot;arm64&quot;
+     elif myarch == &quot;armv8l&quot;:
+         return &quot;armhfp&quot;
      elif myarch.startswith(&quot;armv7h&quot;):
          return &quot;armhfp&quot;
      elif myarch.startswith(&quot;arm&quot;):
</pre>
<p>此时再运行 yum 就可以正确找到软件包了：</p>
<pre class="brush: bash; title: ; notranslate">
bash-4.2# yum install openssh-server
Loaded plugins: fastestmirror
Determining fastest mirrors
 * base: mirrors.bfsu.edu.cn
 * extras: mirrors.bfsu.edu.cn
 * updates: mirrors.bfsu.edu.cn
base                                                                                                                                                                                              | 3.6 kB  00:00:00
extras                                                                                                                                                                                            | 2.9 kB  00:00:00
updates                                                                                                                                                                                           | 2.9 kB  00:00:00
(1/4): base/7/armhfp/group_gz                                                                                                                                                                     | 153 kB  00:00:00
(2/4): extras/7/armhfp/primary_db                                                                                                                                                                 | 170 kB  00:00:00
(3/4): updates/7/armhfp/primary_db                                                                                                                                                                | 562 kB  00:00:00
(4/4): base/7/armhfp/primary_db                                                                                                                                                                   | 4.1 MB  00:00:00
Resolving Dependencies
--&gt; Running transaction check
---&gt; Package openssh-server.armv7hl 0:7.4p1-21.el7 will be installed
--&gt; Processing Dependency: libwrap.so.0 for package: openssh-server-7.4p1-21.el7.armv7hl
--&gt; Running transaction check
---&gt; Package tcp_wrappers-libs.armv7hl 0:7.6-77.el7 will be installed
--&gt; Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================================================================
 Package                                                    Arch                                             Version                                                 Repository                                     Size
=========================================================================================================================================================================================================================
Installing:
 openssh-server                                             armv7hl                                          7.4p1-21.el7                                            base                                          446 k
Installing for dependencies:
 tcp_wrappers-libs                                          armv7hl                                          7.6-77.el7                                              base                                           64 k

Transaction Summary
=========================================================================================================================================================================================================================
Install  1 Package (+1 Dependent package)

Total download size: 510 k
Installed size: 1.0 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): tcp_wrappers-libs-7.6-77.el7.armv7hl.rpm                                                                                                                                                   |  64 kB  00:00:00
(2/2): openssh-server-7.4p1-21.el7.armv7hl.rpm                                                                                                                                                    | 446 kB  00:00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                    1.7 MB/s | 510 kB  00:00:00
Running transaction check
Running transaction test


Transaction check error:
  package tcp_wrappers-libs-7.6-77.el7.armv7hl is intended for a different architecture
  package openssh-server-7.4p1-21.el7.armv7hl is intended for a different architecture
</pre>
<p>不过这次轮到 rpm 报错了，提示 RPM 包的架构不相符。</p>
<h2 id="rpm-patch">rpm 修改</h2>
<p>我们先试着手工安装 yum 下载下来但安装失败的 RPM 包，可以看到还是相同的报错：</p>
<pre class="brush: bash; title: ; notranslate">
bash-4.2# rpm -ivh /var/cache/yum/armhfp/7/base/packages/tcp_wrappers-libs-7.6-77.el7.armv7hl.rpm
Preparing...                          ################################# [100%]
        package tcp_wrappers-libs-7.6-77.el7.armv7hl is intended for a different architecture
</pre>
<p>这也是由于 rpm 命令不能正确处理 <code>armv8l</code> 架构，其实对于这种 RPM 包的架构不相符的情况，我们可以为 rpm 命令增加 <code>--ignorearch</code> 参数强制安装：</p>
<pre class="brush: bash; title: ; notranslate">
bash-4.2# rpm -ivh --ignorearch /var/cache/yum/armhfp/7/base/packages/tcp_wrappers-libs-7.6-77.el7.armv7hl.rpm
Preparing...                          ################################# [100%]
Updating / installing...
   1:tcp_wrappers-libs-7.6-77.el7     ################################# [100%]
</pre>
<p>当然我们的最终目的是要让 yum 能够自动安装软件包，因此还需要让 rpm 命令也能正确识别 <code>armv8l</code> 架构。</p>
<p>为此我们需要修改 <code>/usr/lib/rpm/rpmrc</code> 文件，将 <code>armv8l</code> 视为 <code>armv7hnl</code>：</p>
<pre class="brush: diff; title: ; notranslate">
diff -rNp a/rpmrc b/rpmrc 
*** a/rpmrc     Fri Oct 30 00:15:17 2020
--- b/rpmrc     Fri Oct 30 00:16:32 2020
*************** arch_compat: armv5tel: armv4tl
*** 398,403 ****
--- 398,404 ----
  arch_compat: armv4tl: armv4l
  arch_compat: armv4l: armv3l
  arch_compat: armv3l: noarch
+ arch_compat: armv8l: armv7hnl
  arch_compat: armv7hnl: armv7hl
  arch_compat: armv7hl: noarch
</pre>
<p>此时我们再使用 yum 命令就可以正确下载和安装软件包了：</p>
<pre class="brush: bash; title: ; notranslate">
bash-4.2# yum install openssh-server
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.bfsu.edu.cn
 * extras: mirrors.bfsu.edu.cn
 * updates: mirrors.bfsu.edu.cn
Resolving Dependencies
--&gt; Running transaction check
---&gt; Package openssh-server.armv7hl 0:7.4p1-21.el7 will be installed
--&gt; Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================================================================
 Package                                                  Arch                                              Version                                                 Repository                                      Size
=========================================================================================================================================================================================================================
Installing:
 openssh-server                                           armv7hl                                           7.4p1-21.el7                                            base                                           446 k

Transaction Summary
=========================================================================================================================================================================================================================
Install  1 Package

Total size: 446 k
Installed size: 921 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : openssh-server-7.4p1-21.el7.armv7hl                                                                                                                                                                   1/1
  Verifying  : openssh-server-7.4p1-21.el7.armv7hl                                                                                                                                                                   1/1

Installed:
  openssh-server.armv7hl 0:7.4p1-21.el7

Complete!
</pre>
<p>后续安装其它软件包也都没有问题了，例如安装基础开发包：</p>
<pre class="brush: bash; title: ; notranslate">
bash-4.2# yum -y install gcc make openssl-devel glibc-static openssl-static
</pre>
]]></content:encoded>
			<wfw:commentRss>https://zohead.com/archives/arm64-arm-container-yum/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>为ARM Chromium增加Flash和Netflix支持</title>
		<link>https://zohead.com/archives/arm-chrome-flash/</link>
		<comments>https://zohead.com/archives/arm-chrome-flash/#comments</comments>
		<pubDate>Tue, 20 Jan 2015 14:57:10 +0000</pubDate>
		<dc:creator><![CDATA[Uranus Zhou]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[armhf]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Chromium]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Netflix]]></category>
		<category><![CDATA[PPAPI]]></category>

		<guid isPermaLink="false">http://zohead.com/?p=840</guid>
		<description><![CDATA[最近在 Android 4.4 上通过 Linux Deploy 运行了 armhf 版本的 Ubuntu 14.04 系统，使用 Android XServer XSDL 作为 X11 服务器跑 LXDE 的效果还是可以的。在 Ubuntu 系统上安装了最新 Chromium 浏览器之后一般的使用看起来也没有什么问题了，但感觉 ARM 上的 Chromium 浏览器缺少 Flash 播放器支持还是有点遗憾的。 由于 Adobe 对 Linux 上的 Flash Player 不上心，x86 Linux 版本的 Flash Player 也只更新到 11.2 版本就不更新了，更郁闷的还是 Ad [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>最近在 Android 4.4 上通过 Linux Deploy 运行了 armhf 版本的 Ubuntu 14.04 系统，使用 Android XServer XSDL 作为 X11 服务器跑 LXDE 的效果还是可以的。在 Ubuntu 系统上安装了最新 Chromium 浏览器之后一般的使用看起来也没有什么问题了，但感觉 ARM 上的 Chromium 浏览器缺少 Flash 播放器支持还是有点遗憾的。</p>
<p>由于 Adobe 对 Linux 上的 Flash Player 不上心，x86 Linux 版本的 Flash Player 也只更新到 11.2 版本就不更新了，更郁闷的还是 Adobe 根本就没正式释放出 armhf 版本的 libflashplayer.so。还好 Google 为新的 Chrome 浏览器默认提供 PPAPI 形式的 Flash 替代老的 NPAPI 形式插件，并不断在继续更新，PPAPI 模式的 Flash 外挂插件也放到沙盒里运行保证浏览器安全性。</p>
<p>Google 虽然没有直接提供 armhf Linux 系统的 Flash 插件，但其力推的 ChromeOS 系统中却直接集成了 PPAPI Flash 插件，我们从 ARM 版本的 Chromebook 系统中导出对应的 libpepflashplayer.so 应该就可以在普通 armhf Linux 系统中使用。</p>
<p>首先从这个网址下载 ARM Chromebook 中导出的 PPAPI Flash 插件：</p>
<p><a href="http://odroidxu.leeharris.me.uk/PepperFlash-12.0.0.77-armv7h.tar.gz" target="_blank">http://odroidxu.leeharris.me.uk/PepperFlash-12.0.0.77-armv7h.tar.gz</a></p>
<p>这个网站同时提供了 <a href="http://odroidxu.leeharris.me.uk/PepperFlash-15.0.0.152.r2-armv7h.tar.gz" target="_blank">15.0.0.152</a> 版本的 PPAPI Flash 插件，只是此版本的 Flash 插件需要 GLIBCXX_3.4.20 支持，Ubuntu 14.04 系统的版本才是 GLIBCXX_3.4.19 而无法使用，如果你使用的是更新版本的 Linux 系统可以直接下载使用 15.0.0.152 版本。</p>
<p>下载之后可以看到里面有 libpepflashplayer.so 文件，另外还有 ChromeOS 中同时增加的 libnetflixhelper.so 插件（提供 Netflix 媒体支持）。为方便起见，这里准备将 Flash 和 Netflix 支持同时在 ARM Linux 系统中开启。</p>
<p>首先切换为 root 账户将 libpepflashplayer.so 和 libnetflixhelper.so 文件放到 /usr/lib/chromium-browser/pepper 目录（没有则可以手工创建此目录）中，然后修改 <strong>/etc/chromium-browser/default</strong> 配置文件使 Chromium 浏览器在启动时自动加载对应的 PPAPI 插件：</p>
<pre class="brush: bash; title: /etc/chromium-browser/default; notranslate">
# Options to pass to chromium-browser
IFS=&quot;	&quot;
CHROMIUM_FLAGS=&quot;--ppapi-flash-path=/usr/lib/chromium-browser/pepper/libpepflashplayer.so	--ppapi-flash-version=12.0.0.77	--register-pepper-plugins=/usr/lib/chromium-browser/pepper/libnetflixhelper.so#Netflix Helper#Helper plugin for the Netflix application#1.0.3;application/x-ppapi-netflixhelper&quot;
</pre>
<p>需要特别注意的是上面的 Chromium 浏览器参数中含有空格（Netflix 插件名称等），会导致 Chromium 启动脚本解析出错，所以这里需要修改 IFS 分隔符为 TAB 键，CHROMIUM_FLAGS 变量中多个参数也必须以实际的 TAB 键（不可使用空格）隔开的，否则 Chromium 启动运行时会出现参数错误的问题。</p>
<p>另外由于 Flash 插件默认就已经在 Chromium 浏览器的 PPAPI 插件白名单中，因此不需要通过特殊参数注册 PPAPI 插件，直接使用 <strong>--ppapi-flash-path</strong> 参数指定 PPAPI Flash 插件文件路径就可以使用了。Netflix 插件则不在白名单中（推测 ChromeOS 浏览器的白名单中已经默认包含 Netflix 了），必须使用 <strong>--register-pepper-plugins</strong> 参数注册插件才可以正常使用。</p>
<p>配置文件修改完成之后，没有什么问题的话以非 root 账户身份重启 Chromium 浏览器，在地址栏中输入：<strong>chrome://plugins</strong> 就可以看到当前加载的插件列表了。</p>
<div style="width: 568px" class="wp-caption alignnone"><a href="http://res.cloudinary.com/digwht2y0/image/upload/v1737370805/chrome-ppapi-plugin.jpg" target="_blank"><img alt="Chromium插件列表" src="http://res.cloudinary.com/digwht2y0/image/upload/v1737370805/chrome-ppapi-plugin.jpg" width="558" height="449" /></a><p class="wp-caption-text">Chromium插件列表</p></div>
<p>如意料中 Flash 和 Neflix 插件已经加载成功了，下面直接找个 Flash 游戏网页测试下就可以了，Flash 视频的播放效果虽然在 armhf 系统下不咋地，但也是可以用起来了，玩的开心 ^_^</p>
]]></content:encoded>
			<wfw:commentRss>https://zohead.com/archives/arm-chrome-flash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
