»
S
I
D
E
B
A
R
«
Back to Debian from the Arch Linux World
Jan 9th, 2010 by kanru

在退伍後買了新電腦,裝的不是 Debian 而是 Arch Linux,主要是因為在當兵期間參與 Debian 的活動少了,並看看這個新興的 distro 有什麼有趣的地方,讓我在網路上總是遇上 Arch 的使用者。結果一用之下竟能快速上手,還加了幾個套件到 AUR 中,用著用著有些不想換了。以下寫寫我在用 Arch 時最想念 Debian 的地方,還有希望 Debian 也有的特色。

最想念 Debian 的:

  1. 廣大的使用者與開發者社群:

    Arch 的使用者也許不少,但開發者就不多了。看看 devel 的 mailing list,上面活躍的只有幾位,所謂的 TU 也是不多。再加上我所知道的 hacker,或是同 project 的 developer,很多都是 Debian 的使用者或是開發者…

  2. 行之有年的社群管理制度:

    Arch 除了 TU 和幾位 core developer… 其他都是渾沌不明的狀態

  3. 好用的 Bug Report 系統:

    debbugs 太好用了,flyspray 的介面我還是很不習慣

  4. 社群契約:

    這很重要,定出了 Debian Project 的目標,是一種信念

  5. 支援的 architecture 衆多:

    名為 Arch 的只支援 2 種 arh..

希望 Debian 有的:

  1. 快速的套件管理系統:

    這其實包含很多層面;Arch 只用 pacmanmakepkg 就可以打理一切,反觀 Debian,套件管理分成 dpkg-*, dselect, apt-*, aptitude,建構套件又有 dpkg-buildpackage, debuild, *build, *-buildpackage

    Arch 的使用者雖說 pacman 的 db 沒效率,可在我來看己是飛快了, Debian 的 dpkg, apt 在套件多起來時真是慢的可以…

  2. 極新的 userspace:

    Debian 的也是更新很快,但會有週期性的 slowdown,到現在 python 2.6 還在 experimental…

  3. Artworks:

    Arch 的使用者很會打造網站,桌面,Logo,Icon 等,非常用心,Debian 似乎就弱了點…

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

得知申請己久的 DD 資格終於有進展,我決定回到 Debian,並把在 Arch 學到的優點在 Debian 實現,打造我的 Debian :-)

Current state of Debian Chinese translations
Dec 18th, 2008 by kanru

整理一下目前 Debian 各部份的中文翻譯狀況:

transgraph

收錄於 Debian 中的軟體的翻譯

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

參考:

Debian 套件設定樣板的翻譯

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

可以使用這隻 script 來幫助翻譯:

  • 取得 po 檔
    • transhelp get abook
  • 編輯
    • edit abook/zh_TW.po
  • 檢查翻譯結果
    • transhelp check abook
  • 模擬顯示結果
    • transhelp display abook
  • 提交
    • transhelp send abook

transhelp 只是簡化翻譯的流程,真正要翻譯前請先參考 README-trans

Debian 套件描述的翻譯

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

無論你是要翻譯或是要 review,都可以透過網頁介面進行。

參考摩托學園:DDTSS翻譯 Debian 套件訊息

Debian 網站的翻譯

目前最重要的頁面都已經是最新了,其他常用頁面以及一些曾經翻譯過的頁面也在陸續整理中。我用 graphviz 畫了一張目前翻譯狀況的圖示,紅色代表目錄中有未翻譯網頁,綠色代表網頁已經跟原文同步。

想要參與翻譯的可以參考這裡這裡

Debian Installer 的翻譯

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

Lenny Release Note 的翻譯

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

Lenny Install Manual 的翻譯

之前是 dreamcryer 翻譯的,現在聯絡不到人。簡體中文版已經翻譯的差不多了,想幫忙的人可以由此下手。

Debian Wiki 的翻譯:

不知道,Wiki 變化太快也許不適合進行翻譯。

其他

歡迎提供其他相關訊息 m(_ _)m

TODO: 整理到 Wiki 上

