Skip to main content

Rockchip Linux Upgrade Solution Introduction

:::info 文档信息

文档标识:RK-KF-YF-348 · 发布日期:2021-02-18 · 页数:22 · 语言:英文

原始文档:Rockchip_Developer_Guide_Linux_Upgrade_EN.pdf

:::

章节大纲​

  • Rockchip Linux Upgrade Solution Introduction(P1)
    • Overview and Codes(P4)
      • Overview(P4)
      • Codes(P4)
    • Recovery Mode(P4)
      • Overview(P4)
      • Configure and Compile(P6)
      • OTA Upgrade(P7)
      • Log Checking(P7)
    • Linux A/B Mode(P8)
      • Overview(P8)
      • Boot Process(P9)
        • Data Format and Storage(P9)
        • Two boot modes(P10)
        • Boot Process Flow Chart(P11)
      • Compilation Configuration(P11)
        • uboot(P11)
        • Buildroot(P12)
        • Partition Table(P12)
        • Firmware output(P12)
      • OTA Upgrade(P15)
      • Partition Boot Settings(P15)
        • Bootable Settings(P15)
        • Upgrade Partition Settings(P16)
    • Create a SD card Upgrade Disk(P16)
      • Instructions for making SD card boot disk in Recovery system mode(P17)
      • Instructions for making SD card boot disk in AB system mode(P17)
    • Restore the Factory Settings(P18)
    • Details of the Upgrade Program(P18)
      • Parameters(P18)
      • Upgrade Customize Partition(P20)
    • Appendix(P21)
      • Firmware Package Tools(P21)
        • Windows Package Tool(P21)
        • Linux Package Tool(P21)
      • Misc Partition(P21)

在线预览​

若预览无法显示,请直接下载 PDF 后用本地阅读器打开。


1. Overview and Codes​

1.1 Overview​

Rockchip Linux platform supports two boot-up modes: recovery mode and Linux A/B mode:

  1. Recovery mode: there is a separate partition (recovery.img) on the device for upgrade. 2. Linux A/B mode: there are two firmware on the device that can be switched.

Users can choose one according to their requirements for both the modes with their advantages and disadvantages.

1.2 Codes​

Rockchip Linux platform supports two upgrade modes.

Upgrade Modepath of codesRecovery modeLinux A/B modeDescription
updateEngineexternal/recovery/update engine _ external/recoverySupportSupportDefault use in RV1126/RV1109
rkupdateexternal/rkupdateSupportNonsupportOther platroms, This document does not introduce

2. Recovery Mode​

2.1 Overview​

There will be a recovery partition on the device, which is consists of kernel+resource+ramdisk and mainly used for upgrade operations on the machine in recovery mode. U-boot will determine whether the system to be booted is a normal system or a recovery system based on the fields stored in the misc partition (see the misc partition section for details). Due to system independence, the recovery mode can guarantee the integrity of upgrade even when upgrade process is interrupted. If the power is abnormally powered down, the upgrade can still continue.

Advantages:

  1. It can guarantee the integrity of upgrade.

Disadvantages:

  1. There is one more partition which is only used for upgrade in the system. 2. Reboot the system into recovery mode during upgrade process and should not upgrade directly in the normal system.

Partition Instruction:

Partition nameImage nameDescription
loaderMiniLoaderAll.binFirst level loader
u-bootuboot.imgSecond level loader
trusttrust.imgSecure environment, like OP-TEE, ATF(Some platforms will merge trust and uboot)
miscmisc.imgBoot parameter partition
recoveryrecovery.imgRoot file system consisting of kernel+dtb+ramdisk
bootboot.imgkernel+dtb
rootfsrootfs.imgRoot file system, read only
oemoem.imgused for manufacturer, read and write
userdatauserdata.imgused for users, read and write

2.2 Configure and Compile​

Buildroot: the recovery configuration files are selected as follows: (make menuconfig):

BR2_PACKAGE_RECOVERY=y #turn on upgrade related functions
BR2_PACKAGE_RECOVERY_USE_UPDATEENGINE=y #use the new upgrade program, if not
configured, the original upgrade process will be used by default.
BR2_PACKAGE_RECOVERY_RECOVERYBIN=y #turn on recovery bin file
BR2_PACKAGE_RECOVERY_UPDATEENGINEBIN=y #compile the new upgrade program
BR2_PACKAGE_RECOVERY_NO_UI=y # disable UI

Buildroot: the rootfs configuration files are selected as follows (make menuconfig):

