生成FIT格式的系统镜像

什么是FIT格式?

全称是flattened image tree uImage,为了更好的支持单个固件的通用性,类似于kernel device tree机制,uboot也需要对这种uImage固件进行支 持。FIT uImage中加入多个dtb文件,和ramdisak文件,当然如果需要的话,同样可以支持多个kernel文件。
## 需要准备的文件和工具
1. DTC工具
2. mkimage
3. image  (在arch/arm/boot目录下)
4. 设备树文件
5. .its文件
以上前四个文件在传统生成系统镜像文件都会得到,这里不再介绍。下面着重介绍.its文件的制作。

生成its文件

在uboot/juboot-1.0/doc/uImage.FIT目录下有生成好的kernel.its 文件,我们可以参考它制作我们自己需要的.its文件。

/dts-v1/;

/ {
        description = "Simple image with single Linux kernel and FDT blob";
        #address-cells = <1>;

        images {
                kernel {
                        description = "Vanilla Linux kernel";
                        data = /incbin/("./vmlinux.bin.gz");
                        type = "kernel";
                        arch = "ppc";
                        os = "linux";
                        compression = "gzip";
                        load = <00000000>;
                        entry = <00000000>;
                        hash-1 {
                                algo = "crc32";
                        };
                        hash-2 {
                                algo = "sha1";
                        };
                };
                fdt-1 {
                        description = "Flattened Device Tree blob";
                        data = /incbin/("./target.dtb");
                        type = "flat_dt";
                        arch = "ppc";
                        compression = "none";
                        hash-1 {
                                algo = "crc32";
                        };
                        hash-2 {
                                algo = "sha1";
                        };
                };
        configurations {
                default = "conf-1";
                conf-1 {
                        description = "Boot Linux kernel with FDT blob";
                        kernel = "kernel";
                        fdt = "fdt-1";
                };
        };
};

为了适应我们自己的平台,我们需要对以下几点进行修改:
1.关于内核的描述kernel 节点

  1. data = /incbin/("./Image"); 表示当前目录下的Imange文件
  2. arch = “ppc”; 对应写上自己的架构
  3. load = <0x00008000>; entry = <0x00008000>;装载地址和入口地址

2 . 关于设备树的描述

  1. data = /incbin/("./system.dtb");
  2. arch = “arm”;

生成最终系统镜像

mkimage -f xx.its xx.ub

注意!!

 在工作目录中要有描述文件中所描述的文件:xx.dtb image xx.its

最后配置uboot使其支持FIT格式系统镜像。

  • 1
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值