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卡既可以启动了。

 

你可能感兴趣的:(zynq)