參考網站:http://www.debian.org/international/l10n/

devscripts 系列: mk-build-deps
Oct 4th, 2008 by kanru

devscripts 是給 Debian developer 用的一些好用工具的集合,今天要介紹的是 mk-build-deps

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

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

mk-build-deps 就是把這個技巧自動化的工具,使用範例如下:

% 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 network-manager-applet-build-deps' in../network-manager-applet-build-deps_0.6.6-2_all.deb'.

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

% 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

而 Frank Lichtenheld 更整理了一個 apt repository 可以直接安裝已經製作好的 build-dep 套件!只要加入以下到 sources.list 即可:

deb http://sourcedeps.debian.net/ sid main contrib non-free

Emacs 使用 Xft
Feb 11th, 2008 by kanru

emacs-unicode-2 branch 已經 merge 到 trunk 了,用 xft 來顯示的部份也 merge 到 trunk。

更好的是,已經有 deb 可以用了,emacs-snapshot 請到 http://emacs.orebokech.com/ 取用。

設定方法,XftGnuEmacs 仍有一定參考價值。

.Xresources:

Emacs.FontBackend: xft
Emacs.Font: Dejavu Sans Mono-9

.emacs:

(set-fontset-font "fontset-default" 
                  'han '("cwTeXHeiBold" . "unicode-bmp"))
An update from Debian release team
Feb 5th, 2008 by kanru

http://lwn.net/Articles/267722/

重點是 Release goal:

  • Drop debmake from Debian
  • UTF-8 debian/changelog and debian/control
    • xcin 也在名單上…
  • Switch /bin/sh to dash

也許應該在過年前把 chewing 翻修一下…

GNOME Applet for monitoring Debian bugs
Jan 27th, 2008 by kanru

臨時想要監控某個 debian bug 但是嫌訂閱 bug 麻煩嗎?利用這個 GNOME Applet 讓你方便紀錄 debian bts 的動態。

dba-applet screenshot

取得方法

% git-clone git://git.chris-lamb.co.uk/debian-bts-applet

ps. 我還沒測試過 :p

Xorg 1.4 XInput Hotplug
Nov 16th, 2007 by kanru

Xorg 1.4 開始支援 hal based 的 xinput hotplug,也就是說滑鼠跟鍵盤這些設備可以拔來拔去而不用在 xorg.conf 裡面設定,再加上越來越多 driver 可以 auto-configuration,xorg.conf 裡面的東西越來越少了。

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

無奈 Debian Sid 中的 Xorg 以及 evdev 都非常的新,但是一些升級的配套措施跟文件跟不上,導致最近發生許多問題,相關的 bug report 有 #443292#442316

今天終於把滑鼠鍵盤都設定好了,關鍵在於 hal 的設定跟 gnome 的設定。

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

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

&lt;match key="info.capabilities" contains="input.keys"&gt;
  &lt;!-- If we're using Linux, we use evdev by default (falling back to
       keyboard otherwise). --&gt;
  &lt;merge key="input.x11_driver" type="string"&gt;keyboard&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;merge key="input.xkb.rules" type="string"&gt;xorg&lt;/merge&gt;
    &lt;merge key="input.xkb.model" type="string"&gt;evdev&lt;/merge&gt;
    &lt;merge key="input.xkb.layout" type="string"&gt;dvorak&lt;/merge&gt;
  &lt;/match&gt;
&lt;/match&gt;

</device> </deviceinfo>

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

接下來關鍵的地方是,如果你使用 gnome 的話,記得把 keyboard model 改成 evdev,如圖:

gnome keyboard setting

最後,xorg.conf 就可以清乾淨了:

Section "Device"
        Identifier      "intel"
        Driver          "intel"
        Option          "AccelMethod"     "XAA"
        Option          "XAANoOffScreenPixmaps" "True"
EndSection

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

Section "Monitor" Identifier "Configured Monitor" Option "DPMS" DisplaySize 330 200 EndSection

Section "Screen" Identifier "Default Screen" Monitor "Configured Monitor" DefaultDepth 24 SubSection "Display" Modes "1280x768" "1024x768" EndSubSection EndSection

