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 sub-menu.- For kernel, select linux-kernel () ---> and then select ext-local-src.
( ) linux-xlnx
( ) remote
(X) ext-local-src
- For U-Boot, select u-boot ()
---> and then select ext-local-src.
( ) u-boot-xlnx
( ) remote
(X) ext-local-src
- For kernel, select linux-kernel () ---> and then select ext-local-src.
- Add external source path.
- 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 will give 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 Packaging BSP. - For kernel, select External
linux-kernel local source settings --->. Enter the
path: