天天看點

[RK3288][Android6.0] 調試筆記 --- Recovery執行腳本方法

Platform: Rockchip

OS: Android 6.0

Kernel: 3.10.92

  1. sh在system/bin/下,需要挂載/system
  2. 腳本可以在device/rockchip/rk3288下完成拷貝
  3. 這裡因為要copy apk到data/app下,是以也挂載了/data
kris@eco:~/rk3288/bootable/recovery$ g df e2cc9927ec7f858c2e396808e75253b3808a0578 bb9ef59332a7e9c48a0db320f94a995e2e6ccfa0
diff --git a/recovery.cpp b/recovery.cpp
index a0edc15..2fb6259 100755
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -1107,6 +1107,15 @@ static bool wipe_data(int should_confirm, Device* device) {
         erase_volume("/cache") &&
         device->PostWipeData();
     ui->Print("Data wipe %s.\n", success ? "complete" : "failed");
+
+    /*Kris, do sth before reboot.  { */
+    ensure_path_mounted("/system");
+    ensure_path_mounted("/data");
+    system("/system/bin/restore.sh");
+    ensure_path_unmounted("/data");
+    ensure_path_unmounted("/system");
+    /*Kris, do sth before reboot.  } */
+
     return success;
 }