BR2_PACKAGE_RECOVERY=y #turn on upgrade related functions
BR2_PACKAGE_RECOVERY_USE_UPDATEENGINE=y #use the new upgrade program
BR2_PACKAGE_RECOVERY_UPDATEENGINEBIN=y #compile the new upgrade program
BR2_PACKAGE_RECOVERY_NO_UI=y # disable UI

With and Without Display

Currently only RK3308 uses the recovery without display, if the recovery of other chipset do not need display, just configure the following item in the file "buildroot/package/rockchip/recovery/recovery":

TARGET_MAKE_ENV += RecoveryNoUi=true

The SDK will enable the above configuration by default, so users do not need to configure it again. The source code is in "external/recovery/" directory, if you need to do some modifications, compile as follows:

# Step1: run the following command:
source envsetup.sh
# Step2: choose the rootfs configuration of a platform,and then run the following
command:
make recovery-dirclean
source envsetup.sh
# Step3: choose the recovery configuration of a platform, and then run the
following command:
make recovery-dirclean
./build.sh
# Step4: flashing the firmware again.

If the SDK version is relatively new, you can try to compile as follows:

./build.sh external/recovery
./build.sh
# flashing the firmware again.

2.3 OTA Upgrade​

The upgrade supports network upgrade and local upgrade, and you can specify the partition to be upgraded. Run the following command on the normal system.

Network upgrade:

# updateEngine --misc=update --image_url=firmware address --partition=0x3FFC00 --
version_url=version file address --savepath=/userdata/update.img --reboot
updateEngine --image_url=http://172.16.21.110:8080/recovery/update.img \
--misc=update --savepath=/userdata/update.img --reboot &

Local upgrade:

updateEngine --image_url=/userdata/update.img --misc=update \
--savepath=/userdata/update.img --reboot &

Process introduction:

  1. Firmware versions comparison(--version_url) 2. Download the firmware(--image_url) and save it locally(--savepath) 3. Upgrade recovery partition 4. Reboot(--reboot) 5. Enter the recovery mode, upgrade the partition(--partition) 6. Successfully upgrade and reboot into the normal system.

Optional parameters:

  1. --version_url: remote address or local address. If this parameter is not set, versions comparison will not do . 2. --savepath: firmware saves path, it is "/tmp/update.img" by default. It is recommended to set to "/userdata/update.img". 3. --partition: set the partition to be upgraded. It is recommended to set it to 0x3FFC00. It is not supported to upgrade the parameter and loader partitions. See the Chapter of Parameters Introduction for details. 4. --reboot: after upgrading the recovery partition, reboot into the recovery mode.

2.4 Log Checking​

  1. Check log by serial port

In the "buildroot/output/rockchip_***/target" directory:

touch .rkdebug

Create this hidden file to print the upgraded log in recovery mode by serial port.

  1. Checking through the "userdata/recovery/Log" file:

After upgrading, check the log file under "userdata/recovery" directory in the device.

cat userdata/recovery/Log

3. Linux A/B Mode​

3.1 Overview​

You have to prepare two separate system firmwares which are respectively stored in the flash in Linux A/B mode . The system can be booted from one of the slots. If the current slot fails to boot, it can be started from another slot, and the system can be directly upgraded in the normal state, without entering the system upgrade mode, and just restart the system to enter the upgraded system.

The following advantages are included in Linux A/B mode due to its two boot slots:

  1. The machine can be upgraded directly on the current system without rebooting into upgrade mode. 2. Prevent the machine from crashing for failure upgrade. If the upgrade fails, the machine can return to the current version. 3. If the current system is destroyed due to misoperation, the system will automatically switch to another slot.

Disadvantages:

  1. There are two slots in Linux A/B mode, so it will increase the system firmware usage on the flash.

Partition:

Since there are already multiple backups of miniloader, trust, and uboot on the device, these partitions do not support the dual partitions at present, only the boot and system are dual-partitioned. The partition table is as follows:

PartitionImageDescription
loaderMiniloader.binFirst level loader, there are 4 backups in the device
uboot a _uboot.imgSecond level loader, there are 2 backups in the device,the backups number can be changed by modifying the "u-boot/make.sh"
uboot b _uboot.imgbackup of uboot a _
trusttrust.imgRelated to secure, there are 2 backups in the device,the backups number can be changed by modifying the "u-boot/make.sh" (Some platforms will merge trust and uboot)
miscmisc.imgBoot parameter partition
boot a _boot.imgkernel+dtb, boot system a _
boot b _boot.imgkernel+dtb, boot system b _
system a _rootfs.imgRoot file system
system b _rootfs.imgRoot file system
oemoem.imgManufacturer prefabricated, read and write, No backup
userdatauserdata.imgFor data, readable and writable, No backup

