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/.
- Copy the kernel source
directory:
<plnx-proj-root>/components/ext_sources/<MY-KERNEL>
- Copy the U-Boot source directory:
<plnx-proj-root>/components/ext_sources/<MY-U-BOOT>
- 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
- For kernel, select linux-kernel () ---> and select ext-local-src.
- 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 settingext-local-src
, you try to change it to linux-xlnx/u-boot-xlnx inpetalinux-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.