ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上

2012年7月16日 星期一

還是一樣:把10.4 repo mirror 在 local

這次有異狀的就只有 mtd-utils 和 alsa-utils。
明明就有手動 clone,結果 c_patch 又 complain exist。
看一下 baseversion.xml,果然是寫 NEW。
手動改 CHANGE 會 fail,因為那個 patch 真的是 for NEW....

所以就只有回答 yes,讓她刪了。

完成:
project bionic/                                 branch imx_r10.4
project bootable/bootloader/uboot-imx/          branch imx_r10.4
project bootable/recovery/                      branch imx_r10.4
project build/                                  branch imx_r10.4
project development/                            branch imx_r10.4
project external/alsa-lib/                      branch imx_r10.4
project external/alsa-utils/                    branch imx_r10.4
project external/bluetooth/bluez/               branch imx_r10.4
project external/dhcpcd/                        branch imx_r10.4
project external/e2fsprogs/                     branch imx_r10.4
project external/genext2fs/                     branch imx_r10.4
project external/mtd-utils/                     branch imx_r10.4
project external/ppp/                           branch imx_r10.4
project external/sqlite/                        branch imx_r10.4
project external/wpa_supplicant/                branch imx_r10.4
project frameworks/base/                        branch imx_r10.4
project hardware/alsa_sound/                    branch imx_r10.4
project hardware/libhardware/                   branch imx_r10.4
project hardware/libhardware_legacy/            branch imx_r10.4
project hardware/ril/                           branch imx_r10.4
project kernel_imx/                             branch imx_r10.4
project packages/apps/Browser/                  branch imx_r10.4
project packages/apps/Camera/                   branch imx_r10.4
project packages/apps/CertInstaller/            branch imx_r10.4
project packages/apps/Gallery3D/                branch imx_r10.4
project packages/apps/Music/                    branch imx_r10.4
project packages/apps/Settings/                 branch imx_r10.4
project packages/apps/SoundRecorder/            branch imx_r10.4
project packages/inputmethods/PinyinIME/        branch imx_r10.4
project packages/providers/MediaProvider/       branch imx_r10.4
project packages/wallpapers/MagicSmoke/         branch imx_r10.4
project prebuilt/                               branch imx_r10.4
project system/core/                            branch imx_r10.4
project system/extras/                          branch imx_r10.4
project system/netd/                            branch imx_r10.4
project system/vold/                            branch imx_r10.4
實際上還要參考 baseversion.xml。一堆 NEW 的 folder 不會在 manifest.xml..

Helio 配 java 7

安裝 android SDK 會有error

follow 這個: http://stackoverflow.com/questions/142357/what-are-the-best-jvm-settings-for-eclipse/3275659#3275659
也沒效,只好 uninstall java7。
用 java 6 就 OK。

檢查一下,還有 19 個 NEW

2012年7月13日 星期五

localize android repo -- more more..

現在 repo 好像有點修改了,所以上次那篇: http://r40eubuntu.blogspot.tw/2011/05/code-default.html
要作一些修改...


複習:

要把整個 android source 都納入 repo 管理,並且放在 local server 中。

首先 repo init, sync 時,一定要用 --mirror 參數,否則 manifest.xml 的內容 (path) 不會正確。

這次 manifest.xml 的內容有點改變,以往 remote server name:address 是寫在 manifest.xml 裡。
現在好像會在 repo init 時,依照 init -u 的 source 改變。

所以一旦 mirror 到 local server 後,不用修改 manifest.xml。
之後 從 local server 作 repo init 的,都會從 local server clone。
關鍵好像是在 .repo/manifests.git/config

以前的 bsp 會提供一個修改過的 default.xml。現在(10.4)沒了,要自己刪檔,所以刪完 project 後, repo 就會 fail -- folder 與 manifest.xml 內容不一致。



次序錯了,一開始 manifest 開 branch 時,要用 imx_r10.4,所以那些新加的 project,也要tag imx_r10.4。

這樣 c_patch 完後,那些修改都可以直接 push (?)。


避免 雞 - 蛋 問題, test repo 的 client folder (就是完整 clone repo 的 folder) 最好有兩個。
一個測試用。一個是用來上 patch。


現在 google 都教人作 mirror 了...http://source.android.com/source/downloading.html#using-a-local-mirror

copy:



When using several clients, especially in situations where bandwidth is scarce, it is better to create a local mirror of the entire server content, and to sync clients from that mirror (which requires no network access). The download for a full mirror is smaller than the download of two clients, while containing more information.

