2010年12月24日 星期五

Android GPS porting HAL code

http://kb.cnblogs.com/a/1682913/
and
http://source.android.com/porting/gps.html
說要根據gps.h去implement gps driver (libgps.so)


http://blog.chinaunix.net/u3/118873/showart_2339574.html
有解釋GPS底層檔案分佈, JNI以及Android提供service的部份

http://www.douban.com/note/80170485/
提供Application開啟GPS呼叫到底層回覆的過程

有人回應說需要implement HAL
http://groups.google.com/group/android-developers/browse_thread/thread/3bb4dd9070451df2#

http://blog.chinaunix.net/u1/56680/showart_2143187.html
android gps 需要實做HAL(hardware abstruct layer)

該怎麼作呢

參考glgps.c
用mm來buidl libhardware_legacy.so
所以要想辦法讓mm可以build出libhardware_legacy.so


Modify
/device/fsl/imx51_bbg/BoardConfig.mk

add BOARD_GPS_LIBRARIES := libgps

switch  /hardware/libhardware_legacy

choosecombo設定一下平台


Build for the simulator or the device?
     1. Device
     2. Simulator

Which would you like? [1]


Build type choices are:
     1. release
     2. debug

Which would you like? [1]


Which product would you like? [imx51_bbg]


Variant choices are:
     1. user
     2. userdebug
     3. eng
Which would you like? [eng]

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.2
TARGET_PRODUCT=imx51_bbg
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=FRF85B
============================================

build:

elsonchung@gps1004:~/myandroid9.1/hardware/libhardware_legacy$ mm 
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.2
TARGET_PRODUCT=imx51_bbg
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=FRF85B
============================================
No private recovery resources for TARGET_DEVICE imx51_bbg
make: Entering directory `/home/nelsonchung/myandroid9.1'
Copy: out/target/product/imx51_bbg/root/init.rc
target thumb C: libhardware_legacy <= hardware/libhardware_legacy/gps/glgps.c
target SharedLib: libhardware_legacy (out/target/product/imx51_bbg/obj/SHARED_LIBRARIES/libhardware_legacy_intermediates/LINKED/libhardware_legacy.so)
target Prelink: libhardware_legacy (out/target/product/imx51_bbg/symbols/system/lib/libhardware_legacy.so)
libelfcopy: Warning: Range lists in .debug_info section aren't in ascending order!
libelfcopy: Warning: Range lists in .debug_ranges section start at 0x5a8
target Strip: libhardware_legacy (out/target/product/imx51_bbg/obj/lib/libhardware_legacy.so)
Install: out/target/product/imx51_bbg/system/lib/libhardware_legacy.so
make: Leaving directory `/home/nelsonchung/myandroid9.1'

如果用mm showcommands
可以看到
glgps.c 編譯成glgps.o 並放到out/target/product/imx51_bbg/obj/SHARED_LIBRARIES/libhardware_legacy_intermediates/gps/

message:
out/target/product/imx51_bbg/obj/SHARED_LIBRARIES/libhardware_legacy_intermediates/gps/glgps.o hardware/libhardware_legacy/gps/glgps.c

最後編譯好的libhardware_legacy.so就會放到以下路徑
out/target/product/imx51_bbg/system/lib/libhardware_legacy.so

croot
make snod
去產生system.img

這之間為了讓Android能夠正常起來
follow http://nelsonchunglife.blogspot.com/2010/12/disable-original-audio-driver-and.html
重新編譯了system.img

使用Denny寫好的GPSDemo
利用adb install X.apk裝到機器上

操作Panel
Settings-->Applications-->Manage applications-->Downloaded
就會看到剛剛install的程式
點擊執行
能夠看到在glgps.c裡面加上的message

D/gps_BRCM( 2106): *****20101216: gps_init *****
AP還沒看到gps相關訊息
底層有些訊息值得參考
E/ThrottleService( 2102): Could not open GPS configuration file /etc/gps.conf

