认证:SystemReady IR https://armkeil.blob.core.windows.net/developer/Files/pdf/certificate-list/arm-systemready-ir-certification-pine64.pdf
所需:
- PINE64 ROCKPro64 https://www.pine64.org/rockpro64/
- 电源
- MicroSD卡-最小2GiB
- MicroSD读卡器
- 访问linux(虚拟)计算机
构建固件
(根据:https://gitlab.arm.com/systemready/firmware-build/rk3399-manifest/-/blob/rockpro64-21.09/README.md)
首先,确保您的系统上安装了repo:https://source.android.com/setup/build/downloading
创建一个新目录并将cd放入其中
$ mkdir rockpro64_firmware
$ cd rockpro64_firmware
克隆代码库
$ repo init -u https://gitlab.arm.com/systemready/firmware-build/rk3399-manifest -m RockPro64.xml -b refs/tags/rockpro64-21.09
$ repo sync -j4 --no-clone-bundle
$ cd build
如果未安装aarch64工具链,请运行以下命令
$ make -j2 toolchains
最后,构建固件
$ make -j `nproc`
将固件安装到microSD卡
首先确定要写入的磁盘(例如使用lsblk),并将其设置为环境变量
export DISK=/dev/sdd
接下来,用零填充SD卡,确保您有一个新的开始:
$ sudo dd bs=4M if=/dev/zero of=$DISK oflag=sync
创建分区表
首先使用gdisk创建一个GPT分区表
$ sudo gdisk $DISK
创建一个新的分区表
Command (? for help): o
This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): y
现在您已经创建了一个新的GPT分区表,您需要创建一个“保护性”分区。此分区将防止您稍后编写的引导加载程序被覆盖。
Command (? for help): n
Partition number (1-128, default 1): 1
First sector (34-30277598, default = 2048) or {+-}size{KMGTP}: 34
Information: Moved requested sector from 34 to 2048 in
order to align on 2048-sector boundaries.
Use 'l' on the experts' menu to adjust alignment
Last sector (2048-30277598, default = 30277598) or {+-}size{KMGTP}: 34816
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): ef02
Changed type of partition to 'BIOS boot partition'
接下来,创建和保存EFI配置的EFI分区
Command (? for help): n
Partition number (2-128, default 2): 2
First sector (34-30277598, default = 36864) or {+-}size{KMGTP}: 34817
Information: Moved requested sector from 34817 to 36864 in
order to align on 2048-sector boundaries.
Use 'l' on the experts' menu to adjust alignment
Last sector (36864-30277598, default = 30277598) or {+-}size{KMGTP}: 2136964
Current type is 8300 (Linux filesystem)
Hex code or GUID (L to show codes, Enter = 8300): ef00
Changed type of partition to 'EFI system partition'
在将更改写入SD卡之前,请检查SD卡是否已正确设置。输出应类似于以下内容:
Command (? for help): p
Disk /dev/sdd: 30277632 sectors, 14.4 GiB
Model: MassStorageClass
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): EA991EB6-05B5-4EDB-A235-07FEDC3707E0
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 30277598
Partitions will be aligned on 2048-sector boundaries
Total free space is 28144695 sectors (13.4 GiB)
Number Start (sector) End (sector) Size Code Name
1 2048 34816 16.0 MiB EF02 BIOS boot partition
2 36864 2136964 1.0 GiB EF00 EFI system partition
接下来,将分区表写入磁盘
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
OK; writing new GUID partition table (GPT) to /dev/sdd.
The operation has completed successfully.
在EFI分区上创建FAT32文件系统
为了能够保存EFI配置,请在新创建的EFI分区上创建FAT32文件系统
$ sudo mkfs -t vfat "${DISK}2"
将固件复制到micro SD卡
最后,复制先前构建的固件
$ sudo dd if=../out/bin/u-boot/idbloader.img seek=64 of=$DISK
$ sudo dd if=../out/bin/u-boot/u-boot.itb seek=16384 of=$DISK
$ sync