ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上

2013年1月29日 星期二

bootloader , recovery images and ROM

很神奇的是 bootloader 竟然可以決定 nand /eMMC 各 partition 的 access 權限。
所以才會又 S-ON/S-OFF 的選項。

S-ON/S-OFF 的功能好像只有official 的image 在參考,
recovery image 並沒有用到,
還有,燒了非官方的 image,也不會依照 S-ON/S-OFF 的內容。
---- 作辛酸的?


至於系統的燒錄/更新,都是靠 recovery image 來作的。
這原來是用來更新/恢復 系統的工具。

原廠的 recovery 工具功能太簡單,有些還有作image 簽章 檢查。
所以 燒rom 的 hacker,就自己做了 功能強大的 recovery image。

recovey image 的開發和 OS 的開發好像是分開的人/組織。
當然也有 OS 開發 team 同時也提供 recovery image 的。

  • CMw -- 這個好像蠻popular 的,有 apk : ROM Manager 配合。
  • RA-Recovery -- 這個野蠻多人用,好像開發得比較早。
  • CM -- 就是有名的 CyanogenMode ,support 的 device 沒那麼多。 有 source
  • TWRP -- TeamWin,基於 aosp 的 OS 和 recovery,device support 也沒那麼多,有 source


Custom Recovery Image 的安裝,就是把 image file copy 到 recovery partition。
所以要有對 flash/nand/emmc partition read write 的權限。

所以有不同作法:
  • root 後,安裝 terminal progam,放入 flash_image 這個 tool,用 flash_image 把 image 寫到 recovery partition
  • 利用 bootloader 或是原廠 recovery image 的 fastboot cmd,把 image 寫入 recovery partition


果然,S-ON 的情況下,fastboot 不允許 run external boot image
否則就每次用 boot command run recovery image 就好,連 recovery partition 都不用燒了。

所以 只好 用 root 後,從 termianl 執行 flash_image,把 recovery 燒到 partition。


把 RA recovery image 燒到 flash 中的步驟:

用 UniversalRoot 取得 root
就"設法"裝這個 apk 就是 ...
remounte /sytem 為 rw #mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
把 flash_image copy 到 /system/bin 中
#dd if=/sdcard/flash_image of=/system/bin/flash_image
可以執行 flash_image 把 RA-Recovery 燒到 recovery partition 了 #flash_image recovery /sdcard/recovery.img
完成!

關機,按 HOME + Power 重新開機,就會進入 RA-Recovery
  • 網路上另一種方法是用 flashrec.apk ,這program 的 source code 在 google code 中,可以看到,也是用 flash_image 來作,所以對新版 ROM 無效。

.. 應該要加上 flash_image not found 和 remote not allowed 這兩個關鍵字..

OK., 接著可以 build CM7 了..


backup & restore

之後每次開機按 HOME+Power 就可以開進 recovery image。
裡面有 backup/restore 選項。

其中有兩項有點混淆:
  • nand
  • bart

nand 跟 bart 的差別在 bart 把 ext partition 也一起被份了,
ext partition 好像是用 app2SD 時,而外開的一個 partition。
所以沒用的人不需要用 bart

ref: http://guide.hiapk.com/news/10162012/021642164.shtml

沒有留言:

標籤

網誌存檔