Steps for Managing Image Size - 2024.2 English - UG1144

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2024-11-13
Version
2024.2 English

The FIT Image size can be reduced using the following methods:

  1. Launch the root file system configuration menu using the following command:
    cd <plnx-proj-root>
    petalinux-config -c rootfs
  2. Select File System Packages.

    Under this sub-menu, you can find the list of options corresponding to the root file system packages. If your requirement does not need some of these packages, you can shrink the size of the root file system image by disabling them.

  3. Launch the kernel configuration menu using the following command:
    cd <plnx-proj-root>
    petalinux-config -c kernel
  4. Select General Setup.

    Under this submenu, you can find options to set the config items. Any item not mandatory to have in the system can be disabled to reduce the kernel image size. For example, CONFIG_SHMEM, CONFIG_AIO, CONFIG_SWAP, CONFIG_SYSVIPC. For more details, see the Linux kernel documentation.

    Note: Disabling some config items can lead to an unsuccessful boot. You should be aware of knowledge of config items before disabling them.

    Including extra configuration items and file system packages lead to increases the kernel image size and the root file system sizes, respectively.

    If the kernel or the root file system size increases and is greater than 128 MB, make the following changes in bsp.cfg:

    • Any U-Boot configuration and environment variables added to bsp.cfg are included in the U-Boot build.
    • Mention the Bootm length in <plnx-proj-root>/project-spec/meta-user/recipes-bsp/u-boot/files/bsp.cfg.
      #define CONFIG_SYS_BOOTM_LEN <value greater than image size>
    • Undef CONFIG_SYS_BOOTMAPSZ in <plnx-proj-root>/project-spec/meta-user/recipes-bsp/u-boot/files/bsp.cfg.
    Note: Changes made to bsp.cfg for MicroBlaze do not reflect. Update the configurations directly through petalinux-config -c u-boot-xlnx.