How to include gcc in initramfs (core-image-minimal-initramfs) for i.MX8MP QSPI-only boot

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to include gcc in initramfs (core-image-minimal-initramfs) for i.MX8MP QSPI-only boot

495 Views
Bhardwaj
Contributor II

Hi ,

I am working on an i.MX8M Plus DDR4 custom board and I am able to successfully boot the system entirely from QSPI flash (32MB).

My current boot components are:

  1. flash.bin (U-Boot)

  2. Image.gz (Linux kernel)

  3. imx8mp-ddr4-evk.dtb

  4. core-image-minimal-initramfs.cpio.gz

Since my board does not have SD card or eMMC, I am using initramfs as the root filesystem.

Now I want to include gcc inside core-image-minimal-initramfs.cpio.gz, so that I can compile applications directly on the target without relying on any external storage.

Changed the conf/local.conf and then build using command

bitbake core-image-minimal-initramfs

Also attached the local.conf file for your reference.

It generated  core-image-minimal-initramfs.cpio.gz but gcc is not present in that /bin folder and getting like below.

~ # gcc
/bin/sh: gcc: not found


~ # ls
bin dev home init.d media proc run sys usr
boot etc init lib mnt root sbin tmp var

Could you please advise:

  • What is the correct Yocto method to include gcc in an initramfs image?

  • Are there any recommended configurations or limitations when using gcc inside initramfs (RAM usage, image size, etc.)?

Any guidance or reference to NXP-supported Yocto practices would be very helpful.

Thank You.

0 Kudos
Reply
3 Replies

393 Views
pengyong_zhang
NXP Employee
NXP Employee

Hi @Bhardwaj 

You want to put all of the Image to your QSPI flash(32MB)? If yes, then it's too small to contain gcc.

B.R

0 Kudos
Reply

434 Views
pengyong_zhang
NXP Employee
NXP Employee

Hi @Bhardwaj 

Sorry to reply late, you can add the below code in local.conf file

IMAGE_INSTALL:append = " gcc binutils glibc-utils libgcc-dev make" 

B.R

0 Kudos
Reply

421 Views
Bhardwaj
Contributor II

Hi @pengyong_zhang ,

I added the following line to conf/local.conf: 

IMAGE_INSTALL:append = " gcc binutils glibc-utils libgcc-dev make" 

 However, after rebuilding $bitbake core-image-minimal-initramfs, gcc is still not included in core-image-minimal-initramfs.cpio.gz

When i check cpio.gz , gcc is not found (please see the attached screenshot).

Bhardwaj_0-1770035606785.png

Could you please let me know if I’m missing something or if additional configuration is required to include gcc in the initramfs image?

 

Thank you.

 

0 Kudos
Reply