W/GpsLocationProvider( 2102): Could not open GPS configuration file /etc/gps.conf

D/gps_BRCM( 2102): *****20101216: gps_init *****
D/gps_BRCM( 2102): gps state initialized
D/gps_BRCM( 2102): gps thread running

Could not open GPS configuration file /etc/gps.conf的訊息只是warning not error.
follow this information.
http://groups.google.com/group/android-framework/browse_thread/thread/9c2a9b8b7c7fb394

發現卡住epoll_wait

恢復預設值 /cache/gpspipe
執行GPSDemo 出現
E/GpsLocationProvider( 2107): native_start failed in startNavigating()
設成 /dev/ttymxc1
看一下會不會
E/GpsLocationProvider( 2107): native_start failed in startNavigating()
一樣

此錯誤訊息發生在GpsLocationProvider.java的startNavigating()

因為將gps mode設成 GPS_POSITION_MODE_MS_BASED
造成HAL(glgps.c)判斷gps mode非 GPS_POSITION_MODE_STANDALONE回傳false
而出現的錯誤訊息

誰應該設定gps mode為 GPS_POSITION_MODE_STANDALONE呢?

是根據這行判斷而來的

           if (Settings.Secure.getInt(mContext.getContentResolver(),
                    Settings.Secure.ASSISTED_GPS_ENABLED, 1) != 0) {
                positionMode = GPS_POSITION_MODE_MS_BASED;
            } else {
                positionMode = GPS_POSITION_MODE_STANDALONE;
            }

Denny 說 ASSISTED_GPS_ENABLED 就是所謂的AGPS.
Android 2.2版已經建議移除

上面code的意思是 如果ASSISTEND_GPS_ENABLED沒有定義
會回傳第三個參數值(1)
1 != 0
所以設定成GPS_POSITION_MODE_MS_BASED

參考
http://developer.android.com/reference/android/provider/Settings.Secure.html#getInt(android.content.ContentResolver, java.lang.String, int)

compare /hardware/qcom/gps/loc_api/libloc_api/loc_eng.cpp with /hardware/libhardware_legacy/gps/glgps.c

loc_eng_set_position_mode and gps_set_position_mode


            if (!native_start(positionMode, false, 1)) {
                mStarted = false;
                Log.e(TAG, "native_start failed in startNavigating()");
                return;
            }



nelsonchung@gps1004:~/myandroid9.1$ cgrep native_start
./frameworks/base/core/jni/android_location_GpsLocationProvider.cpp:519:    {"native_start", "(IZI)Z", (void*)android_location_GpsLocationProvider_start},

native_start會對應到 android_location_GpsLocationProvider_start

--

建立軟連結的方式
modify the content on /device/fsl/imx5x/init.rc
symlink /dev/ttymxc1 /pipe
在將glgps.c GPS_PIPE 由原先的 /cache/gpspipe 改成 /gpspipe
就不會發生open com port fail的問題
猜測是權限的問題
叫glgps.c檔案起來的process權限可能不足
--

之後open後回傳fd去作註冊的動作epoll_register
就不會一直卡在epoll_wait

epoll是linux為了改善poll的機制
透過發送event的方式改善performance

註冊完之後如果該com port有送出訊息的話
linux就會送出event出來
就可以繼續往後執行

之後用read方式讀取gps nmea
透過nmea_reader_addc丟給Android structure - NmeaReader
之後透過nmea_reader_set_callback回應給Android gps interface.

這樣子之後用Denny GPSDemo程式可以讀到經緯度的資料

另外
GPS status and nmea還沒辦法完整呈現

透過Facebook分享

解壓縮rar under Ubuntu

在Ubuntu下解壓縮rar

使用壓縮檔管理員
卻發現無法開啟
需要安裝rar 套件


