Petalinux制作linux系统(续)image.ub文件来龙去脉

 

Petalinux制作linux系统可以启动,但并不仅限于此。

比如如下疑问:

1.image.ub哪里来?这个文件名称必须是这个吗?

2.自己采用原始方法移植u-boot,kernel后怎么做?

 

对与第一个问题:

其中image.ub这个名称不能变,否则出现

reading image.ub
can not read.

第二。image.ub哪里来?

搜索资料只知道这个文件把image, rootfs,dtb打包到一个文件里面,如

http://www.wowotech.net/u-boot/fit_image_overview.html

里面介绍的mkimage根据 kernel_fdt.its生成kernel_fdt.itb,但是这个不是ub格式的,ub是什么格式的?

 mkimage -l image.ub 
FIT description: U-Boot fitImage for plnx_arm kernel
Created:         Wed May  1 21:24:47 2019
 Image 0 (kernel@0)
  Description:  Linux Kernel
  Created:      Wed May  1 21:24:47 2019
  Type:         Kernel Image
  Compression:  uncompressed
  Data Size:    3747376 Bytes = 3659.55 kB = 3.57 MB
  Architecture: ARM
  OS:           Linux
  Load Address: 0x00008000
  Entry Point:  0x00008000
  Hash algo:    sha1
  Hash value:   7a42c9f25a66f940cecbf6b02ba3028021a317d4
 Image 1 (fdt@0)
  Description:  Flattened Device Tree blob
  Created:      Wed May  1 21:24:47 2019
  Type:         Flat Device Tree
  Compression:  uncompressed
  Data Size:    18769 Bytes = 18.33 kB = 0.02 MB
  Architecture: ARM
  Hash algo:    sha1
  Hash value:   d06aaa8ecccde42cc6ea78eae5decb442e290ad0
 Image 2 (ramdisk@0)
  Description:  ramdisk
  Created:      Wed May  1 21:24:47 2019
  Type:         RAMDisk Image
  Compression:  uncompressed
  Data Size:    5920476 Bytes = 5781.71 kB = 5.65 MB
  Architecture: ARM
  OS:           Linux
  Load Address: unavailable
  Entry Point:  unavailable
  Hash algo:    sha1
  Hash value:   3fddbe6f35125f3d01384076e11354d733d6866b
 Default Configuration: 'conf@1'
 Configuration 0 (conf@1)
  Description:  Boot Linux kernel with FDT blob + ramdisk
  Kernel:       kernel@0
  Init Ramdisk: ramdisk@0
  FDT:          fdt@0
 Configuration 1 (conf@2)
  Description:  Boot Linux kernel with FDT blob
  Kernel:       kernel@0
  FDT:          fdt@0

由此可知image.ub是mkimage生成的,那么这个.its是哪个文件呢?

找了很久:

/build/tmp/deploy/images/plnx_arm/fitimage.its

里面的内容

/dts-v1/;

/ {
        description = "U-Boot fitImage for plnx_arm kernel";
        #address-cells = <1>;

        images {
                kernel@0 {
                        description = "Linux Kernel";
                        data = /incbin/("/home/flinn/peta/peta_top/build/tmp/deploy/images/plnx_arm/zImage");
                        type = "kernel";
                        arch = "arm";
                        os = "linux";
                        compression = "none";
                        load = <0x8000>;
                        entry = <0x8000>;
                        hash@1 {
                                algo = "sha1";
                        };
                };
                fdt@0 {
                        description = "Flattened Device Tree blob";
                        data = /incbin/("/home/flinn/peta/peta_top/build/tmp/deploy/images/plnx_arm/plnx_arm-system.dtb");
                        type = "flat_dt";
                        arch = "arm";
                        compression = "none";
                        hash@1 {
                                algo = "sha1";
                        };
                };
                ramdisk@0 {
                        description = "ramdisk";
                        data = /incbin/("/home/flinn/peta/peta_top/build/tmp/deploy/images/plnx_arm/petalinux-user-image-plnx_arm.cpio.gz");
                        type = "ramdisk";
                        arch = "arm";
                        os = "linux";
                        compression = "none";
                        hash@1 {
                                algo = "sha1";
                        };
                };
        };
        configurations {
                default = "conf@1";
                conf@1 {
                        description = "Boot Linux kernel with FDT blob + ramdisk";
                        kernel = "kernel@0";
                        fdt = "fdt@0";
                        ramdisk = "ramdisk@0";
                        hash@1 {
                                algo = "sha1";
                        };
                };
                conf@2 {
                        description = "Boot Linux kernel with FDT blob";
                        kernel = "kernel@0";
                        fdt = "fdt@0";
                        hash@1 {
                                algo = "sha1";
                        };
                };
        };
};

可以看出与mkimage -l image.ub是一致的。

同时还能得出三个来源

/home/flinn/peta/peta_top/build/tmp/deploy/images/plnx_arm/zImage
/home/flinn/peta/peta_top/build/tmp/deploy/images/plnx_arm/plnx_arm-system.dtb
/home/flinn/peta/peta_top/build/tmp/deploy/images/plnx_arm/petalinux-user-image-plnx_arm.cpio.gz

也及有了这三个文件加上../build/tmp/deploy/images/plnx_arm/fitimage.its

可以通过下面指令得到image.ub

 mkimage -f fitimage.its image.ub

最后烧写UBOOT.bin和image.ub到sd卡既可以启动了。

 

  • 7
    点赞
  • 61
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值