<?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>Kanru&#039;s 探險日誌 &#187; Debian</title>
	<atom:link href="http://blog.kanru.info/archives/tag/debian/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.kanru.info</link>
	<description>當發現美好的事物時，所要做的第一件事，就是把它分享給所有人</description>
	<lastBuildDate>Sun, 23 May 2010 09:51:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>The good old xorg.conf and the new xorg.conf.d</title>
		<link>http://blog.kanru.info/archives/732</link>
		<comments>http://blog.kanru.info/archives/732#comments</comments>
		<pubDate>Thu, 08 Apr 2010 15:38:12 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=732</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>自從 Xorg xserver 宣佈要放棄使用 hal 的自動設定機制後，Xorg 開發者們就開始討論與實做各種可能的 config backend。最後定案的是在 Linux 上直接使用 udev 來偵測 input device，在這個後端實做的早期也想把設定的工作一起做在 udev rules 裡，但顯然這樣的做法是有其侷限的。很多人說這只是把 hal 的 .fdi 換個寫法放到 udev rules 裡罷了，同樣是對 user 極不友善的做法，而且使用 udev 在非 Linux 的平台就不能用了。</p>

<p>最後一個很聰明的辦法是把 auto probe 與 config 這兩個行為分開，讓 udev 只管找到新的裝置，config 則集中放在 xorg.conf.d 中。xorg.conf.d 中設定檔的格式和 xorg.conf 是一樣的，因此不但 code 可以重用，使用者也不用學新的語法，其他平台則可以用不同的 backend。</p>

<p>因為 udev backend 是以 Debian Developer &#8211; Julien Cristau 為主開發的, Debian 很早就可以使用 udev backend 了，最近 Debian 更從 xorg-xserver 1.8 backport 了 xorg.conf.d 的修改，所以設定方式又不太一樣了。(大概只有 Debian 是這樣一改再改吧，其他 distro 應是無痛升級)</p>

<p>參考 xorg.conf(5)，X 在啟動時會去找</p>

<p><pre class="brush: plain;">
           /etc/X11/&lt;cmdline&gt;
           /usr/etc/X11/&lt;cmdline&gt;
           /etc/X11/$XORGCONFIG
           /usr/etc/X11/$XORGCONFIG
           /etc/X11/xorg.conf-4
           /etc/X11/xorg.conf
           /etc/xorg.conf
           /usr/etc/X11/xorg.conf.&lt;hostname&gt;
           /usr/etc/X11/xorg.conf-4
           /usr/etc/X11/xorg.conf
           /usr/lib/X11/xorg.conf.&lt;hostname&gt;
           /usr/lib/X11/xorg.conf-4
           /usr/lib/X11/xorg.conf
</pre></p>

<p>這些地方的設定檔，因此設定不用全放在一個檔案裡了。這也是近來很多 daemon 要支援多重設定檔常用的方法，可以讓 vendor 或 distro 的設定與 user 的設定可以各自獨立出來。</p>

<p>接下來我們有興趣的地方是 <code>InputClass</code> 這個新的 Section，就是它讓我們可以設定隨插即用裝置。</p>

<p><pre class="brush: plain;">
           Section &quot;InputClass&quot;
               Identifier  &quot;name&quot;
               entries
               ...
               options
               ...
           EndSection
</pre></p>

<p>就像 xorg.conf 內其他 Section 一樣，<code>Identifier</code> 是必需的，我們可以用各種 Match rule 去比對裝置的特性並用 Option 加以設定。所有的 InputClass 都可以被其之後的 InputClass 取代，因此使用者可以用新設定檔取代系統的設定。</p>

<p>現在可以用的 Match rule 有</p>

<p><pre class="brush: plain;">
MatchProduct        &quot;matchproduct&quot;
MatchVendor         &quot;matchvendor&quot;
MatchDevicePath     &quot;matchdevice&quot;
MatchTag            &quot;matchtag&quot;
MatchIsKeyboard     &quot;bool&quot;
MatchIsPointer      &quot;bool&quot;
MatchIsJoystick     &quot;bool&quot;
MatchIsTablet       &quot;bool&quot;
MatchIsTouchpad     &quot;bool&quot;
MatchIsTouchscreen  &quot;bool&quot;
</pre></p>

<p>前四個可以用來 match 特定的裝置名稱、路徑，其他的則可以用來 match 一般的裝置特性如滑鼠、鍵盤等。如我要設定 touchpad 的話，可以用</p>