nelsonchung@ubuntu:~/Tools/Src$ sudo apt-get install rar
[sudo] password for nelsonchung:
正在讀取套件清單... 完成
正在重建相依關係        
正在讀取狀態資料... 完成
建議套件:
  unrar
下列【新】套件將會被安裝:
  rar
升級 0 個,新安裝 1 個,移除 0 個,有 26 個未被升級。
需要下載 556kB 的套件檔。
此操作完成之後,會多佔用 1,192kB 的磁碟空間。
下載:1 http://tw.archive.ubuntu.com/ubuntu/ lucid/multiverse rar 1:3.9.b2-1 [556kB]
取得 556kB 用了 3s (162kB/s)
選取了原先未被選取的套件 rar。
(正在讀取資料庫 ... 系統目前共安裝了 168478 個檔案和目錄。)
正在解開 rar (從 .../rar_1%3a3.9.b2-1_i386.deb)...
正在進行 man-db 的觸發程式 ...
正在設定 rar (1:3.9.b2-1) ...

安裝完

找到該檔案
按下滑鼠右鍵
選擇"在此解壓縮"
就可以嚕

or 
rar x A.rar

如果不想產生一個folder (the directory name is depended on your file name)
而是直接解壓縮檔案出來
可以使用
rar e A.rar

透過Facebook分享

2010年12月23日 星期四

run shell script when system init

需要修改init.rc

service ServiceName Pathshell Pathshellscript
    oneshot

ServiceName: 填寫service名稱
Pathshell:  sh的路徑
Pathshellscript:  shellscript的路徑

ex.
執行lnset.sh

service lnset /system/bin/sh /system/etc/lnset.sh
    oneshot

cat lnset.sh
ln -s /dev/ttymxc1 /pipecfromsh
ln -s /dev/ttymxc1 /cache/pipecfromsh

透過Facebook分享

2010年12月22日 星期三

mkfifo - 實現GPS virtual com port的概念

開啟終端機A
mkdir temp
cd temp

mkfifo pipe1
mkfifo pipe2

ls

prw-r--r--  1 nelsonchung nelsonchung        0 2010-12-22 11:21 pipe1|
prw-r--r--  1 nelsonchung nelsonchung        0 2010-12-22 11:21 pipe2|

開啟終端機B
nelsonchung@ubuntu:~$ echo "This is test mkfifo from nelson 1" > ~/temp/pipe1 &
[1] 2914
nelsonchung@ubuntu:~$ echo "This is test mkfifo from nelson 2" > ~/temp/pipe2 &
[2] 2915

回到終端機A
nelsonchung@ubuntu:~/temp$ cat pipe1
This is test mkfifo from nelson 1
nelsonchung@ubuntu:~/temp$ cat pipe2
This is test mkfifo from nelson 2

所以可以把同一個來源
同時導向不同的pipe

可以實現GPS virtual com port的概念



透過Facebook分享

Acer aspire one 風扇噪音問題解決 under Ubuntu

  • 安裝dmidecode

sudo apt-get install dmidecode





  • 解壓縮tools

tar zxvf AcerFanTool.tar.gz


  • 修改權限

chmod 755 acerfand

  • 複製到系統/usr/local/bin

sudo cp acerfand acer_ec.pl /usr/local/bin


  • 執行

sudo acerfand

馬上沒聲音

Reference:
http://ithelp.ithome.com.tw/question/10012052d
https://help.ubuntu.com/community/AspireOne

透過Facebook分享

2010年12月21日 星期二

3.7 How make Reads a Makefile

GNU make does its work in two distinct phases. During the first phase it reads all the makefiles, included makefiles, etc. and internalizes all the variables
   and their values, implicit and explicit rules, and constructs a dependency graph of all the targets and their prerequisites. During the second phase, make
   uses these internal structures to determine what targets will need to be rebuilt and to invoke the rules necessary to do so.

原來make在做事情的時候會有兩個階段
1. 先把所有makefile讀入, include相關makefile, 載入所有相關變數
最後建立一個 相關連的dependency

