Building CyanogenMod 6 for HTC Magic

經過這將近一天的不斷試誤,終於至少成功跑完 building 流程,先記錄一下:

參考文獻:

截自目前為止,編譯 AOSP 還是去找一台 x86 Linux 比較乾脆。我在 x86_64 Linux 上折騰好久,最後還是找家裡的 x86 桌機來用。

流程:

  1. mkdir ~/aosp && cd ~/aosp/
  2. repo init -u git://github.com/CyanogenMod/android.git -b froyo
  3. repo sync (取得原始碼)
  4. source build/envsetup.sh
  5. lunch cyanogen_dream_sapphire-eng (指定要 build 給 Sapphire 用,也就是 32B 版 Magic)
  6. export CCOMPILER=~/aosp/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
  7. export USE_CCACHE=1
  8. cd device/htc/dream_sapphire/
  9. mkdir -p ../../../vendor/htc/dream_sapphire/proprietary
  10. ./extract-files.sh (需將手機以 debugging 模式接上電腦,並且會呼叫 SDK 的 adb 抓取手機裡頭一些 proprietaries 檔案)
  11. cd ~/aosp/vendor/cyanogen/
  12. ./get-rommanager (若不想安裝 ROM Manager,可能需要修改相關的 Makefiles,否則此步不做的話 building 流程會失敗)
  13. cd ~/aosp
  14. make clobber ; make clean (若先前有跑過失敗的 building 流程,需先跑一次)
  15. make -j2 otapackage
  16. ./vendor/cyanogen/tools/squisher

生出來的 *.zip 與 *.img 檔會在:

  1. out/target/product/dream_sapphire/
  2. out/target/product/dream_sapphire/obj/PACKAGING/target_files_intermediates/

CC BY-SA 4.0 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Leave a Reply

Your email address will not be published. Required fields are marked *