2012年1月18日星期三

要求 Ubuntu 開發中版本同步 Debian 上面的套件

Ubuntu 是個每半年釋出一個版本的 GNU/Linux 發行套件,因此每次正式版本釋出的同時代表的是下一個版本開發的開始,因此每個 Ubuntu 版本的開發總是依循著同樣的步調跟大同小異的規則。

Ubuntu 開發中版本上面的套件大多是來是 Debian testing/unstable 的自動同步,不過等到 DebianImportFreeze 之後跟 FeatureFreeze 之前,如果還有新版本的套件在 Debian testing/unstable 上面出現時,就要透過 SyncRequestProcess 來要求 Ubuntu 開發中版本同步 Debian 上面的套件,FeatureFreeze 之後就不能再要求同步套件了,只能夠修正程式的錯誤。

以下示範三種情況。

狀況一: Ubuntu 開發中版本的套件並沒有包含 Ubuntu 社群的錯誤修正

使用 ubuntu-dev-tools 套件底下的 requestsync 指令
$ requestsync -C -d unstable --lp betaradio precise

然後會看到以下內容:
Summary (one line):
Sync betaradio 1.4-1 (universe) from Debian unstable (main)

Description:
Please sync betaradio 1.4-1 (universe) from Debian unstable (main)

Changelog entries since current precise version 1.3-1:

XXX FIXME: add changelog here XXX                                 

要將最後一行改掉,加上 Debian testing/unstable 套件裡面的訊息,所以就變成了:
Summary (one line):
Sync betaradio 1.4-1 (universe) from Debian unstable (main)

Description:
Please sync betaradio 1.4-1 (universe) from Debian unstable (main)

Changelog entries since current precise version 1.3-1:

betaradio (1.4-1) unstable; urgency=low

  * New upstream release.
  * debian/patches/00_dont_install_header: Don't install header file into the
    system.

 -- Shih-Yuan Lee (FourDollars) <fourdollars[at]gmail.com> Sat, 14 Jan 2012 20:58:32 +0800

最後就會產生一個 Launchpad Bug 像是 Bug #918059 in betaradio (Ubuntu): “Sync betaradio 1.4-1 (universe) from Debian unstable (main)” 這樣就做好了,之後就是去注意這個 Bug 的變化,適時的去回應 Ubuntu Developer 提出的問題(如果有的話)。

狀況二: Ubuntu 開發中版本的套件已經有包含了一些 Ubuntu 社群的錯誤修正

在這種情況底下 Ubuntu 不會自動去同步 Debian testing/unstable 上面的套件,以防有些 Ubuntu 社群所做的錯誤修正遺失。

使用跟上面一樣的指令:
$ requestsync -C -d unstable --lp ibus-chewing precise

然後會看到以下內容:
Summary: Sync ibus-chewing 1.3.10+clean-1 (main) from Debian unstable (main)
Description:
Please sync ibus-chewing 1.3.10+clean-1 (main) from Debian unstable (main)