2. 根據makefile條件來決定哪些target需要被更新

Reference


透過Facebook分享

修改sl410 trackpoint 小紅點的靈敏度 under 10.04

Follow在ubuntu 10.4中調整trackpoint的sensitivity作設定


發現my系統的speed and sensitivity跟作者的不同

nelsonchung@ubuntu:/sys/devices/platform/i8042$ find . -type f -name speed
./serio4/serio5/speed
nelsonchung@ubuntu:/sys/devices/platform/i8042$ find . -type f -name sensitivity
./serio4/serio5/sensitivity

以下是我的修改內容
將以下內容修改到/etc/udev/rules.d/10-trackpoint.rules

SUBSYSTEM=="serio", DRIVERS=="psmouse"

WAIT_FOR="/sys/devices/platform/i8042/serio4/serio5/speed", ATTR{speed}="120"
WAIT_FOR="/sys/devices/platform/i8042/serio4/serio5/sensitivity", ATTR{sensitivity}="245"


ps:
http://zh.wikipedia.org/zh/Udev


透過Facebook分享

如何得知修改某個檔案會被放到root or system folder

使用showcommands

這裡修改了/system/core/init/devices

showcommands告訴你

會被編譯成init檔案
然後安裝到root下

nelsonchung@gps1004:~/myandroid9.1/system/core/init$ mm showcommands
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.2
TARGET_PRODUCT=imx51_bbg
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=FRF85B
============================================
No private recovery resources for TARGET_DEVICE imx51_bbg
make: Entering directory `/home/nelsonchung/myandroid9.1'
target thumb C: init <= system/core/init/devices.c
prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc  -I system/core/init   -I out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates   -I system/core/include   -I hardware/libhardware/include   -I hardware/libhardware_legacy/include   -I hardware/ril/include   -I dalvik/libnativehelper/include   -I frameworks/base/include   -I frameworks/base/opengl/include   -I external/skia/include   -I out/target/product/imx51_bbg/obj/include   -I bionic/libc/arch-arm/include   -I bionic/libc/include   -I bionic/libstdc++/include   -I bionic/libc/kernel/common   -I bionic/libc/kernel/arch-arm   -I bionic/libm/include   -I bionic/libm/include/arch/arm   -I bionic/libthread_db/include  -c  -fno-exceptions -Wno-multichar -msoft-float -fpic -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -march=armv7-a -mfloat-abi=softfp -mfpu=neon -include system/core/include/arch/linux-arm/AndroidConfig.h -I system/core/include/arch/linux-arm/ -mthumb-interwork -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -DNDEBUG -g -Wstrict-aliasing=2 -finline-functions -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -DNDEBUG -UDEBUG -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64       -MD -o out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/devices.o system/core/init/devices.c
target StaticExecutable: init (out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/LINKED/init)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-g++ -nostdlib -Bstatic -Wl,-T,build/core/armelf.x -Wl,--gc-sections -o out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/LINKED/init -Lout/target/product/imx51_bbg/obj/lib out/target/product/imx51_bbg/obj/lib/crtbegin_static.o   -Wl,--no-undefined  -Wl,--fix-cortex-a8         out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/builtins.o out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/init.o out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/devices.o out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/property_service.o out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/util.o out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/parser.o out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/logo.o      out/target/product/imx51_bbg/obj/STATIC_LIBRARIES/liblog_intermediates/liblog.a out/target/product/imx51_bbg/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a out/target/product/imx51_bbg/obj/STATIC_LIBRARIES/libc_intermediates/libc.a  /home/nelsonchung/myandroid9.1/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/interwork/libgcc.a out/target/product/imx51_bbg/obj/lib/crtend_android.o
target Non-prelinked: init (out/target/product/imx51_bbg/symbols/init)
out/host/linux-x86/bin/acp -fpt out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/LINKED/init out/target/product/imx51_bbg/symbols/init
target Strip: init (out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/init)
out/host/linux-x86/bin/soslim --strip --shady --quiet out/target/product/imx51_bbg/symbols/init --outfile out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/init
Install: out/target/product/imx51_bbg/root/init
out/host/linux-x86/bin/acp -fpt out/target/product/imx51_bbg/obj/EXECUTABLES/init_intermediates/init out/target/product/imx51_bbg/root/init
Copy: out/target/product/imx51_bbg/root/init.rc
out/host/linux-x86/bin/acp -fpt device/fsl/imx5x/init.rc out/target/product/imx51_bbg/root/init.rc
make: Leaving directory `/home/nelsonchung/myandroid9.1'


