<?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>Acelan's Life &#187; Linux</title>
	<atom:link href="http://blog.acelan.idv.tw/category/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.acelan.idv.tw</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 07 Sep 2011 03:31:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to use gcov/lcov to test the code coverage of choqok plurk plugin</title>
		<link>http://blog.acelan.idv.tw/2011/09/how-to-use-gcovlcov-to-test-the-code-coverage-of-choqok-plurk-plugin/</link>
		<comments>http://blog.acelan.idv.tw/2011/09/how-to-use-gcovlcov-to-test-the-code-coverage-of-choqok-plurk-plugin/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 03:31:36 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[KDE]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Choqok]]></category>
		<category><![CDATA[CMake]]></category>
		<category><![CDATA[gcov]]></category>
		<category><![CDATA[lcov]]></category>
		<category><![CDATA[Qt]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=91</guid>
		<description><![CDATA[我可能很早之前就聽過 gcov[1] 這個工具，但是我沒有去了解或學習它能做些什麼。
今天從朋友的噗那裡又再看到這個工具，而且有了簡單的認識，發覺這真是個好東西，應該要來試試看，就拿現在正在寫的 Choqok Plurk plugin 來試試看吧。
要使用 gcov 其實很簡單，只要在編譯跟連結的時候加上
-fprofile-arcs -ftest-coverage
這兩個 flag 即可。
不過我們的 project 是使用 CMake 所以改法稍微有點不同，下面就是修改的 diff
ubuntu@ubuntu-Vostro-V131 ~/kde/src/choqok (git-svn)-[plurk] % git diff
diff --git a/microblogs/plurk/CMakeLists.txt b/microblogs/plurk/CMakeLists.txt
index 2950374..0fb6cfa 100644
--- a/microblogs/plurk/CMakeLists.txt
+++ b/microblogs/plurk/CMakeLists.txt
@@ -32,7 +32,8 @@ plurklistdialog_base.ui
 kde4_add_plugin(choqok_plurk ${choqok_plurk_SRCS})
-target_link_libraries(choqok_plurk ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QJSON_LIBRARY} ${QTOAUTH_LIBRARY} choqok plurkapihelper)
+add_definitions(-fprofile-arcs -ftest-coverage)
+target_link_libraries(choqok_plurk ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QJSON_LIBRARY} ${QTOAUTH_LIBRARY} choqok plurkapihelper -fprofile-arcs)
 # Install

改完之後重新編譯，我的環境是依照 KDE Build Environment[2] 建立的，所以我是這樣編譯並執行程式的
cs [...]]]></description>
			<content:encoded><![CDATA[<p>我可能很早之前就聽過 gcov[1] 這個工具，但是我沒有去了解或學習它能做些什麼。<br />
今天從朋友的噗那裡又再看到這個工具，而且有了簡單的認識，發覺這真是個好東西，應該要來試試看，就拿現在正在寫的 Choqok Plurk plugin 來試試看吧。</p>
<p>要使用 gcov 其實很簡單，只要在編譯跟連結的時候加上<br />
<code>-fprofile-arcs -ftest-coverage</code><br />
這兩個 flag 即可。<br />
不過我們的 project 是使用 CMake 所以改法稍微有點不同，下面就是修改的 diff<br />
<code>ubuntu@ubuntu-Vostro-V131 ~/kde/src/choqok (git-svn)-[plurk] % git diff<br />
diff --git a/microblogs/plurk/CMakeLists.txt b/microblogs/plurk/CMakeLists.txt<br />
index 2950374..0fb6cfa 100644<br />
--- a/microblogs/plurk/CMakeLists.txt<br />
+++ b/microblogs/plurk/CMakeLists.txt<br />
@@ -32,7 +32,8 @@ plurklistdialog_base.ui<br />
 kde4_add_plugin(choqok_plurk ${choqok_plurk_SRCS})<br />
-target_link_libraries(choqok_plurk ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QJSON_LIBRARY} ${QTOAUTH_LIBRARY} choqok plurkapihelper)<br />
+add_definitions(-fprofile-arcs -ftest-coverage)<br />
+target_link_libraries(choqok_plurk ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QJSON_LIBRARY} ${QTOAUTH_LIBRARY} choqok plurkapihelper -fprofile-arcs)</p>
<p> # Install<br />
</code></p>
<p>改完之後重新編譯，我的環境是依照 KDE Build Environment[2] 建立的，所以我是這樣編譯並執行程式的<br />
<code>cs choqok &#038;&#038; kdebuild &#038;&#038; ~/kde/inst/master/bin/choqok</code><br />
執行時記得每項功能都點一點，這樣才會產生較完整的資料。</p>
<p>最後，我改使用 lcov[3]，而不是 gcov，來產生較漂亮的網頁報表。<br />
<code>ubuntu@ubuntu-Vostro-V131 ~/kde/src/choqok (git-svn)-[plurk] % lcov -d ../../build/choqok/microblogs/plurk/CMakeFiles/choqok_plurk.dir/ -capture -o choqok.info<br />
Capturing coverage data from ../../build/choqok/microblogs/plurk/CMakeFiles/choqok_plurk.dir/<br />
Found gcov version: 4.6.1<br />
Scanning ../../build/choqok/microblogs/plurk/CMakeFiles/choqok_plurk.dir/ for .gcda files ...<br />
Found 19 data files in ../../build/choqok/microblogs/plurk/CMakeFiles/choqok_plurk.dir/<br />
Processing choqok_plurk.dir/plurkaccount.gcda<br />
Processing choqok_plurk.dir/plurkapishowthread.gcda<br />
... ...<br />
Processing choqok_plurk.dir/plurkapisearchtimelinewidget.gcda<br />
Processing choqok_plurk.dir/plurkapimicroblogwidget.gcda<br />
Processing choqok_plurk.dir/choqok_plurk_automoc.gcda<br />
Finished .info-file creation<br />
</code></p>
<p><code>ubuntu@ubuntu-Vostro-V131 ~/kde/src/choqok (git-svn)-[plurk] % genhtml -o results choqok.info<br />
Reading data file choqok.info<br />
Found 104 entries.<br />
Found common filename prefix "/home/ubuntu/kde"<br />
Writing .css and .png files.<br />
Generating output.<br />
Processing file build/choqok/libchoqok/choqokbehaviorsettings.h<br />
Processing file build/choqok/libchoqok/choqokappearancesettings.h<br />
... ...<br />
Processing file /usr/include/qt4/QtGui/qcolor.h<br />
Processing file /usr/include/qt4/QtXml/qdom.h<br />
Writing directory view page.<br />
Overall coverage rate:<br />
  lines......: 37.8% (1369 of 3619 lines)<br />
  functions..: 46.5% (546 of 1173 functions)<br />
  branches...: 27.7% (599 of 2164 branches)<br />
