cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
e.friel
Contributor
Contributor
1,052 Views
Registered: ‎10-02-2018

Petalinux u-boot development

Jump to solution

My understanding of customising u-boot, kernel etc for petalinux is that you download or clone the corresponding git repo, compile and build and then add it into the project directory. However I wasn't aware of the additional steps of creating a patch and also the need to create the custom receipe for it and it isnt on the petalinux manuals. Can someone explain the proper workflow for development or guide me to somewhere that has practical examples?  

0 Kudos
1 Solution

Accepted Solutions
shirilt
Xilinx Employee
Xilinx Employee
950 Views
Registered: ‎05-15-2018

Hi @e.friel 

In case you don't want to create patches and tinker with bbappend files, you can point Petalinux to use external sources for the repos you wish to customize (u-boot, linux-xlnx, etc.). The steps to do this are outlined on p. 107 of https://www.xilinx.com/support/documentation/sw_manuals/xilinx2019_1/ug1144-petalinux-tools-reference-guide.pdf

Best,

Shiril

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------

View solution in original post

0 Kudos
7 Replies
stephenm
Xilinx Employee
Xilinx Employee
1,027 Views
Registered: ‎09-12-2007

You can create your u-boot patch against the same version of Petalinux. For example:

git diff xilinx-v2019.1 > 0001_patch_description.patch

Copy this to recipes-bsp/u-boot/files

Then update the bbappend to use this

SRC_URI_append += " file://path to p oatch.patch"

0 Kudos
e.friel
Contributor
Contributor
1,003 Views
Registered: ‎10-02-2018

@stephenm

I created the patch, updated the bbappend file, rebuilt petalinux (petalinux-build) however getting an error: "ERROR: Function failed: do_compile"

The build recognises the new environment and updates the environment variables but fails to rebuild.

Notable error messages:

ERROR: u-boot-xlnx-v2017.01-xilinx-v2017.4+gitAUTOINC+5fa7d2ed06-r0 do_compile: oe_runmake failed
ERROR: Task (/media/emmet/587b2d62-fa69-4edc-9884-5cf59b035e55/petalinux/components/yocto/source/arm/layers/meta-xilinx/recipes-bsp/u-boot/u-boot-xlnx_2017.01.bb:do_compile) failed with exit code '1'
0 Kudos
stephenm
Xilinx Employee
Xilinx Employee
993 Views
Registered: ‎09-12-2007

Have you tested that the mods you made to u-boot will compile.

See the steps here to manually compile

 

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841722/ZCU102+Image+creation+in+OSL+flow

0 Kudos
e.friel
Contributor
Contributor
962 Views
Registered: ‎10-02-2018

@stephenm 

I copied the patch into /home/admin2/embeddedLinux/zyboBoard/project-spec/meta-user/recipes-bsp/u-boot/files directory.

Changed the bbappend file to point to the patch:

SRC_URI_append = " file://001_zybo_uboot.patch"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

Cleaned the environment and rebuilt the u-boot. Getting a do_configure error, it seems it is still searching for platform-top.h:

| install: cannot stat '/home/admin2/embeddedLinux/zyboBoard/build/tmp/work/plnx_arm-xilinx-linux-gnueabi/u-boot-xlnx/v2017.01-xilinx-v2017.4+gitAUTOINC+5fa7d2ed06-r0/platform-top.h': No such file or directory

In the config file: /zyboBoard/project-spec/meta-plnx-generated/recipes-bsp/u-boot/configs/config.cfg it is pointing to the target (platform-top.h):

CONFIG_SYS_CONFIG_NAME="platform-top"

I took it out and compiled with many errors

0 Kudos
shirilt
Xilinx Employee
Xilinx Employee
951 Views
Registered: ‎05-15-2018

Hi @e.friel 

In case you don't want to create patches and tinker with bbappend files, you can point Petalinux to use external sources for the repos you wish to customize (u-boot, linux-xlnx, etc.). The steps to do this are outlined on p. 107 of https://www.xilinx.com/support/documentation/sw_manuals/xilinx2019_1/ug1144-petalinux-tools-reference-guide.pdf

Best,

Shiril

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------

View solution in original post

0 Kudos
e.friel
Contributor
Contributor
937 Views
Registered: ‎10-02-2018

@shirilt 

Thanks for your help.

0 Kudos
e.friel
Contributor
Contributor
900 Views
Registered: ‎10-02-2018

For anyone who is building from external sources, the manual doesnt specify that you need to point petalinux to your new u-boot configuration file as it is still using the prebuilt one.

petalinux-config --> u-boot configuration --> u-boot config --> Change it to other
Enter your new u-boot config target underneath

DO NOT SPECIFY THE PATH TO THE FILE. SPECIFY THE FILENAME ONLY

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------

0 Kudos