平台
- arm64
rockchip rk3399 linux - pc
ubuntu 64
背景
没有系统源码以及系统固件的情况下使用,也可通过window系统的AndroidTools工具进行操作,这里仅是linux系统环境进行操作。
步骤
1. 获取rk3399分区表
电脑端linux系统使用瑞芯微rk3399SDK中的烧写软件upgrade_tool ,将板子的烧写口和电脑连接起来,板子上电的时候按recovery键进入烧写模式。
./upgrade_tool pl
Program Data in /data/project/rockchip/rk3399/src/rockdev/pack
Partition Info(gpt):
NO LBA Size Name
01 0x00004000 0x00002000 uboot
02 0x00006000 0x00002000 trust
03 0x00008000 0x00002000 misc
04 0x0000a000 0x00010000 boot
05 0x0001a000 0x00010000 recovery
06 0x0002a000 0x00010000 backup
07 0x0003a000 0x00020000 oem
08 0x0005a000 0x00182c00 rootfs
09 0x001dcc00 0x038613df userdata
反推出parameter.txt
FIRMWARE_VER: 2.5.0
MACHINE_MODEL: RK3399
MACHINE_ID: 007
MANUFACTURER: RK3399
MAGIC: 0x5041524B
ATAG: 0x00200800
MACHINE: 3399
CHECK_MASK: 0x80
PWR_HLD: 0,0,A,0,1
TYPE: GPT
CMDLINE: mtdparts=rk29xxnand:0x00002000@0x00004000(uboot),0x00002000@0x00006000(trust),0x00002000@0x00008000(misc),0x00010000@0x0000a000(boot),0x00010000@0x0001a000(recovery),0x00010000@0x0002a000(backup),0x00020000@0x0003a000(oem),0x182c00@0x0005a000(rootfs),-@0x1dcc00(userdata:grow)
uuid:rootfs=614e0000-0000-4b53-8000-1d28000054a9
2. 获取分区
[root@rk3399:~]# ls /dev/block/by-name -l
total 0
lrwxrwxrwx 1 root root 15 Jan 18 2013 backup -> ../../mmcblk1p6
lrwxrwxrwx 1 root root 15 Jan 18 2013 boot -> ../../mmcblk1p4
lrwxrwxrwx 1 root root 15 Jan 18 2013 misc -> ../../mmcblk1p3
lrwxrwxrwx 1 root root 15 Jan 18 2013 oem -> ../../mmcblk1p7
lrwxrwxrwx 1 root root 15 Jan 18 2013 recovery -> ../../mmcblk1p5
lrwxrwxrwx 1 root root 15 Jan 18 2013 rootfs -> ../../mmcblk1p8
lrwxrwxrwx 1 root root 15 Jan 18 2013 trust -> ../../mmcblk1p2
lrwxrwxrwx 1 root root 15 Jan 18 2013 uboot -> ../../mmcblk1p1
lrwxrwxrwx 1 root root 15 Jan 18 2013 userdata -> ../../mmcblk1p9
3. dd复制分区镜像
dd if=/dev/mmcblk1p1 of=uboot.img
dd if=/dev/mmcblk1p2 of=trust.img
dd if=/dev/mmcblk1p3 of=misc.img
dd if=/dev/mmcblk1p4 of=boot.img
dd if=/dev/mmcblk1p5 of=recovery.img
非必要镜像:
dd if=/dev/mmcblk1p6 of=backup.img
dd if=/dev/mmcblk1p7 of=oem.img
dd if=/dev/mmcblk1p8 of=rootfs.img
dd if=/dev/mmcblk1p9 of=userdata.img
4. 恢复分区镜像
电脑端linux系统使用瑞芯微rk3399SDK中的烧写软件upgrade_tool (tools/linux/Linux_Upgrade_Tool/Linux_Upgrade_Tool/upgrade_tool ),将需要烧写的文件从rk3399板子中导出并放置在与upgrade_tool 同目录下。
upgrade_tool ul rk3399_loader_v1.24.126.bin
upgrade_tool di -p paramater.txt
upgrade_tool di -uboot uboot.img
upgrade_tool di -trust trust.img
upgrade_tool di -b boot.img
upgrade_tool di -r recovery.img
upgrade_tool di -m msic.img
upgrade_tool di -oem oem.img
upgrade_tool di -userdata userdata.img
upgrade_tool di -rootfs rootfs.img
其中,boot.img 包含了kernel 以及设备树 文件。 说明:
分区名 | 镜像名 | 简介 |
---|
loader | MiniLoaderAll.bin | 一级loader | u-boot | uboot.img | 二级loader | trust | trust.img | 安全环境,如OP-TEE、ATF | misc | misc.img | 引导参数分区 | recovery | recovery.img | kernel+dtb+ramdisk 组成的根文件系统 | boot | boot.img | kernel+dtb | rootfs | rootfs.img | 根文件系统,只读 | oem | oem.img | 厂商预制,可读写 | userdata | userdata.img | 用于数据,可读写 |
|