3.2 Boot Process​

3.2.1 Data Format and Storage​

The storage position is 2K offset from the misc partition, and AvbABSlotData and AvbABData data structures are as follows

AvbABSlotData: store slot_a and slot_b

Date nameUsage
unsigned char priorityPartition priority, 0~15, 0 is not automatic, 15 is the highest priority
unsigned char tries remaining _The number of attempts to start, the highest is 7, can be modified
unsigned char successful boot _0: unbootable,1: bootable
unsigned char is update:1 _0: upgrade failed, 1: upgrade successfully , and the last 7 bits are reserved data.

AvbABData: slot_a and slot_b boot information

Date nameUsage
unsigned char magic[AVB AB MAGIC LEN] _ _ _structure header information: \0AB0
unsigned char version major _version information
unsigned char version minor _version information
unsigned char reserved1[2]reserved data
AvbABSlotData slots[2]Partition boot information
unsigned char last boot _The partition that was successfully boot last time: 0->slot a, _ 1->slot b _
unsigned char reserved2[11]reserved data
unsigned char crc32Crc data verification

3.2.2 Two boot modes​

According to the configuration method of the upper bootcontrol program, there are two boot modes: successful_boot and reset retry. The difference of the two modes is as follows:

ModeAdvantageDisadvantageparameters need to set when successfully boot(A boot)parameters need to set when upgrade(A boot, B upgrade)
Successful bootAs long as the system is booted normally, it will not go back to the old version of firmware.After the device is working for a long time, if some memory are stored abnormally, the system will always restart.tries remaining=0 _ successful boot=1 _ last boot=0 _A:priority=14 B:priority=15
Reset retryAlways maintain the retry mechanism can fix storage issues1. The machine will go back to the old version which may not be controlled. 2.If the retry try many times for users misoperation, it will be misidentified that the current partition is bootable.tries remaining=7 _ last boot=0 _A:priority=14 B:priority=15

3.2.3 Boot Process Flow Chart​

3.3 Compilation Configuration​

3.3.1 uboot​

Add the following configurations to defconfig, take rk3308 64bit for example: "u-boot/configs/rk3308_defconfig":

CONFIG_AVB_LIBAVB=y
CONFIG_AVB_LIBAVB_AB=y
CONFIG_AVB_LIBAVB_ATX=y
CONFIG_AVB_LIBAVB_USER=y
CONFIG_RK_AVB_LIBAVB_USER=y
CONFIG_ANDROID_AB=y

3.3.2 Buildroot​

BR2_PACKAGE_RECOVERY=y #enable recovery function
BR2_PACKAGE_RECOVERY_BOOTCONTROL=y #enable the boot control script
BR2_PACKAGE_RECOVERY_RETRY=y
#The boot mode is retry mode. it is successful_boot mode by default when not
configured.
BR2_PACKAGE_RECOVERY_USE_UPDATEENGINE=y #Use the new upgrade program
BR2_PACKAGE_RECOVERY_UPDATEENGINEBIN=y
BR2_PACKAGE_RECOVERY_NO_UI=y # disable UI
#compile the new upgrade program

Note: after finishing the configuration, you must recompile as follows:

make recovery-dirclean
make recovery
./build.sh

If the SDK version is relatively new, you can try to compile as follows:

./build.sh external/recovery
./build.sh
# flashing the firmware again.

3.3.3 Partition Table​

Set parameter partition table of corresponding BoardConfig.mk as follows:

#choose device/rockchip/rk3308/parameter-ab-64bit.txt file
# parameter for GPT table
export RK_PARAMETER=parameter-ab-64bit.txt

64bit: please refer to /device/rockchip/rk3308/parameter-ab-64bit.txt

32bit: please refer to /device/rockchip/rk3308/parameter-ab-32bit.txt

3.3.4 Firmware output​

Select the corresponding board configuration (such as BoardConfig***-ab. mk). If you want to use SD card boot disk to upgrade AB system mode, the method is as follows:

# enable build update_sdcard.img
export RK_UPDATE_SDCARD_ENABLE_FOR_AB=true

Run the following command after finishing the above setting :

./build.sh