<div>
<pre class="brush: plain;">
# /etc/X11/xorg.conf.d/10-synaptics.conf
Section &quot;InputClass&quot;
    Identifier &quot;Synaptics&quot;
    MatchIsTouchpad &quot;true&quot;

    Option &quot;TapButton1&quot; &quot;1&quot;
    Option &quot;HorizEdgeScroll&quot; &quot;true&quot;
EndSection
</pre>
</div>

<p>來設定。再加上 X 會自己找到可以用的 driver，和<a href="http://blog.kanru.info/archives/251">以前</a><a href="http://blog.kanru.info/archives/279">的</a><a href="http://blog.kanru.info/archives/339">方法</a>比起來，是不是簡單很多呢？ <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/732/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Back to Debian from the Arch Linux World</title>
		<link>http://blog.kanru.info/archives/666</link>
		<comments>http://blog.kanru.info/archives/666#comments</comments>
		<pubDate>Sat, 09 Jan 2010 13:18:37 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Arch Linux]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=666</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>在退伍後買了新電腦，裝的不是 Debian 而是 Arch Linux，主要是因為在當兵期間參與 Debian 的活動少了，並看看這個新興的 distro 有什麼有趣的地方，讓我在網路上總是遇上 Arch 的使用者。結果一用之下竟能快速上手，還加了幾個套件到 AUR 中，用著用著有些不想換了。以下寫寫我在用 Arch 時最想念 Debian 的地方，還有希望 Debian 也有的特色。</p>

<h4>最想念 Debian 的：</h4>

<ol>
<li><p>廣大的使用者與開發者社群：</p>

<p>Arch 的使用者也許不少，但開發者就不多了。看看 devel 的 mailing list，上面活躍的只有幾位，所謂的 TU 也是不多。再加上我所知道的 hacker，或是同 project 的 developer，很多都是 Debian 的使用者或是開發者&#8230;</p></li>
<li><p>行之有年的社群管理制度：</p>

<p>Arch 除了 TU 和幾位 core developer&#8230; 其他都是渾沌不明的狀態</p></li>
<li><p>好用的 Bug Report 系統：</p>

<p>debbugs 太好用了，flyspray 的介面我還是很不習慣</p></li>
<li><p>社群契約：</p>

<p>這很重要，定出了 Debian Project 的目標，是一種信念</p></li>
<li><p>支援的 architecture 衆多：</p>

<p>名為 Arch 的只支援 2 種 arh..</p></li>
</ol>

<h4>希望 Debian 有的：</h4>

<ol>
<li><p>快速的套件管理系統：</p>

<p>這其實包含很多層面；Arch 只用 <code>pacman</code> 與 <code>makepkg</code> 就可以打理一切，反觀 Debian，套件管理分成 <code>dpkg-*</code>, <code>dselect</code>, <code>apt-*</code>, <code>aptitude</code>，建構套件又有 <code>dpkg-buildpackage</code>, <code>debuild</code>, <code>*build</code>, <code>*-buildpackage</code>。</p>

<p>Arch 的使用者雖說 pacman 的 db 沒效率，可在我來看己是飛快了， Debian 的 dpkg, apt 在套件多起來時真是慢的可以&#8230;</p></li>
<li><p>極新的 userspace：</p>

<p>Debian 的也是更新很快，但會有週期性的 slowdown，到現在 python 2.6 還在 experimental&#8230;</p></li>
<li><p>Artworks：</p>

<p>Arch 的使用者很會打造網站，桌面，Logo，Icon 等，非常用心，Debian 似乎就弱了點&#8230;</p></li>
</ol>

<p>在使用 Arch 的這段時間，我體驗到的 DIY 的樂趣，發現原來 Debian 的套件做了這多事。比起 Arch 要自己去 /boot, /etc, /usr/bin 下東改西改，Debian 會用各種 script 如 <code>update-*</code> 來幫你。用久了 Debian 真的變成只會用的 script&#8230; 戒之戒之。</p>

<p>得知申請己久的 DD 資格終於有進展，我決定回到 Debian，並把在 Arch 學到的優點在 Debian 實現，打造我的 Debian <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/666/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Current state of Debian Chinese translations</title>
		<link>http://blog.kanru.info/archives/574</link>
		<comments>http://blog.kanru.info/archives/574#comments</comments>
		<pubDate>Wed, 17 Dec 2008 17:33:36 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[小工具]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[translation]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=574</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>整理一下目前 Debian 各部份的中文翻譯狀況：</p>

