Add EXT4 rootfs support - 2023.2 English

Vitis Tutorials: Vitis Platform Creation (XD101)

Document ID
XD101
Release Date
2023-12-26
Version
2023.2 English

It is recommended to use EXT4 for Vitis acceleration designs. PetaLinux uses initramfs format for rootfs by default. It cannot retain the rootfs changes in run time. Initramfs keeps rootfs contents in DDR, which reduces usable DDR memory. To retain the changes in the root file system and to enable maximum usage of available DDR memory, use EXT4 format for rootfs in the second partition while keeping the first partition FAT32 to store the boot files.

Vitis-AI applications installs additional software packages. To run Vitis-AI applications, use EXT4 rootfs. If in any case, initramfs are used, add all Vitis-AI dependencies to initramfs.

  1. Let PetaLinux generate EXT4 rootfs

    • Run petalinux-config

    • Go to Image Packaging Configuration

    • Enter into Root File System Type

    • Select Root File System Type as EXT4

    • Exit and Save.

    missing image

  1. Let Linux use EXT4 rootfs during boot

    The setting of rootfs to use during boot is controlled by bootargs. Change the bootargs settings to allow Linux to boot from EXT4 partition. There are various ways to update bootargs and you can choose either of the methods mentioned below.

    Method A: PetaLinux config

    • Run petalinux-config

    • Change DTG settings -> Kernel Bootargs -> generate boot args automatically to NO and update User Set Kernel Bootargs to earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait cma=512M. Click OK, Exit three times and Save.

    Method B: device tree

    • Update in system-user.dtsi

    • Add chosen node in root in addition to the previous changes to this file.

    / {
        chosen {
        	bootargs = "earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait cma=512M";
        };
    };
    

    Note:

    • root=/dev/mmcblk0p2 means to use second partition of SD card, which is the EXT4 partition.

    • Note that we also set these options in bootargs:

      • clk_ignore_unused: Commands Linux kernel to avoid turning off clocks if this clock is not used. Only useful clocks drives PL kernels because PL kernels are not represented in device tree.

      • cma=512M: CMA is used to exchange data between PS and PL kernel. The size for CMA is determined by PL kernel requirements. Vitis-AI/DPU needs at least 512MB CMA.