The following firmwares will be generated:

tree rockdev/
rockdev/
├── boot.img
├── MiniLoaderAll.bin
├── misc.img
├── oem.img
├── parameter.txt
├── rootfs.img
├── uboot.img
├── update_ab.img
├── update_sdcard.img
├── update_ota.img
└── userdata.img

Firmware Upgrade

In the rockdev and IMAGE directories, there will be update_ota.img for OTA upgrades. The IMAGE package includes boot.img and rootfs.img. The tools/linux/Linux_Pack_Firmware/rockdev/rv1126_rv1109- package-file-2-ota file can be modified according to actual cause. As shown below:

# NAME Relative path
#
#HWDEF HWDEF
package-file package-file
bootloader Image/MiniLoaderAll.bin
parameter Image/parameter.txt
uboot_a Image/uboot.img
boot_a Image/boot.img
system_a Image/rootfs.img
oem Image/oem.img

Firmware flashing

The update_ab.img is generated in both rockdev and IMAGE directories, which is used for flashing. Modify the

file tools/linux/Linux_Pack_Firmware/rockdev/rv1126_rv1109-package-file-2-ab file as needed.

As shown below:

# NAME Relative path
#
#HWDEF HWDEF
package-file package-file
bootloader Image/MiniLoaderAll.bin
parameter Image/parameter.txt
misc Image/misc.img
uboot_a Image/uboot.img
uboot_b Image/uboot.img
boot_a Image/boot.img
boot_b Image/boot.img
system_a Image/rootfs.img
system_b Image/rootfs.img
oem Image/oem.img

3.4 OTA Upgrade​

Upgrade online:

# updateEngine --update --image_url=firmware address --partition=0x3FFC00 --
version_url=version file address --savepath=save the firmware address --reboot
updateEngine --image_url=http://172.16.21.110:8080/linuxab/update_ota.img --
update --reboot

Upgrade locally:

# updateEngine --update --image_url=firmware address(update_ab.img or
update_ota.img) --partition=0x3FFC00 --version_url=version file address --
savepath=save the firmware address --reboot
updateEngine --image_url=/userdata/update_ota.img --update --reboot

Process introduction:

  1. Firmware versions comparison 2. Download the firmware (--image_url) and save it locally (--savepath) 3. Upgrade the specified partition(--partition) 4. Set the upgrade partition to the partition to be upgraded 5. Restart 6. Try to boot the upgraded partition

Optional parameters:

  1. --partition: set the partition to be upgraded. In Linux A/B mode, it is recommended to upgrade only uboot_a/uboot_b boot_a/boot_b and system_a/system_b, that is setting it to 0xFC00. It is not supported to upgrade the parameter and loader partitions. See parameter instruction for details. 2. --version: if this parameter is not set, there will be no versions comparison. 3. --savepath: firmware save path. It is "/tmp/update.img" by default. and it is recommended to use the default value. 4. --reboot: reboot after upgrade

3.5 Partition Boot Settings​

3.5.1 Bootable Settings​

Set the current partition to be bootable by the misc and then execute after the system successfully boots, mark the system to start successfully. Please refer to the following script.

$external/recovery/update_engine$ cat S99_bootcontrol
case "$1" in
start)
/usr/bin/updateEngine --misc=now
;;
stop)
printf "stop finished\n"
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0

3.5.2 Upgrade Partition Settings​

updateEngine --misc=other --reboot

Process introduction:

  1. Write a command to the position 4K offset from the misc in order to boot another partition 2. Restart

Optional parameter:

  1. --reboot, the machine will not restart immediately and will not take effect until the next reboot by default.

Note: the updateEngine program is automatically set after OTA upgrade is completed, no need to repeat the settings.

4. Create a SD card Upgrade Disk​

Creating an upgrade disk refers to inserting the SD card created by the SDDiskTool card-making tool to the machine to upgrade, this section will introduce how to create a upgrade disk and some upgrade issues in details.

Create an Upgrade Disk

As shown in the figure below, use the tool in the project directory "tools\windows\SDDiskTool" to create a upgrade disk. Choose the packaged update.img file by the "Firmware" button.

After that, click the "Create" button. If the creation is successful, a prompt will appear.

At this point, there will be two files in the root directory of the SD card, and the upgraded firmware update.img will be named sdupdate.img.

After all the preparations are completed, insert the SD card into the device and power on.

4.1 Instructions for making SD card boot disk in Recovery system​

mode​

