别人的解释,特别清晰:
doc/uImage.FIT/source_file_format.txthttps://github.com/wowotechX/u-boot/blob/x_integration/doc/uImage.FIT/source_file_format.txtdoc/uImage.FIT/howto.txt
https://github.com/wowotechX/u-boot/blob/x_integration/doc/uImage.FIT/howto.txtdoc/uImage.FIT/kernel.its
https://github.com/wowotechX/u-boot/blob/x_integration/doc/uImage.FIT/kernel.itsdoc/uImage.FIT/kernel_fdt.its
https://github.com/wowotechX/u-boot/blob/x_integration/doc/uImage.FIT/kernel_fdt.itsdoc/uImage.FIT/multi.its
https://github.com/wowotechX/u-boot/blob/x_integration/doc/uImage.FIT/multi.its 在官方手册中,将最终生成的、包含了设备树、内核、根文件系统(ramdisk,只有ramdisk才可以被包含在这里,因为普通的根文件系统是在物理磁盘内的,不需要在uboot阶段load进DDR中)的.itb文件称为《new uImage》,原话为<Resulting .itb file is the actual binary of a new uImage>,可以看到,.itb文件就是对旧的uImage的一种新的,集成度更高的镜像。
1 生成命令
利用mkimage命令生成.itb文件。类似于生成.dtb文件需要.dts文件一样,生成.itb文件也需要一个.its配置文件,在.its文件中对zImage、xxx.dts、rootFs.tar.gz的结构,加载地址,加载方式等信息进行配置。
命令:
mkimage -f xxx.its xxx.itb
注意,zImage xxx.dts rootFs.tar.gz必须与xxx.its在同一个目录下。
2 内容格式
/*dts的版本*/
/dts-v1/;
/*根节点*/
/{
description = "this is itb file root node!";
/*
images节点:
这是一个内置的节点
mkimage工具从configurations节点读出的配置信息全部要从images节点内获取
*/
images {
kernel@1 {
description = "linux-5.x.xx";
data = /incbin/("./zImage");
type = "kernel";
arch = "arm";
os = "linux";
compression = "none";
load = <0x8200000>;
entry = <0x8200000>;
hash-1 {
algo = "sha1";
};
};
fdt@1 {
description = "dtb";
data = /incbin/("./xxxx.dtb");
type = "flat_dt";
arch = "arm";
os = "linux";
compression = "none";
load = <0x8300000>;
hash-1 {
algo = "sha1";
};
};
};
/*
configurations节点:
这是一个内置节点
u-boot根据此节点内的信息引导内核,加载设备树等操作
*/
configurations{
/*default属性告诉uboot默认使用config@1配置*/
default = "config@1";
config@1 {
description = "config1";
kernel = "kernel@1";
fdt = "fdt@1";
};
};
};