我们可以为 U-boot (Raspberry pi 4B) 从旧的“图像”生成 FIT 图像吗?

问题描述

我正在尝试在 RaspBerry Pi 4B 上启动自定义内核和引导加载程序。

我已经使用 buildroot 使用 RPi4 Defconfig 生成了 linux 内核,并编译了 u-boot 来启动这个内核。这是我能够成功实现的。但是现在,我想从 buildroot 生成的“图像”生成一个适合的图像。 我相信我们可以在 u-boot 提供的 mkimage 实用程序的帮助下做到这一点,但我不确定如何做到这一点。另外,我不确定 boot.scr 应该是什么来自动启动要生成的 FIT 映像。 非常欢迎任何参考资料或可能的重复问题或任何建议。 暂时在这上面敲我的头,感谢您的帮助!!!


编辑 - 我现在已经生成一个合适的图像, Running mkimage -l for the generated fit image gives this output

但是在使用 boot.scr as 启动时,

setenv bootargs console=tty0 console=ttyAMA0 root=/dev/mmcblk0p2 rootfstype=ext4 rootwait 
fatload mmc 0 0x3000000 ritman.fit
bootm 0x3000000

我在使用上述脚本和图像时遇到的错误是, u-boot output

编辑 2- .its 文件内容

/dts-v1/;
/ {
    description = "RPi FIT Image";
    #address-cells = <2>;
    images {
        kernel-1 {
            description = "default kernel";
            data = /incbin/("Image");
            type = "kernel";
            arch = "arm64";
            os = "linux";
            compression = "none";
            load =  <0x00080000>;
            entry = <0x00080000>;
            hash@1 {
                algo = "sha1";
            };
        };
 
        haha {
            description = "device tree";
            data = /incbin/("bcm2711-rpi-4-b.dtb");
            type = "flat_dt";
            arch = "arm64";
            compression = "none";
            hash@1 {
                algo = "sha1";
            };
        };
    };
    configurations {
        default = "config-1";
        config-1 {
            description = "default configuration";
            kernel = "kernel-1";
            fdt = "haha";
            signature-1 {
                algo = "sha1,rsa2048";
                key-name-hint = "dev";
                sign-images = "fdt","kernel";
            };
        };
    };
};

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)