<?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; Ubuntu</title>
	<atom:link href="https://zohead.com/archives/category/technology/linux/ubuntu/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>Bluemix容器系统更新udev的问题</title>
		<link>https://zohead.com/archives/bluemix-udev/</link>
		<comments>https://zohead.com/archives/bluemix-udev/#comments</comments>
		<pubDate>Tue, 29 Nov 2016 14:18:02 +0000</pubDate>
		<dc:creator><![CDATA[Uranus Zhou]]></dc:creator>
				<category><![CDATA[Docker]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Bluemix]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[udev]]></category>
		<category><![CDATA[容器]]></category>

		<guid isPermaLink="false">https://zohead.com/?p=1306</guid>
		<description><![CDATA[Bluemix 更新 udev 的问题 最近在 IBM Bluemix 管理控制台中查看容器状态时发现一直会报 策略违例 问题，进入容器详细信息界面，可以看到漏洞顾问程序扫描到的容器系统中存在的违例情况，主要是系统中某些软件包版本比较老，Bluemix 建议进行安全更新升级： 由于我的 Bluemix 容器使用的是 Ubuntu 14.04 系统，起初想着直接运行 apt-get 命令将系统中的软件包都进行升级应该就差不多可以搞定了： 但是在升级 udev 软件包的时候发现能正确下载软件包但升级失败，提示 /etc/modprobe.d 内核模块配置目录无法正常写入： 我如果跳过升级 udev [&#8230;]]]></description>
				<content:encoded><![CDATA[<h2 id="bluemix-update-udev-issue">Bluemix 更新 udev 的问题</h2>
<p>最近在 IBM Bluemix 管理控制台中查看容器状态时发现一直会报 策略违例 问题，进入容器详细信息界面，可以看到漏洞顾问程序扫描到的容器系统中存在的违例情况，主要是系统中某些软件包版本比较老，Bluemix 建议进行安全更新升级：</p>
<p><img src="http://res.cloudinary.com/digwht2y0/image/upload/v1737370618/bluemix-violation.jpg" alt="Bluemix容器策略违例" title="Bluemix容器策略违例"></p>
<p>由于我的 Bluemix 容器使用的是 Ubuntu 14.04 系统，起初想着直接运行 <code>apt-get</code> 命令将系统中的软件包都进行升级应该就差不多可以搞定了：</p>
<pre class="brush: bash; title: ; notranslate">
root@instance-007a20ff:~# apt-get update
root@instance-007a20ff:~# apt-get upgrade
</pre>
<p>但是在升级 udev 软件包的时候发现能正确下载软件包但升级失败，提示 <code>/etc/modprobe.d</code> 内核模块配置目录无法正常写入：</p>
<pre class="brush: bash; title: ; notranslate">
root@instance-007a20ff:~# apt-get install udev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  udev
1 upgraded, 0 newly installed, 0 to remove and 26 not upgraded.
28 not fully installed or removed.
Need to get 735 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main udev amd64 204-5ubuntu20.19 [735 kB]
Fetched 735 kB in 1s (437 kB/s)
(Reading database ... 30255 files and directories currently installed.)
Preparing to unpack .../udev_204-5ubuntu20.19_amd64.deb ...
Adding 'diversion of /bin/udevadm to /bin/udevadm.upgrade by fake-udev'
Unpacking udev (204-5ubuntu20.19) over (204-5ubuntu20.15) ...
dpkg: error processing archive /var/cache/apt/archives/udev_204-5ubuntu20.19_amd64.deb (--unpack):
 unable to create `/etc/modprobe.d/fbdev-blacklist.conf.dpkg-new' (while processing `./etc/modprobe.d/fbdev-blacklist.conf'): Permission denied
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Removing 'diversion of /bin/udevadm to /bin/udevadm.upgrade by fake-udev'
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
 /var/cache/apt/archives/udev_204-5ubuntu20.19_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
</pre>
<p>我如果跳过升级 udev 包，又会由于 cpio 等软件包依赖新版本的 udev 包导致其它的软件包也无法正常升级，因此最好能解决 udev 包的升级问题。</p>
<p>接着我测试在报错的 <code>/etc/modprobe.d</code> 目录中创建文件或者拷贝文件，发现始终都是报 Permission denied 错误。看起来很有可能是由于 Bluemix 容器的限制导致无法在该目录中进行写操作。要解决 udev 包升级的问题看来需要重新打包 udev 进行安装。</p>
<h2 id="repack-udev">重新打包 udev</h2>
<p>首先使用 <code>apt-get</code> 命令下载最新版本的 udev 安装包：</p>
<pre class="brush: bash; title: ; notranslate">
root@instance-007a20ff:~# apt-get download udev
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main udev amd64 204-5ubuntu20.19 [735 kB]
Fetched 735 kB in 0s (905 kB/s)
</pre>
<p>创建用于解压缩及重新构建 deb 包的目录：</p>
<pre class="brush: bash; title: ; notranslate">
root@instance-007a20ff:~# mkdir extract extract/DEBIAN build
</pre>
<p>开始解压缩 deb 安装包中的文件以及专用的 control 文件：</p>
<pre class="brush: bash; title: ; notranslate">
root@instance-007a20ff:~# dpkg -X udev_204-5ubuntu20.19_amd64.deb extract/
root@instance-007a20ff:~# dpkg -e udev_204-5ubuntu20.19_amd64.deb extract/DEBIAN/
</pre>
<p>接着就可以删除不需要的 <code>fbdev-blacklist.conf</code> 文件了，需要注意的是 control 目录中也需要移除对应项：</p>
<pre class="brush: bash; title: ; notranslate">
root@instance-007a20ff:~# rm -f extract/etc/modprobe.d/fbdev-blacklist.conf
root@instance-007a20ff:~# sed -i '/fbdev-blacklist.conf/d' extract/DEBIAN/conffiles
</pre>
<p>最后就可以打包新的 deb 安装文件了：</p>
<pre class="brush: bash; title: ; notranslate">
root@instance-007a20ff:~# dpkg-deb -b extract build
dpkg-deb: warning: 'extract/DEBIAN/control' contains user-defined field 'Original-Maintainer'
dpkg-deb: warning: ignoring 1 warning about the control file(s)

dpkg-deb: building package `udev' in `build/udev_204-5ubuntu20.19_amd64.deb'.
</pre>
<h2 id="upgrade-udev">升级 udev 相关软件包</h2>
<p>到这一步就可以直接用 dpkg 命令安装我们重新打包的 udev 安装文件了：</p>
<pre class="brush: bash; title: ; notranslate">
root@instance-007a20ff:~# dpkg -i build/udev_204-5ubuntu20.19_amd64.deb
(Reading database ... 30255 files and directories currently installed.)
Preparing to unpack .../udev_204-5ubuntu20.19_amd64.deb ...
Adding 'diversion of /bin/udevadm to /bin/udevadm.upgrade by fake-udev'
Unpacking udev (204-5ubuntu20.19) over (204-5ubuntu20.15) ...
dpkg: dependency problems prevent configuration of udev:
 udev depends on libdbus-1-3 (&gt;= 1.0.2); however:
  Package libdbus-1-3:amd64 is not configured yet.
 udev depends on libudev1 (= 204-5ubuntu20.19); however:
  Package libudev1:amd64 is not configured yet.

dpkg: error processing package udev (--install):
 dependency problems - leaving unconfigured
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Errors were encountered while processing:
 udev
</pre>
<p>这里的报错信息可以先不用管，后面我们再运行 <code>apt-get upgrade</code> 命令升级完其它的软件包就没有问题了。此时用 dpkg 命令就可以检查新的 udev 包状态：</p>
<pre class="brush: bash; title: ; notranslate">
root@instance-007a20ff:~# dpkg -l udev
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                   Version          Architecture     Description
+++-======================-================-================-=================================================
ii  udev                   204-5ubuntu20.19 amd64            /dev/ and hotplug management daemon
</pre>
<p>将 Bluemix 报告的有安全风险的软件包都进行升级，等到 Bluemix 重新进行漏洞扫描之后，再访问管理控制台就可以看到 Ubuntu 容器系统已经不会报策略违例了。</p>
]]></content:encoded>
			<wfw:commentRss>https://zohead.com/archives/bluemix-udev/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Win10年度更新开启Bash on Ubuntu</title>
		<link>https://zohead.com/archives/win10-bash-ubuntu/</link>
		<comments>https://zohead.com/archives/win10-bash-ubuntu/#comments</comments>
		<pubDate>Sat, 06 Aug 2016 17:41:05 +0000</pubDate>
		<dc:creator><![CDATA[Uranus Zhou]]></dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Redstone]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[Win10]]></category>
		<category><![CDATA[备份]]></category>

		<guid isPermaLink="false">https://zohead.com/?p=1262</guid>
		<description><![CDATA[关于 Bash on Ubuntu 之前为了能在 Windows 上使用 Bash 等类似 Unix（Linux）系统的体验，我都是安装了 Cygwin、MSYS 等运行环境，都体验上都存在一些问题：Cygwin 上的程序基本都需要重新编译出基于其运行库（cygwin1.dll）的版本，MSYS 虽然提供了 Linux 下常用的开发工具链、移植过的运行库等等，但基本还是受限于 Windows API 本身的。 当我看到 Windows 10 Build 14316 内部预览版时爆出的 Bash on Ubuntu 功能之后还是比较期待的，因为微软并不是以虚拟机的方式运行 Ubuntu 系统，而 [&#8230;]]]></description>
				<content:encoded><![CDATA[<h2 id="关于-bash-on-ubuntu">关于 Bash on Ubuntu</h2>
<p>之前为了能在 Windows 上使用 Bash 等类似 Unix（Linux）系统的体验，我都是安装了 Cygwin、MSYS 等运行环境，都体验上都存在一些问题：Cygwin 上的程序基本都需要重新编译出基于其运行库（cygwin1.dll）的版本，MSYS 虽然提供了 Linux 下常用的开发工具链、移植过的运行库等等，但基本还是受限于 Windows API 本身的。</p>
<p>当我看到 Windows 10 Build 14316 内部预览版时爆出的 Bash on Ubuntu 功能之后还是比较期待的，因为微软并不是以虚拟机的方式运行 Ubuntu 系统，而是直接集成了新的 <strong><a href="https://blogs.msdn.microsoft.com/wsl/">Windows Subsystem for Linux</a></strong> 子系统，这样能直接在 Bash on Ubuntu 环境里编译运行 Linux 程序还是非常方便的。</p>
<p>考虑到预览版稳定性的问题，我一直没有加入 Win10 Insider 预览体验会员，这几天看到 Win10 Redstone 1 年度更新到来之后终于可以直接体验了。虽然我使用的 Win10 企业版一直接收不到更新推送，而且使用微软官方的 Media Creation Tool 也无法在企业版上更新，但还好还是可以直接下载 Redstone 1 企业版的 iso 进行更新。</p>
<h2 id="安装体验">安装体验</h2>
<p>Win10 年度更新的持续数小时的痛苦安装过程这里就不表了，更新完成后首先在设置中开启开发者支持，然后在 控制面板 - 程序和功能 中开启 <strong>Windows Subsystem for Linux</strong> 功能，开启之后需要重启系统，重启之后在命令行中运行 <strong>bash</strong> 命令下载安装，根据你的网络情况可能又需要一两个小时（强烈建议挂代理的），安装完成之后会提示配置用户，接着就可以正常启动 Bash on Ubuntu 了：</p>
<p><img src="http://res.cloudinary.com/digwht2y0/image/upload/v1737442968/win10-bash.jpg" alt="Bash on Ubuntu on Windows 10" title="Bash on Ubuntu on Windows 10"></p>
<p>第一步就可以先运行 <code>sudo apt-get update</code> 更新 Ubuntu 软件仓库，看起来一切正常：</p>
<p><img src="http://res.cloudinary.com/digwht2y0/image/upload/v1737442967/win10-apt-get.jpg" alt="Win10 上使用 apt-get" title="Win10 上使用 apt-get"></p>
<p>另外可以确认下 Windows 10 上运行的 Ubuntu 子系统的基本情况：</p>
<p><img src="http://res.cloudinary.com/digwht2y0/image/upload/v1737442968/win10-bash-kernel.jpg" alt="Windows 10 的 Linux 子系统" title="Windows 10 的 Linux 子系统"></p>
<p>从上面的截图可以看出 Bash on Ubuntu 会把所有 Windows 分区都挂载到 <code>/mnt</code> 目录下方便使用（这点和 Cygwin 的 <code>/cygdrive/c</code> 以及 MSYS 的 <code>/c</code> 路径有点类似哦），默认运行的是 Ubuntu 14.04 LTS 系统，用户看到的 Linux kernel 是 3.4.0 版本。</p>
<p>接着就可以安装运行一些常用的 Linux 命令了，awk、sed、svn、git 等和系统内核关系不大的命令都能正常工作，<code>ifconfig</code> 和 <code>ping</code> 等命令会运行失败，体验一圈下来还是能满足我的使用需求的。</p>
<h2 id="rsync-备份性能测试">rsync 备份性能测试</h2>
<p>我之前写过一篇文章 <a href="https://zohead.com/archives/rsync-performance-linux-cygwin-msys/">rsync在 Linux/cygwin/msys 环境下的备份性能对比</a> 对比 Linux 原生的 rsync 命令和 Windows 上几种常见的非原生 rsync 实现的备份性能，结果不出意外 Linux 原生 rsync 的效果是最好的。</p>
<p>现在既然 Win10 已经支持了还算完整的 Ubuntu 子系统，那么我就可以拿 Ubuntu 子系统里的 rsync 命令来测试一下备份文件的性能到底如何了，而且这里值得一提的是 Bash on Ubuntu 安装好之后就已经自带 rsync 命令了（没有也可以妥妥的 apt-get 自动安装哦）。</p>
<p>先看看 Bash on Ubuntu 自带的 rsync 命令是 3.1.0 版本的，可以直接和我们目前使用的存储服务器配合测试：</p>
<p><img src="http://res.cloudinary.com/digwht2y0/image/upload/v1737442969/win10-rsync.jpg" alt="rsync on Windows 10" title="rsync on Windows 10"></p>
<p>为了对比方便我在相同的客户端上分别运行 RHEL6 Linux 系统和开启了 Bash on Ubuntu 的 Win10 系统使用 rsync 命令进行文件备份的上传和下载性能测试，存储服务器上运行的是标准 rsync 服务器（没有开启 SSH 用户验证）。</p>
<p>测试中也使用和上面的备份性能对比文章相似的配置，服务器使用 24 个 SATA 盘建立 RAID0 磁盘阵列做底层存储，客户端和服务器之间都是千兆网络，客户端上的文件读写都使用内存文件系统（Linux 上使用 <code>tmpfs</code>，Windows 上使用 <code>ImDisk</code> 工具生成内存盘）防止客户端本地硬盘读写性能成为瓶颈。</p>
<p>先看看 RHEL6 Linux 系统下的 rsync 备份性能结果：</p>
<pre class="brush: bash; title: ; notranslate">
/dev/shm # rsync -hv 0.dat test@192.168.1.35::sync/
Password:
0.dat

sent 1.61G bytes  received 27 bytes  82.50M bytes/sec
total size is 1.61G  speedup is 1.00

/dev/shm # rsync -hv test@192.168.1.35::sync/0.dat .
Password:
0.dat

sent 59 bytes  received 1.61G bytes  91.93M bytes/sec
total size is 1.61G  speedup is 1.00
</pre>
<p>可以看到 Linux 系统下 rsync 写一个大概 1.6 GB 的文件可以达到 82.50 MB/s，读可以到 91.93 MB/s。</p>
<p>然后在 Win10 的 Bash 环境中同样使用自带 rsync 命令进行测试：</p>
<pre class="brush: bash; title: ; notranslate">
zzm@ZZM-VOLANS:~$ rsync -hv 1.dat 192.168.1.35::sync/
1.dat

sent 1.57G bytes  received 30 bytes  89.90M bytes/sec
total size is 1.57G  speedup is 1.00

zzm@ZZM-VOLANS:/mnt/h$ rsync -hv 192.168.1.35::sync/1.dat .
1.dat

sent 45 bytes  received 1.57G bytes  95.34M bytes/sec
total size is 1.57G  speedup is 1.00
</pre>
<p>看起来结果还是比较惊喜的，Win10 Bash 上的 rsync 命令可以基本跑满千兆网卡的带宽，备份性能甚至比 Linux 上的效果还好了那么一点点。这样不得不说我之前写的那篇文章里总结的 Windows 推荐使用 Cygwin 做 rsync 客户端的建议在 Bash on Ubuntu 推出之后就要过时咯。</p>
<h2 id="总结">总结</h2>
<p>从 Win10 年度更新的简单试用和性能测试情况来看，Bash on Ubuntu 目前还算比较符合我的预期的，毕竟我最想要的直接在 Windows 上编译 Linux 二进制程序就更加方便了，看起来也不需要专门开虚拟机来进行编译工作中需要用到的 Linux 内核和应用程序了。当然目前 Bash on Ubuntu 仍然有不少问题和限制（毕竟还是 beta 阶段），还是希望微软能在后续更新中解决咯，祝大家玩的开心。</p>
]]></content:encoded>
			<wfw:commentRss>https://zohead.com/archives/win10-bash-ubuntu/feed/</wfw:commentRss>
		<slash:comments>2</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>
		<item>
		<title>解决chroot Linux中Upstart无法工作的问题</title>
		<link>https://zohead.com/archives/chroot-linux-upstart/</link>
		<comments>https://zohead.com/archives/chroot-linux-upstart/#comments</comments>
		<pubDate>Wed, 03 Apr 2013 12:51:16 +0000</pubDate>
		<dc:creator><![CDATA[Uranus Zhou]]></dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[12.04]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[chroot]]></category>
		<category><![CDATA[dbus]]></category>
		<category><![CDATA[init]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[start-stop-daemon]]></category>
		<category><![CDATA[Upstart]]></category>

		<guid isPermaLink="false">http://zohead.com/?p=391</guid>
		<description><![CDATA[本文同步自（最佳显示效果请点击）：https://zohead.com/archives/chroot-linux-upstart/ Upstart 是比较新的 Linux 中使用的 init 进程，用于替换原始的通过 /etc/inittab 控制的 /sbin/init 进程。原始的 /sbin/init 进程在系统启动时启动服务，在系统重启或关闭时关闭服务。而 Ubuntu 从 6.10 开始已经不再使用老的 init 进程方式，改为新的 Upstart 方式。Upstart 完全可以替代原始 init 进程（实际上 Upstart 就是新的 init 进程），而且还可以做到特定事件触发 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>本文同步自（最佳显示效果请点击）：<a href="https://zohead.com/archives/chroot-linux-upstart/" target="_blank">https://zohead.com/archives/chroot-linux-upstart/</a></p>
<p>Upstart 是比较新的 Linux 中使用的 init 进程，用于替换原始的通过 /etc/inittab 控制的 /sbin/init 进程。原始的 /sbin/init 进程在系统启动时启动服务，在系统重启或关闭时关闭服务。而 Ubuntu 从 6.10 开始已经不再使用老的 init 进程方式，改为新的 Upstart 方式。Upstart 完全可以替代原始 init 进程（实际上 Upstart 就是新的 init 进程），而且还可以做到特定事件触发启动或停止服务等操作，相对于原始 init 进程是一大改善。</p>
<p>这里不打算对 Linux init 进程的作用和启动处理流程做太多介绍，有关 Upstart 的详细信息请参考 Ubuntu 网站上的介绍：</p>
<p><a href="http://upstart.ubuntu.com/" target="_blank">http://upstart.ubuntu.com/</a></p>
<p>笔者最近在使用一个 chroot 的 Ubuntu 12.04 系统（主系统为 Android 4.0.4，不是普通的 Linux 桌面或服务器发行版）时发现 Upstart 无法正常工作，具体表现为 service xxx start、invoke-rc.d 等服务控制的命令无法正常工作，启动或停止服务时会报下面的错误：</p>
<p><strong>start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused</strong></p>
<p>即使直接通过运行：/etc/init.d/xxx start，这样也会报同样的错误。</p>
<p>由于 Upstart 需要使用 dbus 进行通讯，我就做进一步的检查，发现 dbus-daemon 是正常启动的，其它依赖 dbus 的程序看起来也能正常工作的。仔细想想之后差不多明白了，Upstart 需要新的 /sbin/init 进程和 dbus 通讯以进行服务控制，但现在我使用的主系统为 Android 系统，init 进程明显不是 Upstart。现在 Ubuntu 系统是通过 chroot 运行的，对于 Ubuntu 系统来说，其内置的 Upstart init 进程是不起作用的，所以所有服务的控制操作都不能正常运行，这是比较麻烦的。</p>
<p>再做搜寻之后发现国外一哥们 Péter Gy?ngy?si 写的这篇文章：</p>
<p><a href="http://gyp.blogs.balabit.com/2011/01/using-upstart-in-a-chroot/" target="_blank">http://gyp.blogs.balabit.com/2011/01/using-upstart-in-a-chroot/</a></p>
<p>在这边文章里，作者写到他也遇到在 chroot 中 Upstart 无法正常工作的问题。他的解决方法不是像网上其它人说的那样修改 /sbin/initctl 指向 /bin/true 使某些程序不报错的方法（其实并没有解决问题），可以参考这里：</p>
<p><a href="https://www.nesono.com/node/368" target="_blank">https://www.nesono.com/node/368</a></p>
<p>该作者通过自己写了一个 Python 脚本来替换 /sbin/initctl 程序来达到控制服务启动、停止等操作，这样运行 service xxx start 就可以工作正常。但这个 Python 脚本存在无法记录启动的服务的 PID 的问题，这样运行 service xxx stop 就无法正常停止服务了。为此，该作者通过修改系统内置的 start-stop-daemon 程序来达到记录 PID 的效果，这样就可以正常通过 service、invoke-rc.d 等命令启动和停止服务。</p>
<p>作者提供的 chroot Upstart 替换脚本可以在这里下载（直接将 /sbin/initctl 替换为 Python 脚本，其它相关文件也放在 /sbin 下）：</p>
<p><a href="http://git.balabit.hu/?p=gyp/upstart-dummy.git" target="_blank">http://git.balabit.hu/?p=gyp/upstart-dummy.git</a></p>
<p>start-stop-daemon 程序的 patch 在这里：</p>
<p><a href="http://people.balabit.hu/gyp/blog/dpkg_start_stop_daemon_tracepid.diff" target="_blank">http://people.balabit.hu/gyp/blog/dpkg_start_stop_daemon_tracepid.diff</a></p>
<p>不过需要说明的是，上面的 patch 是针对老的 Ubuntu 系统的，在 Ubuntu 12.04 中无法使用，Ubuntu 12.04 系统中 start-stop-daemon 已经增加了 “-T” 参数与 patch 中的会有冲突，同时 patch 中还有别的问题。</p>
<p>我通过下载 Ubuntu 12.04 官方的 dpkg 程序源代码，然后在上面的 patch 基础上进一步做了修改，将 patch 中的 “-T” 参数改为 “-Z” 参数，并做了进一步的修正，成功编译出 Ubuntu 12.04 32 位系统中可以用的替换 start-stop-daemon 程序。经过测试，新的 Upstart 脚本和 start-stop-daemon 可以实现我的需求：在 chroot 运行的 Ubuntu 系统可以正常启动和停止服务。</p>
<p>这里是我编译出的 32 位 Ubuntu 12.04 系统中可以用的 start-stop-daemon 程序：</p>
<p><a href="http://miseal.googlecode.com/files/start-stop-daemon_precise_i386.7z" target="_blank">http://miseal.googlecode.com/files/start-stop-daemon_precise_i386.7z</a></p>
<p>此文章为我实际使用经验所写，特别感谢 Péter Gyöngyösi 的替换 Upstart 脚本，其中有任何问题欢迎提出指正哦~~~</p>
]]></content:encoded>
			<wfw:commentRss>https://zohead.com/archives/chroot-linux-upstart/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>在XOLO X900上实现Ubuntu for Android</title>
		<link>https://zohead.com/archives/ubuntu-for-xolo-x900/</link>
		<comments>https://zohead.com/archives/ubuntu-for-xolo-x900/#comments</comments>
		<pubDate>Sun, 06 Jan 2013 19:19:49 +0000</pubDate>
		<dc:creator><![CDATA[Uranus Zhou]]></dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[手机]]></category>
		<category><![CDATA[技术]]></category>
		<category><![CDATA[12.04]]></category>
		<category><![CDATA[Atom]]></category>
		<category><![CDATA[DisplayLink]]></category>
		<category><![CDATA[HDMI]]></category>
		<category><![CDATA[Intel]]></category>
		<category><![CDATA[LapDock]]></category>
		<category><![CDATA[Lava]]></category>
		<category><![CDATA[Motorola]]></category>
		<category><![CDATA[OTG]]></category>
		<category><![CDATA[Ubuntu for Android]]></category>
		<category><![CDATA[udlfb]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[X11]]></category>
		<category><![CDATA[x86]]></category>
		<category><![CDATA[X900]]></category>
		<category><![CDATA[XOLO]]></category>
		<category><![CDATA[Xorg]]></category>
		<category><![CDATA[显卡]]></category>

		<guid isPermaLink="false">http://zohead.com/?p=378</guid>
		<description><![CDATA[本文同步自（最佳显示效果请点击）：https://zohead.com/archives/ubuntu-for-xolo-x900/ 由于 Lava XOLO X900 使用的 Intel Atom Z2460 这一 x86 的 CPU，我们就可以做一些改动，让其实现初步的 Ubuntu for Android 效果，而且运行的是 x86 版本的 Ubuntu，相对于 ARM 版本（不能运行私有软件，没有源代码的话啥都干不了）来说实用性要好很多的。 先看看实际的效果图： 现在我在这个 Android 手机里的 Ubuntu 上已经开始正常运行 Skype、Ubuntu One、sopcast  [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>本文同步自（最佳显示效果请点击）：<a href="https://zohead.com/archives/ubuntu-for-xolo-x900/" target="_blank">https://zohead.com/archives/ubuntu-for-xolo-x900/</a></p>
<p>由于 Lava XOLO X900 使用的 Intel Atom Z2460 这一 x86 的 CPU，我们就可以做一些改动，让其实现初步的 Ubuntu for Android 效果，而且运行的是 x86 版本的 Ubuntu，相对于 ARM 版本（不能运行私有软件，没有源代码的话啥都干不了）来说实用性要好很多的。</p>
<p>先看看实际的效果图：</p>
<p><a href="http://zohead.com/wp-content/uploads/ubuntu-android-x900.jpg" target="_blank"><img class="alignnone" title="Ubuntu for Android on XOLO X900" src="http://zohead.com/wp-content/uploads/ubuntu-android-x900.jpg" alt="Ubuntu for Android on XOLO X900" width="690" height="523" /></a></p>
<p>现在我在这个 Android 手机里的 Ubuntu 上已经开始正常运行 Skype、Ubuntu One、sopcast 等应用，而且 Ubuntu 和 Android 系统是共存同时运行的，Ubuntu 是运行在外部屏幕上的，对 Android 完全没有影响，不需要 VNC 登录之类的。</p>
<p>Canonical 公司提出的 Ubuntu for Android 请参考这里：</p>
<p><a href="http://www.ubuntu.com/devices/android" target="_blank">http://www.ubuntu.com/devices/android</a></p>
<p>这里提到的 Canonical 的 Ubuntu for Android 的要求有：</p>
<ul>
<li>双核手机，内存最少 512MB；</li>
<li>支持 secondary frame buffer；</li>
<li>支持 USB OTG</li>
</ul>
<p>对于 XOLO X900 来说，第二点要求 secondary frame buffer 暂时无法满足，因为官方的 kernel 只注册了 <strong>/dev/graphics/fb0</strong> 一个 frame buffer 设备。但由于支持 USB OTG，我们这里暂时用支持 Linux frame buffer 的外置 USB 显卡来实现。</p>
<p>需要的设备及配件：</p>
<ul>
<li>Motorola LapDock 100（做显示器及键盘鼠标输入，同时接 USB 外置显卡，你完全可以用自己的显示器）</li>
<li>DisplayLink USB 显卡</li>
<li>USB OTG 线</li>
<li>HDMI 线</li>
</ul>
<p><strong><span style="color: #0000ff;">1、准备 x86 Ubuntu 环境：</span></strong></p>
<p>由于 XOLO X900 只有 16GB 的 ROM 空间，为了速度和扩展考虑，最好可以将 Ubuntu 安装在隐藏未启用的 microSD 插槽上，最好使用 Class 10 的 microSD，这样不会对 Ubuntu 的性能造成影响。</p>
<p>你可以参考这个视频（只有 Youtube 哈）查看如果启用隐藏的 microSD 插槽：</p>
<p><a href="http://www.youtube.com/watch?v=6-FkK7Htohs" target="_blank">http://www.youtube.com/watch?v=6-FkK7Htohs</a></p>
<p>下面是找一个合适的 Ubuntu 系统，如果你有时间的话，完全可以用 VMware 安装一个虚拟机到 SD 卡上。如果你像我一样不想浪费时间安装，可以到网上下载现成的 VMware vmdk 映像并直接拷贝到 SD 卡上。</p>
<p>我选择的是下面这个 Lubuntu 12.04 系统，因为使用 LXDE 桌面，速度比较快，这个网站也有完整的 Unity 桌面环境的 Ubuntu 12.04 系统哦：</p>
<p><a href="http://www.trendsigma.net/vmware/lubuntu1204.html" target="_blank">http://www.trendsigma.net/vmware/lubuntu1204.html</a></p>
<p>你可能需要另一个 Linux 虚拟机来将 Lubuntu 映像里的所有文件拷贝到 SD 卡里（最好能对 SD 卡进行分区，我是建立了一个 ext4 的分区）。</p>
<p><strong><span style="color: #0000ff;">2、准备需要的 DisplayLink USB 显卡驱动：</span></strong></p>
<p>由于 XOLO X900 官方 kernel 对 frame buffer 支持并不完整（缺少 defio 等支持），官方 3.0.8 kernel 源代码里的 DisplayLink USB 显卡驱动 udlfb 无法正常编译。</p>
<p>我基于下面的 udlfb 项目的 0.4 版本修改了一个新的可直接用于 XOLO X900 官方 kernel 的 udlfb 驱动（默认代码加载之后无法正常显示图像）：</p>
<p><a href="http://git.plugable.com/gitphp/index.php?p=udlfb" target="_blank">http://git.plugable.com/gitphp/index.php?p=udlfb</a></p>
<p>我修改过的 udlfb 0.4 驱动的下载地址：</p>
<p><a href="http://miseal.googlecode.com/files/udlfb-v0.4.tar.bz2" target="_blank">http://miseal.googlecode.com/files/udlfb-v0.4.tar.bz2</a></p>
<p>相对默认 0.4 版本的主要改进为：</p>
<ul>
<li>解决在 Linux 3.0.8 中无法正常编译的问题；</li>
<li>解决 kzalloc 分配内存失败的问题，以 vmalloc 替代；</li>
<li>增加卸载驱动时的释放内存处理；</li>
<li>自动根据 EDID 判断显示器分辨率，默认使用 EDID 得到的分辨率；</li>
<li>如果 EDID 无法得到合适的分辨率，使用默认 1280x1024 分辨率；</li>
<li>增加模块参数，加载模块时可以指定初始分辨率</li>
</ul>
<p>编译方法请参考之前写的编译 XOLO X900 自定义 kernel 的文章：</p>
<p><a href="https://zohead.com/archives/xolo-x900-kernel/" target="_blank">https://zohead.com/archives/xolo-x900-kernel/</a></p>
<p>如果你想直接用我编译好的，请访问此链接下载：</p>
<p><a href="http://miseal.googlecode.com/files/x900-kernel-config-modules.7z" target="_blank">http://miseal.googlecode.com/files/x900-kernel-config-modules.7z</a></p>
<p>编译好的 <strong>udlfb.ko</strong> 在解压缩出来的 <strong>modules</strong> 目录中，建议将 <strong>modules</strong> 目录拷贝到 <strong>/system/lib</strong> 目录中。</p>
<p><strong><span style="color: #0000ff;">3、测试 udlfb 驱动是否可用：</span></strong></p>
<p>通过外置带电源的 USB HUB 接上 DisplayLink USB 显卡（Motorola Lapdock 就是一个带电源的 USB HUB 哈），并将显卡接到外置显示器上，root 过之后，在 shell 中运行 <strong>su</strong> 然后运行：</p>
<p><strong>insmod /system/lib/modules/udlfb.ko</strong></p>
<p>如果一切正常的话，驱动将自动判断你的显示器分辨率，并在显示器中显示绿屏。</p>
<p>然后运行下面的命令检查 frame buffer 设备是否正常，一般应有正常的设备节点信息输出：</p>
<p><strong>ls -l /dev/graphics/fb1</strong></p>
<p>如果你的显示器不支持 EDID 或者默认的 1280x1024 分辨率不支持，也可以加载驱动时手工指定分辨率，例如：</p>
<p><strong>insmod /system/lib/modules/udlfb.ko init_xres=1024 init_yres=768</strong></p>
<p>上面的命令即将初始分辨率设置为 1024x768。</p>
<p><strong><span style="color: #0000ff;">4、屏蔽 Android 本身对 USB 键盘鼠标的支持：</span></strong></p>
<p>由于 XOLO X900 默认支持 USB OTG，通过 OTG 接上 USB 键盘鼠标之后，可以直接对 Android 进行操作，而且任何对键盘和鼠标的操作都会解锁手机，这对于我们运行 Ubuntu for Android 是毫无益处的，而且会导致重复的 input event 发到 Android 界面上。因此我们需要屏蔽 Android 本身对 USB 输入设备的支持。</p>
<p>首先接上 USB 键盘和鼠标（通过 USB HUB），并确定是哪个 input 设备，同样在 root 中 su 运行：</p>
<p><strong>ls /dev/input/event*</strong></p>
<p>你会看到很多个 event 设备，一一用下面的命令（把 X 换为具体的设备名）确定到底哪个是你所插上的 USB 键盘和鼠标，cat 之后在键盘上敲键或者移动鼠标，正确的设备将会有输出：</p>
<p><strong>cat /dev/input/eventX</strong></p>
<p>假设确定好鼠标和键盘分别为：<strong>/dev/input/event10</strong> 和 <strong>/dev/input/event11</strong>。</p>
<p>然后运行 <strong>dmesg</strong> 确定 USB 键盘和鼠标的设备名，你可以看到类似这样的输出：</p>
<pre class="brush: bash; title: ; notranslate">
usb 1-1: new high speed USB device number 2 using penwell_otg
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 7 ports detected
usb 1-1.1: new full speed USB device number 3 using penwell_otg
input: Motorola Mobility Motorola HD Dock as /devices/pci0000:00/0000:00:02.3/usb1/1-1/1-1.1/1-1.1:1.0/input/input11
generic-usb 0003:22B8:0938.0003: input,hidraw0: USB HID v1.01 Keyboard [Motorola Mobility Motorola HD Dock] on usb-0000:00:02.3-1.1/input0
usb 1-1.3: new low speed USB device number 4 using penwell_otg
input: BTC USB Cordless Mouse as /devices/pci0000:00/0000:00:02.3/usb1/1-1/1-1.3/1-1.3:1.0/input/input12
generic-usb 0003:1241:0003.0004: input,hidraw1: USB HID v1.10 Keyboard [BTC USB Cordless Mouse] on usb-0000:00:02.3-1.3/input0
input: BTC USB Cordless Mouse as /devices/pci0000:00/0000:00:02.3/usb1/1-1/1-1.3/1-1.3:1.1/input/input13
generic-usb 0003:1241:0003.0005: input,hidraw2: USB HID v1.10 Mouse [BTC USB Cordless Mouse] on usb-0000:00:02.3-1.3/input1
usb 1-1.6: new high speed USB device number 5 using penwell_otg
</pre>
<p>上面的 <strong>Motorola Mobility Motorola HD Dock</strong> 和 <strong>BTC USB Cordless Mouse</strong> 即为 USB 键盘和鼠标设备的设备名，记下这些。</p>
<p>编译 <strong>/system/etc/excluded-input-devices.xml</strong> 配置文件，将上面的 USB 键盘和鼠标设备名加入进来，然后重启手机，在 USB 输入设备上的操作就不会影响 Android 系统。</p>
<p>例如我的配置文件内容如下：</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;devices&gt;
&lt;device name=&quot;Unipoint HID&quot;/&gt;
&lt;device name=&quot;RMI4 Unipoint&quot;/&gt;
&lt;device name=&quot;Motorola Mobility Motorola HD Dock&quot;/&gt;
&lt;device name=&quot;BTC USB Cordless Mouse&quot;/&gt;
&lt;/devices&gt;
</pre>
<p><strong><span style="color: #0000ff;">5、在 Android 中切换到 Ubuntu 环境：</span></strong></p>
<p>首先 su 运行 shell 创建一个目录作为 Ubuntu 分区的挂载点（这里假设为 /system/sd）：</p>
<p><strong>mount -o remount,rw /dev/block/mmcblk0p2 /system</strong><br />
<strong> busybox mkdir -m 777 /system/sd</strong><br />
<strong> mount -o remount,ro /dev/block/mmcblk0p2 /system</strong></p>
<p>你可以使用我写好的这个切换到 Ubuntu 的脚本 <strong>startubuntu</strong>（我这里是挂载了 SD 卡第一个 ext4 分区，请根据需要自行修改）：</p>
<p><a href="http://pastebin.com/raw.php?i=9r21dR7L" target="_blank">http://pastebin.com/raw.php?i=9r21dR7L</a></p>
<p>我在脚本中将 Android 中的 /mnt/sdcard 目录挂载到了 Ubuntu 里的 /sdcard 目录，Android 系统的 /system 目录挂载到了 /android/system 目录，这样可以很方便的在 Ubuntu 中访问 Android 系统中的数据。</p>
<p><strong><span style="color: #0000ff;">6、准备运行 X 的环境：</span></strong></p>
<p>假设你已经切换到 Ubuntu，首先安装 DisplayLink 的 X 驱动：</p>
<p><strong>apt-get install xserver-xorg-video-displaylink</strong></p>
<p>然后安装输入模块：</p>
<p><strong>apt-get install xserver-xorg-input-evdev</strong></p>
<p>安装成功之后，修改 <strong>/etc/X11/xorg.conf</strong> X11 配置文件（Ubuntu 12.04 中没有这个配置文件，需要在 <strong>/usr/share/X11/xorg.conf.d</strong> 目录中自己增加新的配置文件，我的为：<strong>52-displaylink.conf</strong>），内容为下面的链接：</p>
<p><a href="http://pastebin.com/raw.php?i=WjcfFWc2" target="_blank">http://pastebin.com/raw.php?i=WjcfFWc2</a></p>
<p>注意请将其中的 input 设备和分辨率改为自己需要的。</p>
<p><strong><span style="color: #0000ff;">7、运行 X - 最终的 Ubuntu for Android：</span></strong></p>
<p>产生 X 的初始配置文件 <strong>/root/.xinitrc</strong>：</p>
<p><strong>#!/bin/sh</strong><br />
<strong> xrandr -o 0</strong><br />
<strong> startlubuntu</strong></p>
<p>第二行的 <strong>xrandr</strong> 命令是专门为 DisplayLink udlfb 驱动修改的，没有这个的话可能会导致 X 环境中的菜单项不能正确显示。第三行的 <strong>startlubuntu</strong> 你可以替换成你需要的 X 命令（例如：xinit lxsession）。</p>
<p>然后运行 <strong>startx</strong> 就可以启动 X 桌面环境了。</p>
<p>某些情况下如果这样运行 startx 还是有问题，可以在 <strong>startx</strong> 时增加参数：</p>
<p><strong>startx -- :0 vt1</strong></p>
<p>如果这样可以的话表示 X 使用的 VT 不正确，这时你可能需要将 <strong>/etc/X11/xinit/xserverrc</strong> 改为下面这样以强制指定 X 使用的 VT：</p>
<p><strong>#!/bin/sh</strong><br />
<strong> exec /usr/bin/X -nolisten tcp vt1 "$@"</strong></p>
<p>8、总结：</p>
<p>这样实现的 Ubuntu for Android 实际还是有一些不足的：</p>
<ul>
<li>必须要有外置的 USB 显卡太不方便，而且热插拔 USB 显卡会导致 X server 直接挂掉，最好的解决方案是启用 HDMI frame buffer；</li>
<li>暂时没有声音输出，可能可以用 USB 声卡，或者将声音输出至手机（能想象的到的丑陋）；</li>
<li>不支持通过 USB HUB 进行充电，应该是要修改 kernel 才能支持</li>
</ul>
<p>本文的内容均为我根据实际使用所写，没有考虑到通用的情况，其中有任何问题欢迎提出指正哦 ^_^</p>
]]></content:encoded>
			<wfw:commentRss>https://zohead.com/archives/ubuntu-for-xolo-x900/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