<p><img src="http://people.debian.org.tw/~koster/blog/2008-12-18-010940_618x164_scrot.png" alt="transgraph" /></p>

<p><strong><a href="http://www.debian.org/international/l10n/po/zh_TW">收錄於 Debian 中的軟體的翻譯</a></strong></p>

<p>這裡大部分是各種有收錄在 Debian 中的軟體的 PO 檔的翻譯，不是 Debian 特有的，主要協調者是 Zh-l10n。</p>

<p>參考：</p>

<ul>
<li><a href="http://translationproject.org/team/zh_TW.html">Translation Project (TP)</a></li>
<li><a href="http://lists.linux.org.tw/cgi-bin/mailman/listinfo/zh-l10n">Zh-l10n 郵件論壇</a></li>
</ul>

<p><strong><a href="http://www.debian.org/international/l10n/po-debconf/zh_TW">Debian 套件設定樣板的翻譯</a></strong></p>

<p>也就是 po-debconf 的翻譯，這些翻譯會出現在安裝套件後的設定畫面。目前有翻譯的還不多，想要進行翻譯的可以參考 popcon 分數決定要先從哪個套件開始。</p>

<p>可以使用<a href="http://people.debian.org.tw/~koster/misc/transhelp.sh">這隻 script</a> 來幫助翻譯：</p>

<ul>
<li>取得 po 檔

<ul>
<li>transhelp get abook</li>
</ul></li>
<li>編輯

<ul>
<li>edit abook/zh_TW.po</li>
</ul></li>
<li>檢查翻譯結果

<ul>
<li>transhelp check abook</li>
</ul></li>
<li>模擬顯示結果

<ul>
<li>transhelp display abook</li>
</ul></li>
<li>提交

<ul>
<li>transhelp send abook</li>
</ul></li>
</ul>

<p>transhelp 只是簡化翻譯的流程，真正要翻譯前請先參考 <a href="http://www.debian.org/international/l10n/po-debconf/README-trans">README-trans</a></p>

<p><strong><a href="http://ddtp.debian.net/ddtss/index.cgi/zh_TW">Debian 套件描述的翻譯</a></strong></p>

<p>套件描述的翻譯，這些翻譯會出現在套件管理軟體中 (如 aptitude) 或是 packages.debian.org 網站上。</p>

<p>無論你是要翻譯或是要 review，都可以透過網頁介面進行。</p>

<p>參考摩托學園：<a href="http://moto.debian.org.tw/viewtopic.php?p=50384">DDTSS</a>，<a href="http://moto.debian.org.tw/viewtopic.php?t=9730">翻譯 Debian 套件訊息</a></p>

<p><strong><a href="http://www.debian.org/devel/website/stats/zh-tw.html">Debian 網站的翻譯</a></strong></p>

<p>目前最重要的頁面都已經是最新了，其他常用頁面以及一些曾經翻譯過的頁面也在陸續整理中。我用 graphviz 畫了一張目前翻譯狀況的<a href="http://people.debian.org.tw/~koster/blog/transgraph.pdf">圖示</a>，紅色代表目錄中有未翻譯網頁，綠色代表網頁已經跟原文同步。</p>

<p>想要參與翻譯的可以參考<a href="http://www.debian.org/devel/website/">這裡</a>和<a href="http://www.debian.org/devel/website/translating.zh-tw.html">這裡</a></p>

<p><strong><a href="http://d-i.alioth.debian.org/l10n-stats/translation-status.html">Debian Installer 的翻譯</a></strong></p>

<p>這裡整理了 Debian Installer 會用到的套件的翻譯，目前只剩下少數還未更新。</p>

<p><strong><a href="http://lists.debian.org/debian-doc/2008/10/msg00134.html">Lenny Release Note 的翻譯</a></strong></p>

<p>很早就開始進行了，就我所知 Tetralet 已經翻譯了一部分。想要幫忙的可以聯絡他。</p>

<p><strong><a href="http://www.debian.org/devel/debian-installer/translations.txt">Lenny Install Manual 的翻譯</a></strong></p>

<p>之前是 <a href="http://moto.debian.org.tw/viewtopic.php?t=6894">dreamcryer 翻譯的</a>，現在聯絡不到人。簡體中文版已經翻譯的差不多了，想幫忙的人可以由此下手。</p>

