Using External Kernel and U-Boot with PetaLinux - 2024.1 English

PetaLinux Tools Documentation: Reference Guide (UG1144)

Document ID
UG1144
Release Date
2024-06-21
Version
2024.1 English

PetaLinux includes kernel source and U-Boot source. However, you can build your own kernel and U-Boot with PetaLinux.

PetaLinux supports local sources for kernel, U-Boot, TF-A, PLM, and PSM-FIRMWARE.

For external sources create a directory <plnx-proj-root>/components/ext_sources/.

  1. Copy the kernel source directory:
    <plnx-proj-root>/components/ext_sources/<MY-KERNEL>
  2. Copy the U-Boot source directory:
    <plnx-proj-root>/components/ext_sources/<MY-U-BOOT>
  3. Run petalinux-config, and go into Linux Components Selection submenu
    • For kernel, select linux-kernel () ---> and select ext-local-src.

      ( ) linux-xlnx

      ( ) remote

      (X) ext-local-src

    • For U-Boot, select u-boot () ---> and select ext-local-src.

      ( ) u-boot-xlnx

      ( ) remote

      (X) ext-local-src

  4. Add external source path.
    • For trusted-firmware-arm, select trusted-firmware-arm() -> ext-local-src ()trusted-firmware-arm()remote(x)ext-local-src
    • For PLM, select plm()-> ext-local-src()plm()remote(*)ext-local-src
    • For PSM-FIRMWARE, select psm-firmware()-> ext-local-src()psm-firmware()remote(*)ext-local-src
    • For kernel, select External linux-kernel local source settings --->. Enter the path:

      ${PROOT}/components/ext_sources/<MY-KERNEL>

    • For U-Boot, select External u-boot local source settings --->. Enter the path:

      ${PROOT}/components/ext_sources/<MY-U-BOOT>

      ${PROOT} is a PetaLinux variable pointing to <plnx-proj-root>/ directory. You can also specify an absolute path of the source. The sources can be placed outside the project as well.

      Note: If after setting ext-local-src, you try to change it to linux-xlnx/u-boot-xlnx in petalinux-config, it gives the following warning.
      WARNING: Workspace already setup to use from <ext-local-src path>,
      Use 'petalinux-devtool reset linux-xlnx' To remove this (or) Use this for your development.
    Note: When creating a BSP with external sources in project, it is your responsibility to copy the sources into the project and do the packing. For more information, see BSP Packaging.
Important: It is not mandatory to have external sources under components/. You can specify any location outside the project as well. However, while packaging the BSP, you are responsible for copying the external sources into components/ and setting relative path.
Note: If the external source is a git repository, its checked out state must be appropriate for the project that is being built.