How to split boot.img and get kernel config

boot_cm9.img file from mk802_legacy-compatibility_v1.zip Device: Rikomagic MK802 Script files : Split_bootimg.pl , extract-ikconfig ( in {kernel_source}/script ) Split boot.img Copy boot_cm9.img, Split_bootimg.pl, extract-ikconfig into ‘split_boot’ $ mkdir split_boot $ cd split_boot $ ./split_bootimg.pl boot_cm9.img Page size: 2048 (0x00000800) Kernel size: 8094708 (0x007b83f4) Ramdisk size: 178940 (0x0002bafc) Second size: 0 (0x00000000) Board name: Command line: console=ttyS0,115200 rw init=/init loglevel=8 Writing boot_cm9.img-kernel ... complete. Writing boot_cm9.img-ramdisk.gz ... complete. Get kernel image (boot_cm9.img-kernel) and ramdisk (boot_cm9.img-ramdisk.gz) Extract kernel config $ dd if=boot_cm9.img-kernel of=dd_uImage bs=1024 skip=1 7903+1 records in 7903+1 records out 8093684 bytes (8.1 MB) copied, 0.0178518 s, 453 MB/s $./extract-ikconfig dd_uImage > kernel_config Extract ramdisk $ mkdir ramdisk $ cd ramdisk $ gzip -dc ../boot_cm9.img-ramdisk.gz | cpio -i 6677 blocks $ tree . . ├── data ├── default.prop ├── dev ├── init ├── init.goldfish.rc ├── initlogo.rle ├── init.rc ├── init.sun4i.rc ├── init.sun4i.usb.rc ├── proc ├── sbin │ ├── adbd │ └── ueventd -> ../init ├── sys ├── system ├── ueventd.goldfish.rc ├── ueventd.rc └── ueventd.sun4i.rc Reference: HOWTO: Unpack, Edit, and Re-Pack Boot Images ...

September 12, 2012 · 1 min · oopsmonk

How to extract kernel config from uImage

Get extract-ikconfig in kernel-source/scripts/ $mkdir extreact-uImage $cd extreact-uImage $cp {kernel-source}/scripts/extract-ikconfig . Dump uImage skip 1024 bytes $cp {uImage/what/you/want} uImage $dd if=uImage of=dd_uImage bs=1024 skip=1 $./extract-ikconfig dd_uImage > config

August 21, 2012 · 1 min · oopsmonk

Build XBMC for Android on lubuntu 12.04

Install required packages # sudo apt-get install build-essential default-jdk git curl autoconf \ unzip zip zlib1g-dev gawk gperf Getting the Android SDK and NDK http://developer.android.com/sdk/index.html SDK : android-sdk_r20.0.1-linux.tgz crystax-5 NDK with enabled support of C++ exceptions, RTTI and Standard C++ Library http://www.crystax.net/en/android/ndk/7#download NDK : android-ndk-r7-crystax-5.beta2-linux-x86.tar.bz2 Installing Android SDK packages <android-sdk> : $HOME/XBMC_Project/android-sdk-linux # cd <android-sdk>/tools # ./android update sdk -u -t platform,platform-tool Setup the Android toolchain <android-ndk> : $HOME/XBMC_Project/android-ndk-r8b <android-toolchain> : $HOME/XBMC_Project/android_toolchain/android-9 # cd <android-ndk> # ls platforms # cd build/tools # ./make-standalone-toolchain.sh --ndk-dir=../../ \ --install-dir=<android-toolchain>/android-9 --platform=android-9 Create a (new) debug key to sign debug APKs All packages must be signed. The following command will generate a self-signed debug key. If the result is a cryptic error, it probably just means a debug key already existed, no cause for alarm. ...

July 28, 2012 · 2 min · oopsmonk

Android Threads, Handlers and AsyncTask

先看過Processes and Threads會有比較清楚的概念, 當Adnroid Application 啟動後, 系統會建一個主要的thread 稱 “main thread” or “UI thread”, 所有的components 皆跑在這個UI thread, system calls 也是透過UI thread dispatched給各個component, ex: onKeyDown, touch event. UI thread 如因大量運算或等待而blocked, 預設超過5秒ANR(Application Not Responding)就會發生. 且Android UI components 並非thread-safe, 使用上要特別小心. 所以: long time computation使用另外的thread, 不要寫在 UI Thread. 不要在UI thread 之外使用UI component method. 透過Thread, Handler and AsyncTask perform asynchronous processing, 避免UI thread block. Threads Android 提供以下的method, 可在其它的thread 下調用 UI thread. Activity.runOnUiThread(Runnable) View.post(Runnable) <-- used in example code. View.postDelayed(Runnable, long) 或是使用Handler or AsyncTasks class 達到同樣的效果. ...

June 14, 2012 · 1 min · oopsmonk