cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
suheb
Adventurer
Adventurer
16,891 Views
Registered: ‎01-21-2014

How do I create image.ub?

I followed the following link and got uimage

 

http://www.wiki.xilinx.com/Build+Kernel

 

Now I need image.ub and BOOT.BIn

 

BOOT.BIN I am already having and I know it can be created by the command petalinux-package  

Now I need to create an image.ub having kernel and filesystem.

I am having my own initramfs.cpio and uimage and would like  to make an image.ub.

 

Any advice ? .  

0 Kudos
10 Replies
suheb
Adventurer
Adventurer
16,890 Views
Registered: ‎01-21-2014

This link 

 

http://www.wiki.xilinx.com/Zynq-7000+AP+SoC+Ubuntu+Desktop+on+Peta+Linux+Tech+Tip

 

says 

 

image.ub = peta Linux image consists of kernel image, device tree blob and minimal rootfs

 

But no mention of how to make this image.ub.

0 Kudos
justinlh
Explorer
Explorer
16,864 Views
Registered: ‎02-18-2014

petalinux-build

 

ug980-petalinux-board-bringup would be a resource to look at

0 Kudos
linnj
Xilinx Employee
Xilinx Employee
16,857 Views
Registered: ‎09-10-2008

Hi,

 

It seems like your mixing in non-Petalinux flow with Petalinux flow.  Petalinux allows you to point to a different kernel tree or u-boot tree and build it.  I would probably do that (configure Petalinux to point to a different area).  

 

In the kernel configuration, using Petalinux, you can also point it to a different cpio image for your root filesystem. The kernel build combines the cpio image with the kernel image. The image.ub is a FIT image which is documented in the u-boot tree (doc/uImage.FIT).

 

Thanks.

lucywill
Newbie
Newbie
16,829 Views
Registered: ‎04-22-2014


@justinlh wrote:

petalinux-build

 

ug980-petalinux-board-bringup would be a resource to look at on create image.ub


thank you, i will have a look at this resource.  do you have any tutorial that can teach me how to create such image, i am a new learner.

0 Kudos
ransh
Explorer
Explorer
11,123 Views
Registered: ‎05-28-2014

I have the same issue.

Is there a way to manually (not with petalinux) create image.ub in petalinux (from kernel and rootfs, so that we can first modify rootfs manually) "?

 

Thank you

0 Kudos
sandeepg
Moderator
Moderator
11,073 Views
Registered: ‎04-24-2017

Hi @ransh,

 

Below is the steps to create FIT image(image.ub) from command line without using petalinux. Make sure you change the ARCH for arm or aarch64 depending on your use case.

 

1. Create a fitImage.its file and add below content

$ vim fitImage.its
/dts-v1/;
 
/ {
    description = "U-Boot fitImage for plnx_aarch64 kernel";
    #address-cells = <1>;
 
    images {
        kernel@0 {
            description = "Linux Kernel";
            data = /incbin/("${TMPDIR}/deploy/images/${MACHINE}/Image");
            type = "kernel";
            arch = "arm64";
            os = "linux";
            compression = "none";
            load = <0x80000>;
            entry = <0x80000>;
            hash@1 {
                algo = "sha1";
            };
        };
        fdt@0 {
            description = "Flattened Device Tree blob";
            data = /incbin/("{TMPDIR}/deploy/images/${MACHINE}/zcu102-zynqmp-system.dtb");
            type = "flat_dt";
            arch = "arm64";
            compression = "none";
            hash@1 {
                algo = "sha1";
            };
        };
        ramdisk@0 {
            description = "ramdisk";
            data = /incbin/("{TMPDIR}/deploy/images/${MACHINE}/zcu102-zynqmp.cpio.gz.u-boot");
            type = "ramdisk";
            arch = "arm64";
            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";
            };
        };
    };
};

2. Run mkimage command to generate the FIT image(image.ub). Make sure you install this u-boot tools package

$ mkimage -f fitImage.its image.ub

Note: Make sure you source the dtc tools path else you see this error

$ mkimage -f fitImage.its image.ub
sh: 1: dtc: not found
mkimage: Can't read image.ub.tmp: Invalid argument
mkimage Can't add hashes to FIT blob
$

 

 

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
hanni_xu
Visitor
Visitor
8,302 Views
Registered: ‎05-03-2018

reference to 'run.do_image_xilinx_fitimage'.

0 Kudos
jahnavi_guvvala
Visitor
Visitor
3,340 Views
Registered: ‎08-20-2020

Hii,

 

what are those paths?

/<PATH-TO-KERNEL-IMAGE>/zcu102-zynqmp/Image

do i need to install anything previously?

 

 

Thanks,

Jahnavi 

0 Kudos
sandeepg
Moderator
Moderator
3,312 Views
Registered: ‎04-24-2017

Hi @jahnavi_guvvala ,

Once you have built Kernel, DTB and rootfs images, just specify the absolute path to Image, .dtb and rootfs.cpio.gz.u-boot

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
jahnavi_guvvala
Visitor
Visitor
3,287 Views
Registered: ‎08-20-2020

Hi,

 

It means i need to download petalinux and build it?

 

 

thanks,

Jahnavi

 

0 Kudos