How To Use Android Recovery

How to enter recovery mode

1) after the board is powered on, long press the power button until the recovery mode is entered
2) after entering the main system, input reboot recovery through the serial port, or use the ADB reboot recovery command

Recovery ota upgrate

After entering recovery, copy the kvim3-ota-eng.root.zip upgrade package generated by the source code to disk u,
and select apply update from ext to upgrade, the upgrade does not erase the data partition.

Modify recovery text size

Android recovery has two kinds of fonts by default, one is 12x22, and the other is 18x32. The corresponding font size is obtained from the PNG image under recovery,
and the corresponding font size is asfollows

1
2
3
4
5
6
7
root@lxx-NUC10i7FNH:/home/lxx/Downloads/android_khadas/bootable/recovery/fonts# ls -l
total 188
-rw-r--r-- 1 root root 145804 May 22 13:48 12x22.png
-rw-r--r-- 1 lxx lxx 24437 Apr 20 15:29 18x32.png
-rw-r--r-- 1 lxx lxx 4407 Apr 20 15:29 OFL.txt
-rw-r--r-- 1 lxx lxx 216 Apr 20 15:29 README

variable recovery_font in build/make/core/Makefile specifies the font size to use

1
2
3
4
5
6
ifneq (,$(filter xxxhdpi 560dpi xxhdpi 400dpi xhdpi,$(recovery_density)))
recovery_font := $(call include-path-for, recovery)/fonts/18x32.png
else
recovery_font := $(call include-path-for, recovery)/fonts/12x22.png
endif

if you need to customize the text size of recovery, you can add a picture similar to 12x22. PNG. You only need to modify the length and width pixel size of the PNG picture through PS software,
and then add it to the source directory bootable / recovery / fonts to recompile the upgrade package. You can see the effect of the upgrade

note: The corresponding font size of 12x22.png is 12 pixels in length and 22 pixels in height. The actual pixel size of 12x22.png is 1152x44, 12 = 1152 / 96, 22 = 44 / 2

How to use common commands under recovery

After entering recovery, some common commands such as CP, LS and VI can’t be used directly, They can only be used through busybox, such as

1
2
3
4
# vi /etc/recovery.kl                                                          
/sbin/sh: vi: not found
#
# busybox vi /etc/recovery.kl