Explanation of the Ubuntu delta and why it can be dropped:
  * debian/patches/IBusChewingEngine-def-fix-SIGSEGV-on-preference-save.patch:
    Fix misuse of g_value_get_gtype in g_value_to_g_variant. (LP: #874028)
  * debian/patches/escape-to-close-candidate-window-on-plain-
     zhuyin.patch: Fix plain zhuyin with space as selection problem.
     (https://github.com/definite/ibus-chewing/pull/8/) (LP: #843619)
[這邊有一行我忘了原本寫些什麼了,總之要你改掉寫上你的解釋]

Changelog entries since current precise version 1.3.9.2-3ubuntu2:

XXX FIXME: add changelog here XXX                                 

跟前面一樣加上 Debian testing/unstable 套件裡面的訊息,還有解釋一下為什麼 Ubuntu 社群的錯誤修正都被拿掉了,然後就變成了:
Please sync ibus-chewing 1.3.10+clean-1 (main) from Debian unstable (main)

Explanation of the Ubuntu delta and why it can be dropped:
  * debian/patches/IBusChewingEngine-def-fix-SIGSEGV-on-preference-save.patch:
    Fix misuse of g_value_get_gtype in g_value_to_g_variant. (LP: #874028)
  * debian/patches/escape-to-close-candidate-window-on-plain-
     zhuyin.patch: Fix plain zhuyin with space as selection problem.
     (https://github.com/definite/ibus-chewing/pull/8/) (LP: #843619)
These patches are already included in ibus-chewing 1.3.10+clean-1.

Changelog entries since current precise version 1.3.9.2-3ubuntu2:

ibus-chewing (1.3.10+clean-1) unstable; urgency=low

  * New upstream release.
  * All Debian patcheds dropped.
  * Add Osamu as uploaders.
  * Repackaged upstream tar with normal tar and removing .swo

 -- Osamu Aoki <osamu[at]debian.org> Mon, 26 Dec 2011 00:17:58 +0900

最後就會產生一個 Launchpad Bug 像是 Bug #918061 in ibus-chewing (Ubuntu): “Sync ibus-chewing 1.3.10+clean-1 (main) from Debian unstable (main)” ,之後就是去注意這個 Bug 的變化,適時的去回應 Ubuntu Developer 提出的問題(如果有的話)。

狀況三: Ubuntu 開發中版本並沒有包含這個套件

在這種情況下應該是最單純的,應該不會有額外的動作要做,都是按下 Enter 就可以做到完。

使用跟上面一樣的指令:
$ requestsync -C -d unstable --lp hime precise

然後會看到以下內容:
'hime' doesn't exist in 'Ubuntu precise'.
Do you want to sync a new package?
Press [Enter] to continue or [Ctrl-C] to abort.

當然是按下 Enter 到下一步
Your sync request shall require an approval by a member of the appropriate
sponsorship team, who shall be subscribed to this bug report.
This must be done before it can be processed by a member of the Ubuntu Archive
team.
If the above is correct please press [Enter] 

再按下 Enter 到下一步
Currently the report looks as follows:
Summary (one line):
Sync hime 0.9.9-1 (universe) from Debian unstable (main)

Description:
Please sync hime 0.9.9-1 (universe) from Debian unstable (main)

All changelog entries:

hime (0.9.9-1) unstable; urgency=low

  * Initial release (Closes: #652022)

 -- Yao Wei (魏銘廷) <mwei[at]lxde.org>  Sat, 14 Jan 2012 00:24:08 +0800

Do you want to edit the report [y/N]?
並沒有修改的必要,所以還是按下 Enter 到下一步
The final report is:
Summary: Sync hime 0.9.9-1 (universe) from Debian unstable (main)
Description:
Please sync hime 0.9.9-1 (universe) from Debian unstable (main)

All changelog entries:

hime (0.9.9-1) unstable; urgency=low

  * Initial release (Closes: #652022)

 -- Yao Wei (魏銘廷) <mwei[at]lxde.org>  Sat, 14 Jan 2012 00:24:08 +0800


Press [Enter] to continue or [Ctrl-C] to abort.
最後的確認,還是按下 Enter 於是就會產生一個 Launchpad Bug 像是 Bug #923637 in Ubuntu: “Sync hime 0.9.9-1 (universe) from Debian unstable (main)”,之後就是去注意這個 Bug 的變化,適時的去回應 Ubuntu Developer 提出的問題(如果有的話)。

2012年1月16日星期一

Genie 程式語言

Genie 程式語言是 GNOME 計畫下的一個新的程式語言,跟 Vala 一起開發的,語法類似 Python,跟 Vala 一樣都是借助 GObject 來實現物件導向程式設計,也跟 Vala 一樣都是產生出 C 的程式碼,而且也因為 GObject 的關係可以輕易地產生其它程式語言的 binding。
例如:輸入以下的程式碼儲存成 hello.gs
init
        print "Hello World"
然後再執行以下的指令就可以看到結果了。
$ valac hello.gs
$ ./hello
如果說要看到中間轉譯出來的 C 語言程式碼可以輸入以下指令:
$ valac -C hello.gs
於是就可以看到 hello.c 產生出來了。
/* hello.c generated by valac 0.14.0, the Vala compiler
 * generated from hello.gs, do not modify */

#include <glib.h>
#include <glib-object.h>
#include <stdlib.h>
#include <string.h>

void _vala_main (gchar** args, int args_length1);

void _vala_main (gchar** args, int args_length1) {
        g_print ("Hello World\n");
}

int main (int argc, char ** argv) {
        g_type_init ();
        _vala_main (argv, argc);
        return 0;
}
看看裡面的內容是不是一般所熟悉的 C 語言程式碼。:)
參考資料:Genie - GNOME Live!

AMD Graphics Drivers 非官方 PPA - ppa:fourdollars/fglrx

因為我自己工作上的需要所以偶而會測試 AMD 官方最新 release 出來的 Graphics Drivers
剛剛更新了 ppa:fourdollars/fglrx 給 Ubuntu 10.04/10.10/11.04/11.10 使用
目前使用的是 AMD 在 12/13/2011 釋出的 AMD Catalyst™ 11.11 Proprietary Linux x86 Display Driver
最新的 AMD Graphics Drivers 可以參考 http://support.amd.com/us/gpudownload/linux/Pages/radeon_linux.aspx
有 AMD Graphics Drivers 使用問題的網友可以試試看,另外要特別聲明這只是使用 AMD 官方釋出的套件產生出來的,因此有問題找我也解決不了。:P

2012年1月13日星期五

betaradio v1.4 released

BetaRadio 是一款使用 Vala 程式語言寫出來的網路收音機程式,專門用來收聽台灣的網路電台。

專案網址:
http://code.google.com/p/betaradio/

新功能:
1. 改善 Unity 整合性
2. 使用多執行緒改善回應速度

錯誤修正:
1. 修正右鍵點擊無法使用的問題

原始碼下載:
http://code.google.com/p/betaradio/downloads/detail?name=betaradio-1.4.tar.bz2

2011年11月21日星期一

Ubuntu 11.10 繁體中文全新安裝後手動修正問題

共同的部份

1. 系統語言變數設定錯誤
直接修改 /etc/default/locale 內容改成
LANG="zh_TW.UTF-8"
LANGUAGE="zh_TW:en"
然後再執行
$ sudo update-grub
2. fontconfig 字型設定錯誤
正常的設定會是以下的結果
$ fontconfig-voodoo -c
Current config: zh_TW
如果不正常就執行以下命令修正
$ sudo fontconfig-voodoo -a
修正完畢後,重新開機應該就會正常了。

Xubuntu 11.10

1. ibus 導致程式崩潰的問題
$ sudo apt-get install ibus-gtk ibus-gtk3
$ cd /usr/lib/gtk-2.0/2.10.0/
$ sudo ln -s /usr/lib/i386-linux-gnu/gtk-2.0/2.10.0/immodules
如果是使用 AMD64
$ sudo ln -s /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules

2011年11月20日星期日

在 Sony Ericsson Xperia™ X8 刷 MiniCM7

MiniCM 是一個特別為 Sony Ericsson Xperia  X10 mini / X8 製作 Android 的 CyanogenMod 客製化的計畫



以下是筆者的安裝步驟筆記,自行刷客製的 Android ROM 有一定的風險,請讀者自行負擔風險,筆者不擔保過程中發生的問題。
  1. 首先需要在 Windows 下載安裝 Sony Ericsson PC Companion 2.0 用來升級跟還原出廠預設版本(安裝過程中有任何問題都可以還原手機上的系統)
  2. 如果 [設定] -> [關於手機] 裡面的 [基頻版本] 不是 015 結尾的話,需要下載 Baseband 015 的 firmware 回來使用 Flashtool 來更新,然後重新啟動手機
  3. 在 Windows 上面安裝使用 SuperOneClick 來取得手機上的 root 權限,然後重新啟動手機
  4. 利用 Android Market 安裝 Apk Installer 用來安裝 Root Explorer,然後重新啟動手機
  5. 然後再將 Xrecovery.zip 裡面的三個檔案利用 Root Explorer 複製到手機系統裡的 /system/bin 底下
  6. 重新啟動系統,看見手機畫面上出現 Sony Ericsson 字樣時不斷地連擊手機上的 Back 鍵,順利的話就可以進入 Xrecovery
  7. 在 Xrecovery 裡面安裝 MiniCM7-2.0.7-X8.zip 跟 gapps-gb-20110828-signed.zip,然後再執行 factory reset 再重新啟動手機就大功告成啦!^o^

PS. 筆者所使用的手機型號是 X8i(E15i)

2011年9月26日星期一

在 Ubuntu 10.10 上修正 NVidia 的 HDMI audio 支援問題

首先要裝上 ppa:fourdollars/nvidia 上面的 nvidia proprietary driver
還要裝上 ppa:diwic/dkms 上面的 alsa-hda-dkms
還要裝上 ppa:ubuntu-audio-dev/ppa 上面的 pulseaudio
然後重新啟動
接下來看看 HDMI 接在哪裡
$ for i in /proc/asound/NVidia/eld*; do echo "<<$i>>"; cat $i; done
<</proc/asound/NVidia/eld#0.0>>
monitor_present		0
eld_valid		0
<</proc/asound/NVidia/eld#1.0>>
monitor_present		1
eld_valid		1
monitor_name		CHIMEI 22SH-L
connection_type		HDMI
eld_version		[0x2] CEA-861D or below
edid_version		[0x3] CEA-861-B, C or D
manufacture_id		0x73b
product_id		0x2d22
port_id			0x10000
support_hdcp		0
support_ai		0
audio_sync_delay	0
speakers		[0x1] FL/FR
sad_count		1
sad0_coding_type	[0x1] LPCM
sad0_channels		2
sad0_rates		[0xe0] 44100 48000 88200
sad0_bits		[0xe0000] 16 20 24
<</proc/asound/NVidia/eld#2.0>>
monitor_present		0
eld_valid		0
<</proc/asound/NVidia/eld#3.0>>
monitor_present		0
eld_valid		0
從上面的紀錄可以看出在 /proc/asound/NVidia/eld#1.0 上面
不過可能會看到都是靜音的狀態
$ amixer -D hw:NVidia
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958',1
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958',2
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
Simple mixer control 'IEC958',3
  Capabilities: pswitch pswitch-joined penum
  Playback channels: Mono
  Mono: Playback [off]
就可以執行
$ alsamixer -D hw:NVidia
在 CUI 設定畫面中全部取消靜音,接下來執行
$ pasuspender -- speaker-test -D hdmi:NVidia,1 -c 2 -t sine -l 1
應該就可以聽到聲音了,確定裝置之後就可以修改 /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf 當中的
[Mapping hdmi-stereo]
device-strings = hdmi:%f
channel-map = left,right
priority = 4
direction = output
改成
[Mapping hdmi-stereo]
device-strings = hdmi:%f,1
channel-map = left,right
priority = 4
direction = output
再重新啟動後應該就可以聽到 HDMI audio 的聲音了。

其它幫助除錯的方法還有