<p><strong>Debian Wiki 的翻譯：</strong></p>

<p>不知道，Wiki 變化太快也許不適合進行翻譯。</p>

<p><strong>其他</strong></p>

<p>歡迎提供其他相關訊息 m(_ _)m</p>

<p>TODO: 整理到 Wiki 上</p>

<p>參考網站：<a href="http://www.debian.org/international/l10n/">http://www.debian.org/international/l10n/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/574/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>devscripts 系列： mk-build-deps</title>
		<link>http://blog.kanru.info/archives/350</link>
		<comments>http://blog.kanru.info/archives/350#comments</comments>
		<pubDate>Sat, 04 Oct 2008 15:26:34 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[小工具]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[devscripts]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/?p=350</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a href="http://packages.debian.org/devscripts">devscripts</a> 是給 Debian developer 用的一些好用工具的集合，今天要介紹的是 mk-build-deps</p>

<p>Debian distribution 中包含了許多預先編譯好的 deb 檔，通常我們只要 apt-get install 安裝即可，但是當我們需要修改編譯參數或是製作新版本的套件時，就會需要 apt-get source 取得 source package 自行編譯。要製作 deb 時會要求先安裝一些相依套件，通常是 libfoo-dev 等，此時可以用 apt-get build-dep 自動安裝相依套件。</p>

<p>麻煩的地方是，透過 apt-get build-dep 安裝的套件並不是因為跟任何套件有相依性才被安裝的，相等於直接 apt-get install，因此不會在你編譯完不需要的時候自動移除。如果時常要編一些東西的話，常常系統上會裝滿了許多 libxxx-dev 難以整理。有一個技巧就是利用 <a href="http://packages.debian.org/equivs">equivs</a> 製作 <a href="http://wiki.debian.org/metapackage">metapackage</a> ，把編譯需要的套件都包含進去，以後不需要了只要移除這個 metapackage 就可以把所有相依套件移除乾淨。</p>

<p>mk-build-deps 就是把這個技巧自動化的工具，使用範例如下：</p>

<p><pre lang="shell">
% mk-build-deps network-manager-gnome
dh_testdir
dh_testroot
dh_clean -k
dh_testdir
dh_testroot
dh_install
dh_installdocs
dh_installchangelogs
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
dpkg-deb: building package <code>network-manager-applet-build-deps' in</code>../network-manager-applet-build-deps_0.6.6-2_all.deb'.</pre></p>

<p>The package has been created.
Attention, the package has been created in the current directory,
not in ".." as indicated by the message above!</p>

<p>% dpkg -f network-manager-applet-build-deps_0.6.6-2_all.deb depends
autotools-dev, cdbs, debhelper (>= 5.0.0), docbook-to-man, intltool,
libdbus-glib-1-dev (>= 0.60), libgconf2-dev, libglade2-dev, libglib2.0-dev
(>= 2.10), libgnome-keyring-dev, libgnome2-dev, libgnomeui-dev,
libgtk2.0-dev, libiw-dev (>= 27+28pre9), libnm-util-dev (>= 0.6.6),
libnotify-dev (>= 0.3.0), network-manager-dev (>= 0.6.6), pkg-config
</p>

<p>而 Frank Lichtenheld 更<a href="http://blog.djpig.de/2007/09/08">整理</a>了一個 apt <a href="http://sourcedeps.debian.net/">repository</a> 可以直接安裝已經製作好的 build-dep 套件！只要加入以下到 sources.list 即可：</p>

<p><pre lang="plain">
deb http://sourcedeps.debian.net/ sid main contrib non-free
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/350/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emacs 使用 Xft</title>
		<link>http://blog.kanru.info/archives/288</link>
		<comments>http://blog.kanru.info/archives/288#comments</comments>
		<pubDate>Sun, 10 Feb 2008 17:10:33 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Debian]]></category>
		<category><![CDATA[Emacs]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[xft]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/288</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>emacs-unicode-2 branch 已經 merge 到 trunk 了，用 xft 來顯示的部份也 merge 到 trunk。</p>

<p>更好的是，已經有 deb 可以用了，emacs-snapshot 請到 <a href="http://emacs.orebokech.com/">http://emacs.orebokech.com/</a> 取用。</p>

<p>設定方法，<a href="http://www.emacswiki.org/cgi-bin/wiki/XftGnuEmacs">XftGnuEmacs</a> 仍有一定參考價值。</p>

<p>.Xresources:</p>

<pre><code>Emacs.FontBackend: xft
Emacs.Font: Dejavu Sans Mono-9
</code></pre>

<p>.emacs:</p>

<pre><code>(set-fontset-font "fontset-default" 
                  'han '("cwTeXHeiBold" . "unicode-bmp"))
</code></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/288/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An update from Debian release team</title>
		<link>http://blog.kanru.info/archives/287</link>
		<comments>http://blog.kanru.info/archives/287#comments</comments>
		<pubDate>Tue, 05 Feb 2008 05:12:13 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Chewing]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/287</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>http://lwn.net/Articles/267722/</p>