</code></p>
<p><code>ubuntu@ubuntu-Vostro-V131 ~/kde/src/choqok (git-svn)-[plurk] % konqueror results/index.html</code></p>
<p>最後附上其他有使用到的參考資料<br />
<a href="http://www.yuanma.org/data/2006/0613/article_805.htm">http://www.yuanma.org/data/2006/0613/article_805.htm</a><br />
<a href="http://xuwenzhang.org/blog/tag/gcov/">http://xuwenzhang.org/blog/tag/gcov/</a></p>
<p>1. <a href="http://gcc.gnu.org/onlinedocs/gcc/Gcov.html">http://gcc.gnu.org/onlinedocs/gcc/Gcov.html</a><br />
2. <a href="http://techbase.kde.org/Getting_Started/Build/Environment">http://techbase.kde.org/Getting_Started/Build/Environment</a><br />
3. <a href="http://ltp.sourceforge.net/coverage/lcov.php">http://ltp.sourceforge.net/coverage/lcov.php</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2011/09/how-to-use-gcovlcov-to-test-the-code-coverage-of-choqok-plurk-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to build a DKMS package</title>
		<link>http://blog.acelan.idv.tw/2010/09/how-to-build-a-dkms-package/</link>
		<comments>http://blog.acelan.idv.tw/2010/09/how-to-build-a-dkms-package/#comments</comments>
		<pubDate>Fri, 03 Sep 2010 12:31:54 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=72</guid>
		<description><![CDATA[I&#8217;m trying to log how I built an rtl8190 DKMS package, the info may not correct and only works for me.
tar xf rtl8190p_linux_2.6.0011.1029.2009.tar.gz
sudo mv rtl8190p_linux_2.6.0011.1029.2009 /usr/src/rtl8190p-0011.1029.2009/
Modified the Makefile and copy out the .ko file

        @make -C $(KSRC) SUBDIRS=$(RTL819x_DIR)/HAL/$(HAL_SUB_DIR) modules
+       cp ./HAL/rtl8192/r8190_pci.ko .

Prepare [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m trying to log how I built an rtl8190 DKMS package, the info may not correct and only works for me.</p>
<p><code>tar xf rtl8190p_linux_2.6.0011.1029.2009.tar.gz<br />
sudo mv rtl8190p_linux_2.6.0011.1029.2009 /usr/src/rtl8190p-0011.1029.2009/</code></p>
<p>Modified the Makefile and copy out the .ko file<br />
<code><br />
        @make -C $(KSRC) SUBDIRS=$(RTL819x_DIR)/HAL/$(HAL_SUB_DIR) modules<br />
+       cp ./HAL/rtl8192/r8190_pci.ko .<br />
</code></p>
<p>Prepare files needed, &#8220;dkms.conf&#8221;, &#8220;install.sh&#8221;, &#8220;remove.sh&#8221;<br />
<code>% cat /usr/src/rtl8190p-0011.1029.2009/dkms.conf<br />
PACKAGE_NAME="rtl8190p"<br />
PACKAGE_VERSION="0011.1029.2009"<br />
CLEAN="make clean"<br />
BUILT_MODULE_NAME[0]="r8190"<br />
DEST_MODULE_NAME[0]="r8190"<br />
DEST_MODULE_LOCATION[0]="/updates"<br />
POST_INSTALL="install.sh $dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION"<br />
POST_REMOVE="remove.sh"<br />
AUTOINSTALL="yes"</code></p>
<p><code>% cat /usr/src/rtl8190p-0011.1029.2009/install.sh<br />
cp -a firmware/RTL8190P /lib/firmware/</code><br />
<code>% cat /usr/src/rtl8190p-0011.1029.2009/remove.sh<br />
rm -rf /lib/firmware/RTL8190P</code><br />
And remember to give them execution permission<br />
<code>sudo chmod a+x /usr/src/rtl8190p-0011.1029.2009/{install,remove}.sh</code></p>
<p>Add this driver into dkms system<br />
<code>% sudo dkms add -m rtl8190p -v 0011.1029.2009</p>
<p>Creating symlink /var/lib/dkms/rtl8190p/0011.1029.2009/source -><br />
                 /usr/src/rtl8190p-0011.1029.2009</p>
<p>DKMS: add Completed.</code></p>
<p>Try to build it<br />
<code>% sudo dkms build -m rtl8190p -v 0011.1029.2009</p>
<p>Kernel preparation unnecessary for this kernel.  Skipping...</p>
<p>Building module:<br />
cleaning build area....<br />
make KERNELRELEASE=2.6.35-19-generic............<br />
cleaning build area....</p>
<p>DKMS: build Completed.</code></p>
<p>No error, so try to install it and see if everything all correct.<br />
<code>% sudo dkms install -m rtl8190p -v 0011.1029.2009</p>
<p>r8190_pci.ko:<br />
Running module version sanity check.<br />
 - Original module<br />
   - No original module exists within this kernel<br />
 - Installation<br />
   - Installing to /lib/modules/2.6.35-19-generic/updates/dkms/</p>
<p>Running post_install:</p>
<p>depmod....</p>
<p>DKMS: install Completed.</code></p>
<p>Now, try to load the module and test the driver<br />
<code>sudo modprobe r8190_pci<br />
dmesg | tail</code></p>
<p>Pack the .deb package<br />
<code>% sudo dkms mkdsc -m rtl8190p -v 0011.1029.2009 --source-only<br />
Using /etc/dkms/template-dkms-mkdsc<br />
copying template...<br />
modifying debian/changelog...<br />
modifying debian/compat...<br />
modifying debian/control...<br />
modifying debian/copyright...<br />
modifying debian/dirs...<br />
modifying debian/postinst...<br />
modifying debian/prerm...<br />
modifying debian/README.Debian...<br />
modifying debian/rules...<br />
copying legacy postinstall template...<br />
Copying source tree...<br />
Building source package... dpkg-source --before-build rtl8190p-dkms-0011.1029.2009<br />
 debian/rules clean<br />
 dpkg-source -b rtl8190p-dkms-0011.1029.2009<br />
dpkg-source: warning: no source format specified in debian/source/format, see dpkg-source(1)<br />
 dpkg-genchanges -S >../rtl8190p-dkms_0011.1029.2009_source.changes<br />
dpkg-genchanges: including full source code in upload<br />
 dpkg-source --after-build rtl8190p-dkms-0011.1029.2009</p>
<p>DKMS: mkdsc Completed.<br />
Moving built files to /var/lib/dkms/rtl8190p/0011.1029.2009/dsc...<br />
Cleaning up temporary files...<br />
</code></p>
<p>You can find the .deb file here<br />
<code>% ls -l /var/lib/dkms/rtl8190p/0011.1029.2009/deb<br />
total 2020<br />
-rw-r--r-- 1 root root 2066436 Sep  3 20:21 rtl8190p-dkms_0011.1029.2009_all.deb<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2010/09/how-to-build-a-dkms-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check if BIOS supports C2 ~ C3 switch</title>
		<link>http://blog.acelan.idv.tw/2010/09/check-if-bios-supports-c2-c3-switch/</link>
		<comments>http://blog.acelan.idv.tw/2010/09/check-if-bios-supports-c2-c3-switch/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 05:36:28 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=69</guid>
		<description><![CDATA[First of all, check how many Cs state your system support.
acelan@acelan-nb ~ % cat /proc/acpi/processor/*/power
active state:            C0
max_cstate:              C8
maximum allowed latency: 749931 usec
states:
    C1:      [...]]]></description>
			<content:encoded><![CDATA[<p>First of all, check how many Cs state your system support.</p>
<p><code>acelan@acelan-nb ~ % cat /proc/acpi/processor/*/power<br />
active state:            C0<br />
max_cstate:              C8<br />
maximum allowed latency: 749931 usec<br />
states:<br />
    C1:                  type[C1] promotion[--] demotion[--] latency[001] usage[00034144] duration[00000000000000000000]<br />
    C2:                  type[C2] promotion[--] demotion[--] latency[001] usage[12402973] duration[00000000041800676364]<br />
active state:            C0<br />
max_cstate:              C8<br />
maximum allowed latency: 749931 usec<br />
states:<br />
    C1:                  type[C1] promotion[--] demotion[--] latency[001] usage[00017168] duration[00000000000000000000]<br />
    C2:                  type[C2] promotion[--] demotion[--] latency[001] usage[14252404] duration[00000000042491108472]</code></p>
<p>Then get fadt(Fixed ACPI Description table) and disassemble it<br />
<code>sudo cat /proc/acpi/fadt > /tmp/fadt.dat</code><br />
<code>acelan@acelan-nb ~ % iasl -d /tmp/fadt.dat</p>
<p>Intel ACPI Component Architecture<br />
AML Disassembler version 20090521 [Jun 30 2009]<br />
Copyright (C) 2000 - 2009 Intel Corporation<br />
Supports ACPI Specification Revision 3.0a</p>
<p>Loading Acpi table from file /tmp/fadt.dat<br />
Acpi Data Table [FACP] decoded, written to "/tmp/fadt.dsl"</code></p>
<p>Check those two values to see if C2 is smaller then 100(0&#215;64) and C3 is smaller then 1000(0&#215;3E8).<br />
<code>acelan@acelan-nb ~ % grep Latency /tmp/fadt.dsl<br />
[060h 0096  2]                   C2 Latency : 0001<br />
[062h 0098  2]                   C3 Latency : 03E9</code></p>
<p>If not, that means BIOS blocks the system switch to C2/C3 state.</p>
<p>In drivers/acpi/processor_idle.c:325 (linux 2.6.35)<br />
<code>        /*<br />
         * FADT specified C2 latency must be less than or equal to<br />
         * 100 microseconds.<br />
         */<br />
        if (acpi_gbl_FADT.C2latency > ACPI_PROCESSOR_MAX_C2_LATENCY) {<br />
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,<br />
                        "C2 latency too large [%d]\n", acpi_gbl_FADT.C2latency));<br />
                /* invalidate C2 */<br />
                pr->power.states[ACPI_STATE_C2].address = 0;<br />
        }</p>
<p>        /*<br />
         * FADT supplied C3 latency must be less than or equal to<br />
         * 1000 microseconds.<br />
         */<br />
        if (acpi_gbl_FADT.C3latency > ACPI_PROCESSOR_MAX_C3_LATENCY) {<br />
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,<br />
                        "C3 latency too large [%d]\n", acpi_gbl_FADT.C3latency));<br />
                /* invalidate C3 */<br />
                pr->power.states[ACPI_STATE_C3].address = 0;<br />
        }<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2010/09/check-if-bios-supports-c2-c3-switch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build you own Android ROM from CyanogenMod</title>
		<link>http://blog.acelan.idv.tw/2010/03/build-you-own-android-rom-from-cyanogenmod/</link>
		<comments>http://blog.acelan.idv.tw/2010/03/build-you-own-android-rom-from-cyanogenmod/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 09:02:57 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=64</guid>
		<description><![CDATA[Just a simple note about what I have did for building my won Android ROM for my Nexus One
get repo utility from below link
http://source.android.com/download/using-repo
Then run
repo init -u git://github.com/cyanogen/android.git -b eclair
repo sync
Create a file buildspec.mk with those contents(for Nexus One)
TARGET_PRODUCT:=cyanogen_passion
TARGET_BUILD_VARIANT:=eng
TARGET_BUILD_TYPE:=release
Run the command to setup you environment
. build/envsetup.sh
To specifically configure the build system for CyanogenMod
lunch cyanogen_passion-eng
Connect you [...]]]></description>
			<content:encoded><![CDATA[<p>Just a simple note about what I have did for building my won Android ROM for my Nexus One</p>
<p>get repo utility from below link</p>
<p>http://source.android.com/download/using-repo</p>
<p>Then run<br />
<code>repo init -u git://github.com/cyanogen/android.git -b eclair</code><br />
<code>repo sync</code></p>
<p>Create a file buildspec.mk with those contents(for Nexus One)<br />
<code>TARGET_PRODUCT:=cyanogen_passion<br />
TARGET_BUILD_VARIANT:=eng<br />
TARGET_BUILD_TYPE:=release</code></p>
<p>Run the command to setup you environment<br />
<code>. build/envsetup.sh</code></p>
<p>To specifically configure the build system for CyanogenMod<br />
<code>lunch cyanogen_passion-eng</code></p>
<p>Connect you Nexus One with USB and open debug mode to retrieve proprietary library from cell phone<br />
<code>(cd vendor/google/passion;./extract-files.sh)</code></p>
<p><code>make -j4</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2010/03/build-you-own-android-rom-from-cyanogenmod/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Convert video to play on Nexus One(Android)</title>
		<link>http://blog.acelan.idv.tw/2010/02/convert-video-to-play-on-nexus-oneandroid/</link>
		<comments>http://blog.acelan.idv.tw/2010/02/convert-video-to-play-on-nexus-oneandroid/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 08:26:50 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Nexus One]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=61</guid>
		<description><![CDATA[% cat /etc/apt/sources.list.d/handbrake.list
deb http://ppa.launchpad.net/handbrake-ubuntu/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/handbrake-ubuntu/ppa/ubuntu karmic main
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 62D38753
sudo apt-get update
sudo aptitude install handbrake-cli
HandBrakeCLI -i ccc.avi -o ccc.mp4
]]></description>
			<content:encoded><![CDATA[<p><code>% cat /etc/apt/sources.list.d/handbrake.list<br />
deb http://ppa.launchpad.net/handbrake-ubuntu/ppa/ubuntu karmic main<br />
deb-src http://ppa.launchpad.net/handbrake-ubuntu/ppa/ubuntu karmic main</code></p>
<p><code>sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 62D38753</code><br />
<code>sudo apt-get update</code><br />
<code>sudo aptitude install handbrake-cli</code></p>
<p><code>HandBrakeCLI -i ccc.avi -o ccc.mp4</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2010/02/convert-video-to-play-on-nexus-oneandroid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apply patch</title>
		<link>http://blog.acelan.idv.tw/2009/11/apply-patch/</link>
		<comments>http://blog.acelan.idv.tw/2009/11/apply-patch/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 03:47:53 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[zsh]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=47</guid>
		<description><![CDATA[PATCH=patch_filename ; git am $PATCH &#124;&#124; (git apply --reject $PATCH ; find -name *.rej)
It&#8217;s done, if no .rej files be produced.
If git am failed, it&#8217;ll try to apply the other successful part and produce the .rej files to indicate the failed part.
Edit the failed files then, and using git status to make sure how many [...]]]></description>
			<content:encoded><![CDATA[<p><code>PATCH=patch_filename ; git am $PATCH || (git apply --reject $PATCH ; find -name *.rej)</code></p>
<p>It&#8217;s done, if no .rej files be produced.</p>
<p>If <code>git am</code> failed, it&#8217;ll try to apply the other successful part and produce the .rej files to indicate the failed part.</p>
<p>Edit the failed files then, and using <code>git status</code> to make sure how many files infected and using <code>git add files</code> to add them or using <code> git add -u</code> to add all not updated files.</p>
<p>Finally, <code>git am --resolved</code></p>
<p>Note for the zsh user. (2010/01/12)<br />
I changed my default shell to zsh recently and found the apply patch command is broken. Although zsh claim that it&#8217;s compatible with bash, there are still some difference. But the good news is we can overcome this problem by adding one more line in the .zshrc<br />
<code>setopt GLOB_SUBST</code><br />
More detail, please read <a href="http://zsh.sourceforge.net/Guide/zshguide02.html#l14">this</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2009/11/apply-patch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What a stupid thing I did!!</title>
		<link>http://blog.acelan.idv.tw/2009/10/what-a-stupid-thing-i-did/</link>
		<comments>http://blog.acelan.idv.tw/2009/10/what-a-stupid-thing-i-did/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 03:39:43 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=30</guid>
		<description><![CDATA[I&#8217;ve been curious who made the test_branch_1 branch on the ubuntu git tree for a long time. And today I checkout that branch and see the amazing log.
acelan@acelan-nb:~/workspace/ubuntu-karmic$ git branch -r             
  origin/HEAD -> origin/master
  origin/arm
  origin/ec2
  origin/fsl-imx51
  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been curious who made the test_branch_1 branch on the ubuntu git tree for a long time. And today I checkout that branch and see the amazing log.</p>
<p><code>acelan@acelan-nb:~/workspace/ubuntu-karmic$ git branch -r</code>             </p>
<blockquote><p>  origin/HEAD -> origin/master<br />
  origin/arm<br />
  origin/ec2<br />
  origin/fsl-imx51<br />
  origin/master<br />
  origin/mvl-dove<br />
  origin/netbook<br />
  origin/patches-that-need-love<br />
  origin/pending-upstream-patches<br />
  origin/test_branch_1</p></blockquote>
<p><code>acelan@acelan-nb:~/workspace/ubuntu-karmic$ git checkout -b test origin/test_branch_1</code></p>
<blockquote><p>Checking out files: 100% (9533/9533), done.<br />
Branch test set up to track remote branch test_branch_1 from origin.<br />
Switched to a new branch &#8216;test&#8217;</p></blockquote>
<p><code>acelan@acelan-nb:~/workspace/ubuntu-karmic$ git log</code></p>
<blockquote><p>commit a2c978c3ffb96982b3876b37c0a21fcc787234bc<br />
Author: AceLan Kao ＜acelan@ooo.xxx.com><br />
Date:   Fri Jun 12 13:42:45 2009 +0800             </p>
<p>    only for git test</p>
<p>commit fba4b54f8f16a11ff3e57b7ac76d437b5d831695<br />
Author: AceLan ＜acelan@acelan-nb.(none)><br />
Date:   Tue Jun 9 16:17:23 2009 +0800</p>
<p>    UBUNTU: [Upstream]</p>
<p>    Signed-off-by: AceLan ＜acelan@acelan-nb.(none)></p></blockquote>
<p>It was my second day, and I didn&#8217;t know too much about git. Of course, the branch was already been deleted, and nobody will know what I had did. :p</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2009/10/what-a-stupid-thing-i-did/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add extra work for kernel package</title>
		<link>http://blog.acelan.idv.tw/2009/10/add-extra-work-for-kernel-package/</link>
		<comments>http://blog.acelan.idv.tw/2009/10/add-extra-work-for-kernel-package/#comments</comments>
		<pubDate>Wed, 28 Oct 2009 02:27:35 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[packaging]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=28</guid>
		<description><![CDATA[If you would like to do more extra work while packaging the kernel package, modify this file
debian/rules.d/2-binary-arch.mk
If you would like to do more extra work after installing the kernel package, modify this file
debian/control-scripts/postinst
]]></description>
			<content:encoded><![CDATA[<p>If you would like to do more extra work while packaging the kernel package, modify this file<br />
<code>debian/rules.d/2-binary-arch.mk</code></p>
<p>If you would like to do more extra work after installing the kernel package, modify this file<br />
<code>debian/control-scripts/postinst</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2009/10/add-extra-work-for-kernel-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My git commands backup</title>
		<link>http://blog.acelan.idv.tw/2009/10/my-git-commands-backup/</link>
		<comments>http://blog.acelan.idv.tw/2009/10/my-git-commands-backup/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 07:26:50 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[kernel]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=20</guid>
		<description><![CDATA[On a new installed machine, you have to add your info in the ~/.gitconfig
git config --add user.name "AceLan Kao"
git config --add user.email acelan.kao@ccc.ccc

Clone Jaunty kernel and add my public repository, so that I can publish my modification to public git tree.
git clone --reference linux-2.6 git://kernel.ubuntu.com/ubuntu/ubuntu-jaunty.git
git remote add zinc git+ssh://zinc.ubuntu.com/srv/kernel.ubuntu.com/git/acelan/acelan-jaunty.git
NOTE. The reference git tree(ex. linux-2.6) shouldn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>On a new installed machine, you have to add your info in the ~/.gitconfig<br />
<code>git config --add user.name "AceLan Kao"<br />
git config --add user.email acelan.kao@ccc.ccc<br />
</code></p>
<p>Clone Jaunty kernel and add my public repository, so that I can publish my modification to <a href="http://kernel.ubuntu.com/git">public git tree</a>.<br />
<code>git clone --reference linux-2.6 git://kernel.ubuntu.com/ubuntu/ubuntu-jaunty.git<br />
git remote add zinc git+ssh://zinc.ubuntu.com/srv/kernel.ubuntu.com/git/acelan/acelan-jaunty.git</code><br />
NOTE. The reference git tree(ex. linux-2.6) shouldn&#8217;t be removed under any circumstances, or the reference object will disappear and the git tree will become unusable. The file <code>.git/objects/info/alternates</code> will record the referenced git tree, try to specify an available one, if you removed the original reference tree accidentally.</p>
<p><span id="more-20"></span></p>
<p>We usually cherry pick upstream kernel commit, this is the command.<br />
<code>git cherry-pick -s -e -x aa1812b3e</code></p>
<p>And the request letter format for cherry pick.<br />
<code>git request-pull \<br />
           <lastest SHA before your commit> \<br />
           git://kernel.ubuntu.com/<your_id_on_zinc>/my-jaunty.git \<br />
           > new_branch_1-request-pull.txt</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2009/10/my-git-commands-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Produce source package under Ubuntu</title>
		<link>http://blog.acelan.idv.tw/2009/10/produce-source-package-under-ubuntu/</link>
		<comments>http://blog.acelan.idv.tw/2009/10/produce-source-package-under-ubuntu/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 07:15:14 +0000</pubDate>
		<dc:creator>AceLan</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[source package]]></category>

		<guid isPermaLink="false">http://blog.acelan.idv.tw/?p=16</guid>
		<description><![CDATA[debuild -S -sa -i -I
]]></description>
			<content:encoded><![CDATA[<p><code>debuild -S -sa -i -I</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.acelan.idv.tw/2009/10/produce-source-package-under-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