To make SD card boot disk in Recovery system mode, just use SDDiskTool to make update.img directly into sdupdate.img.

4.2 Instructions for making SD card boot disk in AB system mode​

When the SDK compiles the AB system mode, the ./build.sh updateimg command will package 3 update.img, as follows:

update_ab.img: Contains a complete AB system partition, which can be used for complete burning update_ota.img: Only include A slot partition system or B slot partition system update_sdcard.img: Can only be used to make a SD card boot disk in AB system mode

When making an SD card boot disk in AB system mode, use SDDiskTool to load update_sdcard.img. After making the SD card boot disk, copy update_ab.img or update_ota.img to the SD card boot disk.

rksdfw.tag
sd_boot_config.config
sdupdate.img
update_ab.img # first priority
update_ota.img # second priority

5. Restore the Factory Settings​

The configuration files that can be read and written were stored in the userdata partition. The factory firmware will set some configuration parameters by default. After using a period of time, the configuration file will be generated or modified. Sometimes users need to clear the data, at this time, they need to restore the factory configuration.

SDK implementation:

Function keys "RECOVERY + VOLUMEUP" are used to trigger to restore the factory configuration, please refer to the code in these directory:

buildroot/board/rockchip/rk3308/fs-overlay/etc/input-event-daemon.conf

board/rockchip/rk3308/fs-overlay/usr/sbin/factory_reset_cfg

updateEngine --misc=wipe_userdata --reboot

Process introduction:

  1. Write format command to the position that 4k offset from the misc partition 2. Reboot(--reboot) 3. The S21mountall.sh is used to dentify formatting commands in the misc 4. format the userdata

Optional parameter:

  1. --reboot: if this parameter was not set, the factory settings will be restored after the next reboot of the machine.

6. Details of the Upgrade Program​

6.1 Parameters​

The updateEngine mainly includes upgrading partition and writing the Misc configuration function, command parameters are as follows:

*** update_engine: Version V1.1.0 ***.
--misc=now Linux A/B mode: Setting the current partition to bootable.
--misc=other Linux A/B mode: Setting another partition to bootable.
--misc=update Recovery mode: Setting the partition to be upgraded.
--misc=wipe_userdata Format data partition.
--update Upgrade mode.
--partition=0x3FFC00 Set the partition to be upgraded.(NOTICE: OTA not support
upgrade loader and parameter)
0x3FFC00: 0011 1111 1111 1100 0000 0000.
uboot trust boot recovery rootfs oem
uboot_a uboot_b boot_a boot_b system_a system_b.
000000000000000000000000: reserved
100000000000000000000000: Upgrade loader
010000000000000000000000: Upgrade parameter
001000000000000000000000: Upgrade uboot
000100000000000000000000: Upgrade trust
000010000000000000000000: Upgrade boot
000001000000000000000000: Upgrade recovery
000000100000000000000000: Upgrade rootfs
000000010000000000000000: Upgrade oem
000000001000000000000000: Upgrade uboot_a
000000000100000000000000: Upgrade uboot_b
000000000010000000000000: Upgrade boot_a
000000000001000000000000: Upgrade boot_b
000000000000100000000000: Upgrade system_a
000000000000010000000000: Upgrade system_b
000000000000001000000000: Upgrade misc
000000000000000100000000: Upgrade userdata
--reboot Restart the machine at the end of the program.
--version_url=url The path to the file of version.
--image_url=url Path to upgrade firmware.
--savepath=url save the update.img to url.

--misc

now: used to set the current partition as a bootable partition in Linux A/B mode

Note: The "external/recovery/update_engine/S99bootcontrol" script will run this command in the end of booting, setting the current partition as a bootable partition, which needs to be enabled.

BR2_PACKAGE_RECOVERY_BOOTCONTROL=y

other: used to set another partition as the upgraded partition, and try to boot from another partition after reboot in Linux A/B mode.

Note: if the updateEngine is used to upgrade, it will be set automatically after the upgrade is completed, no need to repeat the settings.

update: used to upgrade the recovery partition in the normal system, and upgrade the remaining partitions in the recovery system in Recovery mode.

display: used to debug, display the data structure of the misc partition.

--update

sdboot: do the sdboot upgrade process, that is, operate flash directly without partition concept.

Without parameters: mainly used in Linux A/B mode, directly upgrade in the current mode.

--partition=0x0000