<p>重點是 Release goal:</p>

<ul>
<li>Drop debmake from Debian</li>
<li>UTF-8 debian/changelog and debian/control

<ul>
<li>xcin 也在名單上&#8230;</li>
</ul></li>
<li>Switch /bin/sh to dash</li>
</ul>

<p>也許應該在過年前把 chewing 翻修一下&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/287/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GNOME Applet for monitoring Debian bugs</title>
		<link>http://blog.kanru.info/archives/283</link>
		<comments>http://blog.kanru.info/archives/283#comments</comments>
		<pubDate>Sun, 27 Jan 2008 03:25:41 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[小工具]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[bts]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[gnome]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/283</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>臨時想要監控某個 debian bug 但是嫌訂閱 bug 麻煩嗎？利用<a href="http://chris-lamb.co.uk/2008/01/14/gnome-applet-for-monitoring-debian-bugs/">這個</a> GNOME Applet 讓你方便紀錄 debian bts 的動態。</p>

<p><img src="http://people.debian.org.tw/~koster/blog/dba-applet.jpg" alt="dba-applet screenshot" /></p>

<p>取得方法</p>

<pre><code>% git-clone git://git.chris-lamb.co.uk/debian-bts-applet
</code></pre>

<p>ps. 我還沒測試過 :p</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/283/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Xorg 1.4 XInput Hotplug</title>
		<link>http://blog.kanru.info/archives/279</link>
		<comments>http://blog.kanru.info/archives/279#comments</comments>
		<pubDate>Thu, 15 Nov 2007 18:55:38 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[evdev]]></category>
		<category><![CDATA[xorg]]></category>
		<category><![CDATA[xwindow]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/279</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Xorg 1.4 開始支援 hal based 的 xinput hotplug，也就是說滑鼠跟鍵盤這些設備可以拔來拔去而不用在 xorg.conf 裡面設定，再加上越來越多 driver 可以 auto-configuration，xorg.conf 裡面的東西越來越少了。</p>

<p>xorg 的 evdev driver 是利用 linux kernel 的 evdev 支援，來使用滑鼠、鍵盤等多種設備，我的 Logitech V450 就一定要用 evdev 才能支援所有的按鍵。</p>

<p>無奈 Debian Sid 中的 Xorg 以及 evdev 都非常的新，但是一些升級的配套措施跟文件跟不上，導致最近發生許多問題，相關的 bug report 有 <a href="http://bugs.debian.org/443292">#443292</a>、<a href="http://bugs.debian.org/442316">#442316</a>。</p>

<p>今天終於把滑鼠鍵盤都設定好了，關鍵在於 hal 的設定跟 gnome 的設定。</p>

<p>首先是設定 hal，因為 hal 預設只設定了使用 evdev，但是沒有顧慮到非使用 us layout 的人，導致升級之後鍵盤 layout 大亂，目前暫時取消了這項設定，我們可以從 /usr/share/doc/hal/examples/10-x11-input.fdi 把設定撿回 
/etc/hal/fdi/policy/，內容如下：</p>

<p><pre>
&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;
&lt;deviceinfo version="0.2"&gt;
  &lt;device&gt;
    &lt;!-- FIXME: Support tablets too. --&gt;
    &lt;match key="info.capabilities" contains="input.mouse"&gt;
      &lt;merge key="input.x11_driver" type="string"&gt;mouse&lt;/merge&gt;
      &lt;match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
             string="Linux"&gt;
        &lt;merge key="input.x11_driver" type="string"&gt;evdev&lt;/merge&gt;
      &lt;/match&gt;
    &lt;/match&gt;</pre></p>

<pre><code>&amp;lt;match key="info.capabilities" contains="input.keys"&amp;gt;
  &amp;lt;!-- If we're using Linux, we use evdev by default (falling back to
       keyboard otherwise). --&amp;gt;
  &amp;lt;merge key="input.x11_driver" type="string"&amp;gt;keyboard&amp;lt;/merge&amp;gt;
  &amp;lt;match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
         string="Linux"&amp;gt;
    &amp;lt;merge key="input.x11_driver" type="string"&amp;gt;evdev&amp;lt;/merge&amp;gt;
    &amp;lt;merge key="input.xkb.rules" type="string"&amp;gt;xorg&amp;lt;/merge&amp;gt;
    &amp;lt;merge key="input.xkb.model" type="string"&amp;gt;evdev&amp;lt;/merge&amp;gt;
    &amp;lt;merge key="input.xkb.layout" type="string"&amp;gt;dvorak&amp;lt;/merge&amp;gt;
  &amp;lt;/match&amp;gt;