These instructions assume that the mirror is created in /usr/local/aosp/mirror. The first step is to create and sync the mirror itself, which uses close to 13GB of network bandwidth and a similar amount of disk space. Notice the --mirror flag, which can only be specified when creating a new client:
$ mkdir -p /usr/local/aosp/mirror
$ cd /usr/local/aosp/mirror
$ repo init -u https://android.googlesource.com/mirror/manifest --mirror
$ repo sync
Once the mirror is synced, new clients can be created from it. Note that it's important to specify an absolute path:
$ mkdir -p /usr/local/aosp/master
$ cd /usr/local/aosp/master
$ repo init -u /usr/local/aosp/mirror/platform/manifest.git
$ repo sync
Finally, to sync a client against the server, the mirror needs to be synced against the server, then the client against the mirror:
$ cd /usr/local/aosp/mirror
$ repo sync
$ cd /usr/local/aosp/master
$ repo sync
It's possible to store the mirror on a LAN server and to access it over NFS, SSH or Git. It's also possible to store it on a removable drive and to pass that drive around between users or between machines.

2012年7月11日 星期三

找到 browser download file 的機制


其實就到處 grep download。

frame/base/core/java/android/webkit/CallbackProxy.java:
的 handleMessage(Message msg)

switch (msg.what) { .... case DOWNLOAD_FILE: if (mDownloadListener != null) { String url = msg.getData().getString("url"); String userAgent = msg.getData().getString("userAgent"); String contentDisposition = msg.getData().getString("contentDisposition"); String mimetype = msg.getData().getString("mimetype"); Long contentLength = msg.getData().getLong("contentLength"); mDownloadListener.onDownloadStart(url, userAgent, contentDisposition, mimetype, contentLength); } break;
但是grep DOWNLOAD_FILE,好像是 CallbackProxy.java 自己的 constant。

只有在 : public boolean onDownloadStart(String url, String userAgent,
使用到。


CallbackProxy -- call: DownloadListener.onDownloadStart
---結果 DownloadListener 是 interface,

有 implement DownloadListener 這個 interface 的有:
.. ? 只有 packages/apps/Browser/src/com/android/browser/BrowserActivity.java
.. 所以是 ap 自己要負責 ?

BrowserActivity 真的在 implement onDownloadStart( ) 時,很盡職的準備好 intent,然後用 StartActivity 叫起 DownloadManager (我猜的..)


所以要回去 trace CallbackProxy 了:

CallbackProxy.onDownloadStart( ) 準備好 message,然後CallbackProxy.handleMessage( ) 才去 call DownloadListener.onDownloadStart( )。
-- 所以是 callbackProxy.onDownloadStart 起的頭。

/framework/base/core/java/android/webkit/LoadListener.java:
void downloadFile() { // remove the cache WebViewWorker.getHandler().obtainMessage( WebViewWorker.MSG_REMOVE_CACHE, this).sendToTarget(); // Inform the client that they should download a file mBrowserFrame.getCallbackProxy().onDownloadStart(url(), mBrowserFrame.getUserAgentString(), mHeaders.getContentDisposition(), mMimeType, mContentLength); // Cancel the download. We need to stop the http load. // The native loader object will get cleared by the call to // cancel() but will also be cleared on the WebCore side // when this function returns. cancel(); }
然後....找不到 call downloadFile 的 code....

function 的 comment 非常好心的說明:
    /*
     * This function is called from native WebCore code to
     * notify this LoadListener that the content it is currently
     * downloading should be saved to a file and not sent to
     * WebCore.
     */
所以去找找 WebCore ..



改 Browser 就好。
download 的動作是 callback..

所以改 Browser 的 BrowserActivity.java:

其中:OnDownloadStartNoStream( ) 是負責將 download 排入 downloadmanager 的 function。
所以comment 掉 call 這個 function 的 code 就可以。

2012年7月10日 星期二

log on click download link

試著去點一個 download link...結果(沒放 SD card)出來:
I/ActivityManager( 2510): Starting: Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=http://dl.dropbox.com/u/8788910/A_Android/Camera360_2.7.0.apk cmp=com.android.browser/.BrowserActivity } from pid 3235
D/        ( 2510): enter Cmd: L 
V/http    ( 3235): 3619554 WebViewWorkerThread RequestQueue.queueRequest http://dl.dropbox.com/u/8788910/A_Android/Camera360_2.7.0.apk
V/http    ( 3235): 3619556 http1 RequestQueue.getRequest() => /u/8788910/A_Android/Camera360_2.7.0.apk
V/http    ( 3235): 3619557 http1 ConnectionThread: new request http://dl.dropbox.com:80 /u/8788910/A_Android/Camera360_2.7.0.apk
V/http    ( 3235): 3619557 http1 SEND pipe 0
I/ActivityManager( 2510): Starting: Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=http://dl.dropbox.com/u/8788910/A_Android/Camera360_2.7.0.apk cmp=com.android.browser/.BrowserActivity } from pid 3235
D/dalvikvm( 2753): GC_CONCURRENT freed 1449K, 73% free 1035K/3779K, external 4039K/5043K, paused 2ms+1ms
V/http    ( 3235): 3620967 http1 Connection.openHttpConnection() 1410 http://dl.dropbox.com:80
V/http    ( 3235): 3620971 http1 Request.sendRequest() http://dl.dropbox.com
V/http    ( 3235): 3620972 http1 Request.requestSent() http://dl.dropbox.com/u/8788910/A_Android/Camera360_2.7.0.apk
V/http    ( 3235): 3620973 http1 READ pipe 1
V/http    ( 3235): 3620974 http1 processRequests() reading /u/8788910/A_Android/Camera360_2.7.0.apk
D/        ( 2753): enter Cmd: G 
V/http    ( 3235): 3623524 http1 read: HTTP/1.1 200 OK
V/http    ( 3235): 3623524 http1 hdr 20 server: nginx/1.0.14
V/http    ( 3235): 3623524 http1 hdr 35 date: Tue, 10 Jul 2012 09:15:18 GMT
V/http    ( 3235): 3623524 http1 hdr 53 content-type: application/vnd.android.package-archive
V/http    ( 3235): 3623524 http1 hdr 17 connection: close
V/http    ( 3235): 3623525 http1 hdr 23 content-length: 3942344
V/http    ( 3235): 3623525 http1 hdr 30 x-robots-tag: noindex,nofollow
V/http    ( 3235): 3623525 http1 hdr 20 accept-ranges: bytes
V/http    ( 3235): 3623525 http1 hdr 11 etag: 5545n
V/http    ( 3235): 3623525 http1 hdr 14 pragma: public
V/http    ( 3235): 3623525 http1 hdr 24 cache-control: max-age=0
V/http    ( 3235): 3623526 http1 Request.readResponseStatus() 15 HTTP/1.1 200 OK
V/http    ( 3235): 3623537 WebViewCoreThread Request.cancel(): /u/8788910/A_Android/Camera360_2.7.0.apk
V/http    ( 3235): 3623538 WebViewCoreThread Connection.cancel(): connection closed http://dl.dropbox.com:80
V/http    ( 3235): 3623560 http1 httpFailure() ******* java.lang.IllegalStateException: Connection is not open count 0 http://dl.dropbox.com:80 /u/8788910/A_Android/Camera360_2.7.0.apk
V/http    ( 3235): 3623560 http1 processRequests(): no persist, closing http://dl.dropbox.com:80
V/http    ( 3235): 3623560 http1 Connection.clearPipe(): clearing pipe 0
V/http    ( 3235): 3623561 http1 SEND pipe 0
V/http    ( 3235): 3623661 http1 RequestQueue.getRequest(http://dl.dropbox.com:80) => null
V/http    ( 3235): 3623661 http1 DRAIN pipe 0
V/http    ( 3235): 3623661 http1 RequestQueue.getRequest() => null
V/http    ( 3235): 3623661 http1 ConnectionThread: Waiting for work
D/webviewglue( 3235): nativeDestroy view: 0x9329e0
I/DownloadManager( 2841): Initiating request for download 3

放入SD card 再試一次:
還是先把 status banner 打開好了,否則看不到是不是有 download...

2012年7月9日 星期一

RCU : read - copy - update

ref: http://nano-chicken.blogspot.tw/2011/02/linux-modules14-read-copy-update.html
這篇的圖說明很清楚。

原來圖示參考lwn : https://lwn.net/lwn/lwn/images/ns/kernel/brcu/

copy 一份:

圖示說明一個 writer 對應多個 reader。
writer 的 timing 分為三個階段,對應很多 reader 的 access period。

圖示說明在每個階段, 各 reader 讀到的是 新的還是舊的資料。

2012年7月6日 星期五

  • tasklet 被 tasklet_schedule( ) 多次,也只會run 一次。除非 tasklet_schedule( ) 時,她已經在執行,這樣就會 run 兩次 (包含正在 run 的這一次)

標籤

網誌存檔