编译 Buildroot 固件 本章介绍 Buildroot 固件的编译流程。 编译 SDK 编译前配置 在 "device/rockchip/rk3288/" 目录下,有不同板型的配置文件,选择配置文 件: HDMI ./build.sh aio-3288j-buildroot.mk LVDS DM-M10R800 ./build.sh aio-3288j-lvds-buildroot.mk 配置文件会链接到 "device/rockchip/.BoardConfig.mk",检查该文件可以验证 是否配置成功。 相关配置介绍: # Target arch export RK_ARCH=arm # 32位 ARM 架构 # Uboot defconfig export RK_UBOOT_DEFCONFIG=firefly-rk3288 # u-boot 配置文件 # Kernel defconfig export RK_KERNEL_DEFCONFIG=firefly_linux_defconfig # kernel 配置文件 # Kernel dts export RK_KERNEL_DTS=rk3288-firefly-aio # dts 文件 # Buildroot config export RK_CFG_BUILDROOT=rockchip_rk3288 # Buildroot 配置 # Recovery config export RK_CFG_RECOVERY=rockchip_rk3288_recovery # recovery 配置 # parameter for GPT table export RK_PARAMETER=parameter-buildroot.txt # 分区表 # rootfs image path export RK_ROOTFS_IMG=buildroot/output/$RK_CFG_BUILDROOT/images/rootfs.$RK_ROOTFS_TYPE # 根文件系统路径 部分编译 编译 u-boot ./build.sh uboot 编译 kernel ./build.sh kernel 编译 recovery ./build.sh recovery 编译 Buildroot 根文件系统 编译 Buildroot 根文件系统,将会在 "buildroot/output" 生成编译输出目录 : ./build.sh buildroot # 注:确保作为普通用户编译 Buildroot 根文件系统,避免不必要的错误。 打包固件 更新各部分镜像链接到 "rockdev/" 目录: ./mkfirmware.sh 打包固件,生成的完整固件会保存到 "rockdev/pack/" 目录。 ./build.sh updateimg 全自动编译 全自动编译会执行上述编译、打包操作,生成完整固件。 ./build.sh 分区说明 parameter 分区表 parameter.txt 文件中包含了固件的分区信息,以 parameter-buildroot.txt 为例: 路径:"device/rockchip/rk3288/parameter-buildroot.txt" FIRMWARE_VER: 8.1 MACHINE_MODEL:RK3288 MACHINE_ID:007 MANUFACTURER:RK3288 MAGIC: 0x5041524B ATAG: 0x00200800 MACHINE: 3288 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),0x00100000@0x0005a000(rootfs),-@0x0015a000(userdata:grow) uuid:rootfs=614e0000-0000-4b53-8000-1d28000054a9 CMDLINE 属性是我们关注的地方,以 uboot 为例, 0x00002000@0x00004000(uboot) 中 0x00004000 为uboot 分区的起始位置, 0x00002000 为分区的大小,以此类推。 package-file package-file 文件用于打包固件时确定需要的分区镜像和镜像路径,同时它需 要与 parameter.txt 文件保持一致。 路径:"tools/linux/Linux_Pack_Firmware/rockdev/rk3288-package-file" # name relative path # #hwdef hwdef package-file package-file bootloader image/miniloaderall.bin parameter image/parameter.txt trust image/trust.img uboot image/uboot.img misc image/misc.img boot image/boot.img recovery image/recovery.img rootfs image/rootfs.img oem image/oem.img userdata:grow image/userdata.img backup RESERVED