透過Facebook分享

找出最近修改過哪些檔案

Linux下你可以使用find

找尋當目錄下, 60分鐘內修改過的檔案
ex.
find . -mmin -60

透過Facebook分享

屬於我們家的第一顆耶誕樹 - 2010



屬於我們家的第一顆耶誕樹
有巧禎的心思佈置在裡面
也有她的歌聲在裡面

透過Facebook分享

Pair and unpair bt phone on android

點選Setting
 點選 Wireless &networks
 點 Bluetooth settings
 點 Scan for devices
然後選擇你要連線的裝置
 填入input pin code
點輸入框
 填入數字 (方便手機輸入)

ex.
0000
點Done
 點OK
 此時手機端需要輸入0000
進行pair

接下來進行unpair
長按前bt連線裝置

點選Unpair
 就成功嚕

Reference:

透過Facebook分享

擷取android螢幕資訊

可以使用android所提供的ddms工具
Linux下在/android-sdk-linux_86/tools下

cd /android-sdk-linux_86_tools
. ddms

開啟之後
Device->Screen capture



參考網頁有說明需要解鎖

有Application可以直接放到device上的嗎?
Reference:
http://www.sogi.com.tw/newforum/article_list.aspx?Topic_id=6081894

透過Facebook分享

2010年12月20日 星期一

計算某目錄大小 - du

du -s 列出該目錄總占大小 以KB為單位

du -h 列出該目錄所有子目錄所占大小 (--human-readable)

Reference:
http://www.weithenn.org/cgi-bin/wiki.pl?du-%E8%A8%88%E7%AE%97%E6%AA%94%E6%A1%88%E3%80%81%E8%B3%87%E6%96%99%E5%A4%BE%E5%A4%A7%E5%B0%8F
and
man du

透過Facebook分享
nelsonchung@gps1004:~/myandroid9.1$ du -sh kernel_imx_usbh3/
1.9G kernel_imx_usbh3/
nelsonchung@gps1004:~/myandroid9.1$ find kernel_imx_usbh3/ -type f -name "*.o" -print0 | xargs -0 rm
nelsonchung@gps1004:~/myandroid9.1$ du -sh kernel_imx_usbh3/
1.8G kernel_imx_usbh3/
nelsonchung@gps1004:~/myandroid9.1$ find kernel_imx_usbh3/ -type d -name "\.git" -print0 | xargs -0 rm -rf
nelsonchung@gps1004:~/myandroid9.1$ du -sh kernel_imx_usbh3/
1.4G kernel_imx_usbh3/

刪掉*.o 少100MB
刪掉.git 少400MB
刪掉一些怪怪的folder  (原來是我使用kscope軟體做的備份檔)
myandroid9.1
myandroid9.1-kernel_imx

剩526MB

nelsonchung@gps1004:~/myandroid9.1$ du -sh kernel_imx_usbh3
526M kernel_imx_usbh3

壓縮一下

剩一百多MB
nelsonchung@gps1004:~/myandroid9.1$ ls -al kernel_imx_usbh3.tar.gz 
-rw-r--r-- 1 nelsonchung nelsonchung 114827571 2010-12-20 15:31 kernel_imx_usbh3.tar.gz