Set the partition to be upgraded, the default value is 0x3FFC00, upgrade uboot,trust,boot,recovery,rootfs,oem,uboot_a,uboot_b,boot_a,boot_b,system_a,system_b partitions. The higher 16bits are already used, and the lower 8 bits are reserved bits which can be extended. 1: upgrade, 0: not upgraded

bits2322212019181716151413121110987~0
partitionloaderparameteruboottrustbootrecoveryrootfsoemuboot_auboot_bboot_aboot_bsystem_asystem_bmiscuserdatareserved

--reboot

After the updateEngine runs successfully, the machine restarts.

--vsersion_url

If it was set, it will be compared to the RK_VERSION= version value in the "/etc/version" file before upgrade.

Local path: read the version number from the firmware.

Remote path: download the version file from the remote, and the remote version file format must be consistent with the "/etc/version".

--image_url

Set the path of the upgrade firmware, which can be remote or local path.

--savepath

Set the path where the firmware is saved. If it is not set and the upgraded firmware path is a remote address, the default value is /tmp/update.img.

6.2 Upgrade Customize Partition​

typedef struct {
char name[32]; //firmware name
bool need_update; //need to upgrade
bool is_ab; //whether it is A/B dual patition
long long size; //firmware size
long long offset; //Offset position in update.img
long long flash_offset; //Offset position in flash
char dest_path[100]; //Target path
update_func cmd; //Upgrade function
}UPDATE_CMD, *PUPDATE_CMD;

To upgrade the customize partition "factory", add the following line below, and --partition needs to set the corresponding bit value to 1:

{"factory", false, false, 0, 0, 0, "", flash_normal},

external/recovery/update_engine/update.cpp

UPDATE_CMD update_cmd[] = {
{"bootloader" , false , false , 0 , 0 , 0 , "" , flash_bootloader} ,
{"parameter" , false , false , 0 , 0 , 0 , "" , flash_parameter} ,
{"uboot" , false , false , 0 , 0 , 0 , "" , flash_normal} ,
{"trust" , false , false , 0 , 0 , 0 , "" , flash_normal} ,
{"boot" , false , true , 0 , 0 , 0 , "" , flash_normal} ,
{"recovery" , false , false , 0 , 0 , 0 , "" , flash_normal} ,
{"rootfs" , false , true , 0 , 0 , 0 , "" , flash_normal} ,
{"oem" , false , false , 0 , 0 , 0 , "" , flash_normal} ,
{"uboot_a" , false , false , 0 , 0 , 0 , "" , flash_normal} ,
{"uboot_b" , false , false , 0 , 0 , 0 , "" , flash_normal} ,
{"boot_a" , false , false , 0 , 0 , 0 , "" , flash_normal} ,
{"boot_b" , false , false , 0 , 0 , 0 , "" , flash_normal} ,
{"system_a" , false , false , 0 , 0 , 0 , "" , flash_normal} ,
{"system_b" , false , false , 0 , 0 , 0 , "" , flash_normal} ,
{"misc" , false , false , 0 , 0 , 0 , "" , flash_normal} ,
{"userdata" , false , false , 0 , 0 , 0 , "" , flash_normal} ,

7. Appendix​

7.1 Firmware Package Tools​

7.1.1 Windows Package Tool​

The Windows package tool is located in the tools\windows\AndroidTool\rockdev directory. Modify the package- file first to add the image to be upgraded into package. Note that the path here is relative path.

The mkupdate.bat batch program will link the "tools\windows\AndroidTool\rockdev\Image" to the rockdev directory under root directory. So please make sure the corresponding image exists under rockdev. Then execute the mkupdate.bat which will package corresponding image in rockdev under root directory into update.img and stored in rockdev under root directory.

7.1.2 Linux Package Tool​

The Linux package tool is available in the "tools/linux/Linux_Pack_Firmware/rockdev" directory. Modify the package-file first to add the image to be upgraded into package. Note that the path here is relative path.

The "tools/linux/Linux_Pack_Firmware/rockdev/Image" will link to the rockdev under root directory. So please

make sure the corresponding image under rockdev exists. Then execute the mkupdate.sh which will package the

corresponding image in rockdev under root directory into update.img and stored in rockdev under root directory.

7.2 Misc Partition​

The Misc partition is a partition without a file system. It is used to store some boot configuration parameters. The current structure is as follows. Please see the "external/recovery/bootloader.h" and "external/recovery/update_engine/rkbootloader.cpp" for details.

Offset addressUsage
2kLinux A/B partition boot information
4kFormat command
16kCommunication between Recovery system and Normal system