Debian 開機速度調教
Oct 18th, 2007 by kanru

看了 Yuren這篇,不禁手癢,也想幫我的伙伴調整一下增進開機速度。首先沒用過 bootchart,以前總以為要 patch 一些東西才能用,沒想到其實只要 apt-get install bootchart 就可以用了 XD

首先是沒有調整過的 bootchart:

bootchart of original system

在搜尋 bootchart 資料時,找到了這個 Debian 的 SoC 計劃,裡面有各項關於調整開機速度的建議,一項一項試,試了大概有數十次吧,最後終於找到最好的方案:

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

減少的時間主要都是來自以上的修改,之後還試過整理多餘的 /etc/init.d/ scripts,試用 ubuntu 的 readahead 程式,prlink gdm 等,都沒有更多的進步…

這是最後的 bootchart:

bootchart of tweaked system

時間從 39 s 變成 29 s,嗯… 不錯不錯,進步滿多的,不過我覺得應該還可以再進步,只是我不知道該怎麼調了 XD

Intel 新玩具 — PowerTop!
May 18th, 2007 by kanru

常常覺得筆電的電池肚量不夠嗎?每次都撐不了幾個小時就沒電了? Intel 釋出這個名為 powertop 的新玩具,可以測量出是哪些程序常常把 CPU 從深層睡眠中喚醒,只要有辦法去掉這些惱人的 timer,搭配 linux 2.6.21 中的新特性 dynamic tick,可以讓電腦在不工作的時候可以好好休息,延長工作時間。

在 debian/sid 中只需要

apt-get install powertop

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

Kernel hacking  --->
    [*] Kernel debugging
        [*] Collect kernel timers statistics

輸出結果如下

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)       <interrupt> : 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)       <interrupt> : libata 
   2.1% (12.8)    gnome-terminal : schedule_timeout (process_timeout) 
   2.1% (12.4)       <interrupt> : yenta, ipw2200 

清單上的常客 i915@pci, firefox, liferea 等可以在 powertop 網站上的 Tips and Tricks 找到紀錄,也有紀錄一些解決的方法或是 patch… 不過目前我的 i915@pci 無解 囧rz

期待這個計劃可以將 linux 在筆電上的工作效率提高 :)

ps. 網站上有個很誘人的 Success stories

With PowerTOP, I managed to increase the battery life of my Panasonic R4 laptop from 4 to almost 7 hours — Keith Packard, Principal Engineer at Intel

Goodbye, ifrename
Aug 24th, 2006 by kanru

從 udev 0.090-1 開始,預設會在 /etc/udev/rules.d 產生 z45_persistent-net-generator.rules 這個檔案,裡面是關於 net interfaces 的命名。

以前總是因為 eth1, eth2 每次開機都不一樣而需要用 ifrename, nameif 等工具來固定住它們。現在自動在 z45_persistent-net-generator.rules 產生一行

# PCI device 8086:4220 (ipw2200)
ACTION=="add", SUBSYSTEM=="net", SYSFS{address}=="00:0e:35:49:99:57", NAME="eth2"

就解決了,在也不需要 ifrename 或是 nameif。

引用 README.Debian

Network Interfaces
~~~~~~~~~~~~~~~~~~
After receiving events about network interfaces, net.agent will call ifupdown using the –allow=hotplug option. This makes the program act only on interfaces marked with the “allow-hotplug” statement. E.g: “allow-hotplug eth0″ instead of the usual “auto eth0″. The loopback interface must always be configured with “auto lo”.

The persistent names of network interfaces by default are automatically written to /etc/udev/rules.d/z25_persistent-net.rules . Users can add their own rules there or at any other place before z45. Generation of rules for persistent names can be disabled by removing the z45_persistent-net-generator.rules symlink.

Beware: programs which rename network interfaces like ifrename and nameif will let udev relay events for the old names and should not be used.

»  Substance: WordPress   »  Style: Ahren Ahimsa
© Copyright 2004-2009 Kan-Ru Chen