透過Facebook分享

建立跨目錄的連結

follow http://nelsonchunglife.blogspot.com/2010/12/blog-post_16.html
卻發現建立跨目錄的連結會出現以下error

太多層級的符號連結檔
or
沒有此一檔案或目錄

根據你建立目錄的位置而定

Solution
使用絕對路徑
ln -s BBB aaa

BBB的部份請使用絕對路徑

這樣子產生的aaa就能夠任意的放置到其他目錄下也可以透過aaa切換到BBB去

ex.

ln -s /media/BE60E19860E15823/Ubuntu/myandroid9.1/ ~/myandroid9.1

透過Facebook分享

Install VirtualBox under Ubuntu lucid 10.04

官方網站

VirtualBox 3.2.12 for Linux hosts


Ubuntu 10.04 LTS ("Lucid Lynx") i386 | AMD64


選擇i386


我直接使用套件安裝軟體安裝




透過Facebook分享

2010年12月19日 星期日

Ubuntu系統支援4G以上的ram - PAE(physical address extension)

請安裝以下套件
sudo apt-get install linux-headers-server linux-image-server linux-server


可以使用free -m看memory

升級過程

nelsonchung@ubuntu:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          2863       2179        684          0        757        967
-/+ buffers/cache:        455       2408
Swap:          254          0        254
nelsonchung@ubuntu:~$ sudo apt-get update
[sudo] password for nelsonchung:
下載:1 http://dl.google.com stable Release.gpg [197B]
略過 http://dl.google.com/linux/chrome/deb/ stable/main Translation-zh_TW    
已有 http://tw.archive.ubuntu.com lucid Release.gpg                          
下載:2 http://tw.archive.ubuntu.com/ubuntu/ lucid/main Translation-zh_TW [56.4kB]
已有 http://security.ubuntu.com lucid-security Release.gpg                  
略過 http://security.ubuntu.com/ubuntu/ lucid-security/main Translation-zh_TW
已有 http://archive.canonical.com lucid Release.gpg                          
略過 http://archive.canonical.com/ lucid/partner Translation-zh_TW          
已有 http://ppa.launchpad.net lucid Release.gpg                              
略過 http://ppa.launchpad.net/globalmenu-team/ppa/ubuntu/ lucid/main Translation-zh_TW
已有 http://ppa.launchpad.net lucid Release.gpg                            
略過 http://security.ubuntu.com/ubuntu/ lucid-security/restricted Translation-zh_TW
略過 http://security.ubuntu.com/ubuntu/ lucid-security/universe Translation-zh_TW
略過 http://security.ubuntu.com/ubuntu/ lucid-security/multiverse Translation-zh_TW
已有 http://security.ubuntu.com lucid-security Release                      
已有 http://archive.canonical.com lucid Release                            
略過 http://ppa.launchpad.net/tualatrix/ppa/ubuntu/ lucid/main Translation-zh_TW
已有 http://ppa.launchpad.net lucid Release                        
下載:3 http://dl.google.com stable Release [1,347B]                
略過 http://tw.archive.ubuntu.com/ubuntu/ lucid/restricted Translation-zh_TW
已有 http://ppa.launchpad.net lucid Release                                  
已有 http://security.ubuntu.com lucid-security/main Packages                
已有 http://archive.canonical.com lucid/partner Packages                    
下載:4 http://tw.archive.ubuntu.com/ubuntu/ lucid/universe Translation-zh_TW [29.7kB]
已有 http://ppa.launchpad.net lucid/main Packages                            
已有 http://security.ubuntu.com lucid-security/restricted Packages    
已有 http://security.ubuntu.com lucid-security/main Sources          
已有 http://security.ubuntu.com lucid-security/restricted Sources    
已有 http://security.ubuntu.com lucid-security/universe Packages      
已有 http://security.ubuntu.com lucid-security/universe Sources      
下載:5 http://dl.google.com stable/main Packages [1,076B]            
已有 http://ppa.launchpad.net lucid/main Packages                            
已有 http://security.ubuntu.com lucid-security/multiverse Packages
已有 http://security.ubuntu.com lucid-security/multiverse Sources
下載:6 http://tw.archive.ubuntu.com/ubuntu/ lucid/multiverse Translation-zh_TW [3,024B]
下載:7 http://tw.archive.ubuntu.com lucid-updates Release.gpg [198B]
略過 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/main Translation-zh_TW
略過 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/restricted Translation-zh_TW
略過 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/universe Translation-zh_TW
略過 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/multiverse Translation-zh_TW
已有 http://tw.archive.ubuntu.com lucid Release
下載:8 http://tw.archive.ubuntu.com lucid-updates Release [44.7kB]
已有 http://tw.archive.ubuntu.com lucid/main Packages
已有 http://tw.archive.ubuntu.com lucid/restricted Packages
已有 http://tw.archive.ubuntu.com lucid/main Sources
已有 http://tw.archive.ubuntu.com lucid/restricted Sources                  
已有 http://tw.archive.ubuntu.com lucid/universe Packages                    
已有 http://tw.archive.ubuntu.com lucid/universe Sources                    
已有 http://tw.archive.ubuntu.com lucid/multiverse Packages                  
已有 http://tw.archive.ubuntu.com lucid/multiverse Sources                  
下載:9 http://tw.archive.ubuntu.com lucid-updates/main Packages [370kB]      
下載:10 http://tw.archive.ubuntu.com lucid-updates/restricted Packages [3,240B]
下載:11 http://tw.archive.ubuntu.com lucid-updates/main Sources [141kB]      
下載:12 http://tw.archive.ubuntu.com lucid-updates/restricted Sources [1,443B]
下載:13 http://tw.archive.ubuntu.com lucid-updates/universe Packages [159kB]
下載:14 http://tw.archive.ubuntu.com lucid-updates/universe Sources [61.3kB]
下載:15 http://tw.archive.ubuntu.com lucid-updates/multiverse Packages [7,366B]
下載:16 http://tw.archive.ubuntu.com lucid-updates/multiverse Sources [3,677B]
取得 884kB 用了 11s (78.9kB/s)                                              
正在讀取套件清單... 完成
nelsonchung@ubuntu:~$ sudo apt-get install linux-headers-server linux-image-server linux-server
正在讀取套件清單... 完成
正在重建相依關係        
正在讀取狀態資料... 完成
下列的額外套件將被安裝:
  linux-generic-pae linux-headers-2.6.32-26-generic-pae
  linux-headers-generic-pae linux-image-2.6.32-26-generic-pae
  linux-image-generic-pae
