Androidリカバリ工場出荷設定およびシステムアップグレードプロセス

5434 ワード

=============================================

. , :
1. /cache/recovery/command :
2.

. recovery
recovery
1. /cache /cache/recovery/command
2. (G1 HOME )
blob

. , recovery , :
1. blob recovery
2. flash cache recovery
3. recovery.img recovery


recovery.img :
1. recovery.img
recovery , recovery , , :
<> recovery , :
http://www.hiapk.com/bbs/thread-6391-1-1.html

2. recovery.img
: ./vendor/marvell/littleton/BoardConfig.mk :
TARGET_NO_KERNEL := true
cupcake , recovery.img,
recovery.img TARGET_NO_KERNEL := true

: vendor/marvell/littleton/recovery/res
:vendor/marvell/littleton
cp /tftpboot/zImage20100202 vendor/marvell/littleton/kernel

res :
No private recovery resources for TARGET_DEVICE littleton
make: *** “out/target/product/littleton/kernel” “vendor/marvell/littleton/kernel”

: make recoveryimage recovery.img
out/host/linux-x86/bin/mkbootimg --kernel out/target/product/littleton/kernel //
--ramdisk out/target/product/littleton/ramdisk-recovery.img //
--output out/target/product/littleton/recovery.img


, :
2009 12 23 falsh
0x00000000-0x00100000 : /"Bootloader/" --1M
0x00100000-0x00500000 : /"Kernel/" --4M 0x400000
0x00500000-0x06500000 : /"system/" --96M 0x6000000
0x06500000-0x09500000 : /"userdata/" --48M 0x3000000
0x09500000-0x0f500000 : /"systembackup/" --96M
0x0f500000-0x0fd00000 : /"massstorage/" --8M
0x0fd00000-0x0ff00000 : /"massstorage2/" --2M
0x0ff00000-0x10000000 : /"massstorage3/" --1M

cache recovery , :
arch/arm/mach-pxa/include/mach/part_table.h

0x09500000-0x0f500000 : /"systembackup/" --96M
0x0f500000-0x0fd00000 : /"massstorage/" --8M

0x09500000-0x0f500000 : /"cache/" --96M
0x0f500000-0x0fd00000 : /"recovery/" --8M
android cache recovery 。

recovery.img recovery ;
, :
http://192.168.2.148/smartphone/td0901/release/images/readme.txt
=====================================
cache
nanderase -z 0x09500000 0x6000000
tftp recovery.img
nandwrite -y 0x80800000 0x09500000

recovery
nanderase -z 0xf500000 0x800000
tftp recovery.img
nandwrite -y 0x80800000 0xf500000
======================================


, , recovery :
recovery init.rc ,
service recovery /sbin/recovery
service adbd /sbin/adbd recovery
recovery , :
bootable/recovery/recovery.c
int main(int argc, char **argv)
...
ui_init(); // ui
get_args(&argc, &argv);
...

void ui_init(void)
{
gr_init();
ev_init();
...
pthread_create(&t, NULL, progress_thread, NULL);
pthread_create(&t, NULL, input_thread, NULL);
}

recovery , ui_init(),ev_init() ,
ui 。input_thread 。

get_args /cache/recovery/command , ,
/cache/recovery/command --wipe-data
data cache :
erase_root(/"DATA:/")
erase_root(/"CACHE:/")
, , , system ,


home , , :
static void prompt_and_wait()
{
char** headers = prepend_title(MENU_HEADERS);

for (;;) {
finish_recovery(NULL);
ui_reset_progress();

int chosen_item = get_menu_selection(headers, MENU_ITEMS, 0);

// device-specific code may take some action here. It may
// return one of the core actions handled in the switch
// statement below.
chosen_item = device_perform_action(chosen_item);

switch (chosen_item) {
case ITEM_REBOOT:
//
return;

case ITEM_WIPE_DATA:
//
break;

case ITEM_WIPE_CACHE:
// cache
break;

case ITEM_APPLY_SDCARD:
// update.zip sdcard
break;
}
}
}
======================================