&amp;lt;/match&amp;gt;
</code></pre>

<p>&lt;/device&gt;
&lt;/deviceinfo&gt;
</p>

<p>其中關於鍵盤 layout、model、rules 的設定是我加上去的。滑鼠不需更動即可 hotplug 使用。</p>

<p>接下來關鍵的地方是，如果你使用 gnome 的話，記得把 keyboard model 改成 evdev，如圖：</p>

<p><a href="http://www.flickr.com/photos/kanru/2035334916/" title="gnome keyboard setting by Kanru Chen, on Flickr"><img src="http://farm3.static.flickr.com/2072/2035334916_e7d5594109_o.png" width="497" height="497" alt="gnome keyboard setting" /></a></p>

<p>最後，xorg.conf 就可以清乾淨了：</p>

<p><pre>
Section "Device"
        Identifier      "intel"
        Driver          "intel"
        Option          "AccelMethod"     "XAA"
        Option          "XAANoOffScreenPixmaps" "True"
EndSection</pre></p>

<p>Section "InputDevice"
        Identifier      "Synaptics Touchpad"
        Driver          "synaptics"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/event9"
        Option          "Protocol"              "auto-dev"
        Option          "SHMConfig"             "on"
        Option          "LeftEdge"              "1100"
        Option          "RightEdge"             "5800"
        Option          "TopEdge"               "1600"
        Option          "BottomEdge"    "4200"
        Option          "HorizEdgeScroll" "on"
EndSection</p>

<p>Section "Monitor"
        Identifier      "Configured Monitor"
        Option          "DPMS"
        DisplaySize     330 200
EndSection</p>

<p>Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        DefaultDepth    24
        SubSection "Display"
                Modes           "1280x768" "1024x768"
        EndSubSection
EndSection
</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/279/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debian 開機速度調教</title>
		<link>http://blog.kanru.info/archives/276</link>
		<comments>http://blog.kanru.info/archives/276#comments</comments>
		<pubDate>Thu, 18 Oct 2007 02:14:50 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[小工具]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/276</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>看了 <a href="http://yurinfore.blogspot.com/">Yuren</a> 的<a href="http://yurinfore.blogspot.com/2007/10/x31-ubuntu-710.html">這篇</a>，不禁手癢，也想幫我的伙伴調整一下增進開機速度。首先沒用過 bootchart，以前總以為要 patch 一些東西才能用，沒想到其實只要 <code>apt-get install bootchart</code> 就可以用了 XD</p>

<p>首先是沒有調整過的 bootchart：</p>

<p><img width="100%" src="http://people.debian.org.tw/~koster/blog/bootchart-1.png" alt="bootchart of original system" /></p>

<p>在搜尋 bootchart 資料時，找到了這個 <a href="http://www.debian.org">Debian</a> 的 SoC <a href="http://initscripts-ng.alioth.debian.org/soc2006-bootsystem/index.html">計劃</a>，裡面有各項關於調整開機速度的<a href="http://initscripts-ng.alioth.debian.org/soc2006-bootsystem/bootcharts.html">建議</a>，一項一項試，試了大概有數十次吧，最後終於找到最好的方案：</p>

<ul>
<li>把 /bin/sh 連結到 dash，只要下 <code>dpkg-reconfigure dash</code> 就可以了</li>
<li>裝好 insserv 之後，下 <code>update-bootsystem-insserv</code>，重新排列 rcX.d 底下的 script 順序</li>
<li>修改 /etc/default/rcS 裡面的設定，<code>CONCURRENCY=shell</code> (原來現在的 initscripts 已經支援 parallel 執行)</li>
<li>修改 <code>hwclock.sh</code> 跟 <code>hwclockfirst.sh</code>，讓他們在背景執行</li>
<li>開機時，不要加 <code>vga=791</code> 參數</li>
</ul>