建議套件:
  fdutils linux-doc-2.6.32 linux-source-2.6.32 linux-tools
下列【新】套件將會被安裝:
  linux-generic-pae linux-headers-2.6.32-26-generic-pae
  linux-headers-generic-pae linux-headers-server
  linux-image-2.6.32-26-generic-pae linux-image-generic-pae linux-image-server
  linux-server
升級 0 個,新安裝 8 個,移除 0 個,有 12 個未被升級。
需要下載 32.4MB 的套件檔。
此操作完成之後,會多佔用 109MB 的磁碟空間。
是否繼續進行 [Y/n]?y
下載:1 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/main linux-image-2.6.32-26-generic-pae 2.6.32-26.48 [31.6MB]
下載:2 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/main linux-image-generic-pae 2.6.32.26.28 [4,160B]
下載:3 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/main linux-generic-pae 2.6.32.26.28 [4,148B]
下載:4 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/main linux-headers-2.6.32-26-generic-pae 2.6.32-26.48 [763kB]
下載:5 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/main linux-headers-generic-pae 2.6.32.26.28 [4,148B]
下載:6 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/main linux-headers-server 2.6.32.26.28 [4,158B]
下載:7 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/main linux-image-server 2.6.32.26.28 [4,156B]
下載:8 http://tw.archive.ubuntu.com/ubuntu/ lucid-updates/main linux-server 2.6.32.26.28 [4,150B]
取得 32.4MB 用了 34s (942kB/s)                                              
選取了原先未被選取的套件 linux-image-2.6.32-26-generic-pae。
(正在讀取資料庫 ... 系統目前共安裝了 156551 個檔案和目錄。)
正在解開 linux-image-2.6.32-26-generic-pae (從 .../linux-image-2.6.32-26-generic-pae_2.6.32-26.48_i386.deb)...
Done.
選取了原先未被選取的套件 linux-image-generic-pae。
正在解開 linux-image-generic-pae (從 .../linux-image-generic-pae_2.6.32.26.28_i386.deb)...
選取了原先未被選取的套件 linux-generic-pae。
正在解開 linux-generic-pae (從 .../linux-generic-pae_2.6.32.26.28_i386.deb)...
選取了原先未被選取的套件 linux-headers-2.6.32-26-generic-pae。
正在解開 linux-headers-2.6.32-26-generic-pae (從 .../linux-headers-2.6.32-26-generic-pae_2.6.32-26.48_i386.deb)...
選取了原先未被選取的套件 linux-headers-generic-pae。
正在解開 linux-headers-generic-pae (從 .../linux-headers-generic-pae_2.6.32.26.28_i386.deb)...
選取了原先未被選取的套件 linux-headers-server。
正在解開 linux-headers-server (從 .../linux-headers-server_2.6.32.26.28_i386.deb)...
選取了原先未被選取的套件 linux-image-server。
正在解開 linux-image-server (從 .../linux-image-server_2.6.32.26.28_i386.deb)...
選取了原先未被選取的套件 linux-server。
正在解開 linux-server (從 .../linux-server_2.6.32.26.28_i386.deb)...
正在設定 linux-image-2.6.32-26-generic-pae (2.6.32-26.48) ...
Running depmod.
update-initramfs: Generating /boot/initrd.img-2.6.32-26-generic-pae
Running postinst hook script /usr/sbin/update-grub.
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.32-26-generic-pae
Found initrd image: /boot/initrd.img-2.6.32-26-generic-pae
Found linux image: /boot/vmlinuz-2.6.32-26-generic
Found initrd image: /boot/initrd.img-2.6.32-26-generic
Found linux image: /boot/vmlinuz-2.6.32-24-generic
Found initrd image: /boot/initrd.img-2.6.32-24-generic
Found Windows NT/2000/XP on /dev/sda1
done
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/nvidia-common 2.6.32-26-generic-pae /boot/vmlinuz-2.6.32-26-generic-pae
run-parts: executing /etc/kernel/postinst.d/pm-utils 2.6.32-26-generic-pae /boot/vmlinuz-2.6.32-26-generic-pae

正在設定 linux-image-generic-pae (2.6.32.26.28) ...
正在設定 linux-generic-pae (2.6.32.26.28) ...
正在設定 linux-headers-2.6.32-26-generic-pae (2.6.32-26.48) ...
Examining /etc/kernel/header_postinst.d.
run-parts: executing /etc/kernel/header_postinst.d/nvidia-common 2.6.32-26-generic-pae /boot/vmlinuz-2.6.32-26-generic-pae

正在設定 linux-headers-generic-pae (2.6.32.26.28) ...
正在設定 linux-headers-server (2.6.32.26.28) ...
正在設定 linux-image-server (2.6.32.26.28) ...
正在設定 linux-server (2.6.32.26.28) ...

sudo reboot now
重新開機後

nelsonchung@ubuntu:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          5881       1346       4534          0        543        595
-/+ buffers/cache:        207       5674
Swap:          254          0        254



Reference:

透過Facebook分享