android5.1 notes: recovery upgrade process

1. The process of recovery full package upgrade:

  • Compile:
build/envsetup.sh。 
lunch 选择16。
make otapackage
  • Rename the blaze_tablet-ota-eng.xx.xx.zip upgrade package to update.zip and download it to the /cache directory
  • Enter recovery mode
adb root
adb shell
echo "--locale en_US\n--show_text" > /cache/recovery/command
reboot recovery

The system restarts, enters the recovery mode, and starts the recovery process. After entering the process, select the "apply update from /cache" option, and the system will automatically update update.zip

  • Error printing:
Finding update package
Opening update package...
Verifying update package...
Installing update...
assert failed: !less_than_int(1312352025,getprop("ro.build.date.utc"))
E:Error in /sdcard/update.zip(status7)

Explain that the upgrade package is older and the execution is terminated

  • Solution:
    modify build/core/Makefile
$(INTERNAL_OTA_PACKAGE_TARGET):$(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS) 
@echo "Package OTA: $@" 
$(hide) ./build/tools/releasetools/ota_from_target_files -v \ 
-p $(HOST_OUT) \ 
-k $(KEY_CERT_PAIR) \ 
-n \ 

-n Whether to not check the timestamp during the upgrade, it is checked by default, that is, it can only be upgraded based on the old version by default

2. The process of recovery incremental package upgrade:

  • Execute the following commands in the source root directory
 build/envsetup.sh
 lunch 选择16
 make
 make otapackage

After executing the above command, our first system upgrade package will be generated under out/target/product/blaze_tablet.
First name it A.zip

  • Modify the parts we need to change in the source code, such as modifying the kernel configuration, adding new drivers, and so on. Execute the above command again after modification. The update.zip upgrade package generated after the second modification will be generated. Name it B.zip.

  • Take the above A.zip and B.zip packages as input, and update.zip package as output. The generated update.zip is the last incremental package needed.
    The specific usage is: copy the above two packages to the source root directory, and then execute the following command.

./build/tools/releasetools/ota_from_target_files -i A.zip B.zip update.zip

The error:

When executing the above command, there will be an error that recovery_api_version is not found. The reason is that if option
i is used when executing the above script, WriteIncrementalOTAPackage will be called to search for misc_info.txt from the META directory in package A and package B to read
the value of recovery_api_version. But the update.zip package generated when the make otapackage command is executed does not have this directory
nor this document.

  • Solution:
    At this time, you need to use the original zip package generated by executing make otapackage. The location of this package is in the out/target/product/blaze_tablet/obj/PACKAGING/target_files_intermediates/ directory. It is an intermediate product after using the command make otapackage and is the most original upgrade package. Rename the generated packages of the two compilations to A.zip and B.zip respectively, and copy them to the root directory and repeat the above commands:
./build/tools/releasetools/ota_form_target_files -i A.zip B.zip update.zip

When the above command is about to be executed, the update.zip upgrade package is generated.

  • Download the update package update.zip generated above to the /cache directory
 adb root
 adb shell
 echo "--locale en_US\n--show_text" > /cache/recovery/command
 reboot recovery
  • System restart:
    Enter the recovery mode and start the recovery process. After entering the process, select the "apply update from /cache" option, and the system will automatically update update.zip
 echo "--locale en_US\n--show_text\n--send_intent" > /cache/recovery/command

Guess you like

Origin blog.csdn.net/weixin_44991625/article/details/105730706