<p>減少的時間主要都是來自以上的修改，之後還試過整理多餘的 <code>/etc/init.d/</code> scripts，試用 ubuntu 的 readahead 程式，prlink gdm 等，都沒有更多的進步&#8230;</p>

<p>這是最後的 bootchart：</p>

<p><img width="100%" src="http://people.debian.org.tw/~koster/blog/bootchart-9.png" alt="bootchart of tweaked system" /></p>

<p>時間從 39 s 變成 29 s，嗯&#8230; 不錯不錯，進步滿多的，不過我覺得應該還可以再進步，只是我不知道該怎麼調了 XD</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/276/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intel 新玩具 &#8212; PowerTop!</title>
		<link>http://blog.kanru.info/archives/265</link>
		<comments>http://blog.kanru.info/archives/265#comments</comments>
		<pubDate>Fri, 18 May 2007 07:09:06 +0000</pubDate>
		<dc:creator>kanru</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[爬網探險]]></category>
		<category><![CDATA[Debian]]></category>

		<guid isPermaLink="false">http://blog.kanru.info/archives/265</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>常常覺得筆電的電池肚量不夠嗎？每次都撐不了幾個小時就沒電了？ Intel 釋出這個名為 <a href="http://www.linuxpowertop.org/">powertop</a> 的新玩具，可以測量出是哪些程序常常把 CPU 從深層睡眠中喚醒，只要有辦法去掉這些惱人的 timer，搭配 linux 2.6.21 中的新特性 dynamic tick，可以讓電腦在不工作的時候可以好好休息，延長工作時間。</p>

<p>在 debian/sid 中只需要</p>

<pre><code>apt-get install powertop
</code></pre>

<p>就可以安裝最新版的 powertop，但是要真正實用的分析功能，還需要把 kernel 中的 debug 功能打開</p>

<pre><code>Kernel hacking  ---&gt;
    [*] Kernel debugging
        [*] Collect kernel timers statistics
</code></pre>

<p>輸出結果如下</p>

<pre><code>Cn          Avg residency (5s)  Long term residency avg
C0 (cpu running)        (17.6%)
C1                0.0ms ( 0.0%)                   0.0ms
C2                3.3ms (82.4%)                   3.1ms
C3                0.0ms ( 0.0%)                   0.0ms

Wakeups-from-idle per second :  252.8 
Power usage (ACPI estimate) :  22.9 W (2.3 hours left)

Top causes for wakeups:
  27.5% (165.2)       &lt;interrupt&gt; : uhci_hcd:usb5, HDA Intel, i915@pci:0000:00:02.0 
  22.2% (133.6)       firefox-bin : schedule_timeout (process_timeout) 
  18.5% (111.0)       liferea-bin : schedule_timeout (process_timeout) 
   8.4% (50.2)              java : schedule_timeout (process_timeout) 
   4.1% (24.8)              Xorg : do_setitimer (it_real_fn) 
   2.6% (15.4)             xchat : schedule_timeout (process_timeout) 
   2.5% (15.0)       laptop_mode : queue_delayed_work_on (delayed_work_timer_ 
   2.1% (12.8)       &lt;interrupt&gt; : libata 
   2.1% (12.8)    gnome-terminal : schedule_timeout (process_timeout) 
   2.1% (12.4)       &lt;interrupt&gt; : yenta, ipw2200 
</code></pre>

<p>清單上的常客 i915@pci, firefox, liferea 等可以在 powertop 網站上的 <a href="http://www.linuxpowertop.org/known.php">Tips and Tricks</a> 找到紀錄，也有紀錄一些解決的方法或是 patch&#8230; 不過目前我的 i915@pci 無解 囧rz</p>

<p>期待這個計劃可以將 linux 在筆電上的工作效率提高 <img src='http://blog.kanru.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p>ps. 網站上有個很誘人的 Success stories</p>

<blockquote>
  <p>With PowerTOP, I managed to increase the battery life of my Panasonic R4 laptop from 4 to 
  almost 7 hours
  &#8212; Keith Packard, Principal Engineer at Intel</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.kanru.info/archives/265/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
