cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dtubbs
Contributor
Contributor
3,617 Views
Registered: ‎07-01-2016

Petalinux 2019.2 - howto place kernel config under version control

Greetings!

We have a number of developers and I need everyone to be using the same kernel config, so I need it placed under version control.

After blowing away the "build" and "components" directories, then executing "petalinux-config -c kernel" and making my changes, I find the following two files have appeared (in addition to many others):

<plnx-project>/components/plnx_workspace/sources/linux-xlnx/.config.baseline
<plnx-projext>/components/plnx_workspace/sources/linux-xlnx/.config.new

I also see that .config.new is actually a symlink to :

<plnx-project>/build/tmp/work/plnx_zynqmp-xilinx-linux/linux-xlnx/4.19-xilinx-v2019.2+git999-r0/linux-xlnx-4.19-xilinx-v2019.2+git999//.config

A diff between the two files shows that .config.new is based on .config.baseline, and indeed has all my kernel config updates in it.

Here's the rub: according to UG1144 (page 22), the build and components/plnx_workspace directories can be ignored from a version control perspective - but it seems that .config.baseline and .config.new are essential.  I'm not keen on placing build and components/plnx_workspace directories under version control.  How do I proceed?

- Is there a Yocto mechanism I can use to place .config.baseline and .config.new somewhere in the project-spec directory, plug them into BitBake, and have them included as part of the build?

- Where is the source of the .config.baseline file?  It is possible to modify it with my kernel config changes?

- Is there a minimum/essential set of files/directories I can place under version control?

- Is there something I'm missing or a better way to do this?

Thanks in advance for any suggestions!

-Dave

 

8 Replies
3,532 Views
Registered: ‎02-06-2019

Same issue. PetaLinux 2018.3 automatically creates kernels fragmets at the

<root>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/user_<DATE_TIME>.cfg

and adds this fragments into

project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%%.bbappend

PetaLinux 2019.2 does not.

Related post with possible WA: https://forums.xilinx.com/t5/Embedded-Linux/Petalinux-2019-2-kernel-configuration-issues/td-p/1050292

0 Kudos
dtubbs
Contributor
Contributor
3,505 Views
Registered: ‎07-01-2016

Solution:

For those of you who may find their way to this issue, I'll describe my method to putting the Linux kernel and u-boot configurations safely under version control.  Special thanks to adrozdov for providing a link that eventually revealed a slick solution!

===== kernel configuration =====

1- Execute "petalinux-config -c kernel", and make any changes (either adding or subtracting functionality)
2- "cd" to the top of your project.  Unlike other petalinux-xxx commands, this one MUST be run from the top level.
3- Execute "petalinux-build -c kernel -x finish".  When this command is complete, you'll find the following have been added:
    <plnx-project>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend
    <plnx-project>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/devtool-fragment.cfg

An examination of the devtool-fragment.cfg file will show the change deltas from the kernel baseline to your config.
The next time you run a kernel configuration, this file will be included so the kernel configuration you'll be presented already has your changes applied.  If you'd like to start over from scratch with a kernel config baseline, you can delete the above files. Be cautious that you don't remove other files placed in the dir tree; but in my case, I was able to delete the recipes-kernel folder (and everything below) from meta-user.

Once completed, you can place the following directories and files under version control:
<plnx-project>/project-spec/meta-user/recipes-kernel
<plnx-project>/project-spec/meta-user/recipes-kernel/linux
<plnx-project>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend
<plnx-project>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx
<plnx-project>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/devtool-fragment.cfg

A fresh version control checkout followed by a build had all my kernel configs properly applied!

 

===== u-boot configuration =====

1- Execute "petalinux-config -c u-boot", and make any changes (either adding or subtracting functionality)
2- "cd" to the top of your project.  Unlike other petalinux-xxx commands, this one MUST be run from the top level.
3- Execute "petalinux-build -c u-boot -x finish".  If errors are shown, append the command with " -f" to force the operation.
    When this command is complete, you'll find the following:
    <plnx-project>/project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappend  (modified)
    <plnx-project>/project-spec/meta-user/recipes-bsp/u-boot/files/devtool-fragment.cfg  (added)
    <plnx-project>/project-spec/meta-user/recipes-bsp/u-boot/files/microblaze-kc705-Convert-microblaze-generic-to-k.patch  (added)

An examination of the devtool-fragment.cfg file will show the change deltas from the u-boot baseline to your config.
The next time you run a u-boot configuration, this file will be included so the u-boot configuration you'll be presented already has your changes applied.

Once completed, you can add the following directories and files under version control:
<plnx-project>/project-spec/meta-user/recipes-bsp/u-boot/u-boot-xlnx_%.bbappend
<plnx-project>/project-spec/meta-user/recipes-bsp/u-boot/files/devtool-fragment.cfg
<plnx-project>/project-spec/meta-user/recipes-bsp/u-boot/files/microblaze-kc705-Convert-microblaze-generic-to-k.patch

A fresh version control checkout followed by a build had all my u-boot configs properly applied!

 

 

vanmierlo
Mentor
Mentor
3,445 Views
Registered: ‎06-10-2008

I assume that when you want to make further changes to the configuration, you have to rerun "petalinux-build -c kernel -x finish" to get the files updated for a commit.

0 Kudos
3,327 Views
Registered: ‎02-06-2019


@vanmierlo wrote:

I assume that when you want to make further changes to the configuration, you have to rerun "petalinux-build -c kernel -x finish" to get the files updated for a commit.


It is not an option. After that procedure, sources at the "components/plnx_workspace/sources/linux-xlnx" will be deletect and another kernel build process will start from scratch. I prefer fast & light git commits and kernel finishing affect work process heavily.

0 Kudos
pawelzz
Contributor
Contributor
2,825 Views
Registered: ‎05-16-2018

I have made a patch with using devtool and the patch was created in directory <plnx_root>/project_spec/meta-user/recipes-kernel/linux/linux-xlnx. Also devtool modified the linux-xlnx_2019.2.bbappend recipe. Written patch name is proper. Why after

petalinux-build -x mrproper

and

petalinux-config -c kernel

the patch is not applied? What is a procedure to do it correctly?

Paweł

0 Kudos
2,798 Views
Registered: ‎01-20-2020

I get the below error when I used "petalinux-build -c kernel -x finish" :

 petalinux-build -c kernel -x finish
[INFO] building kernel
[INFO] generating Kconfig for project
[INFO] silentconfig project
[INFO] sourcing bitbake
[INFO] generating plnxtool conf
[INFO] generating meta-plnx-generated layer
[INFO] generating machine configuration
[INFO] generating bbappends for project . This may take time !
[INFO] generating u-boot configuration files
[INFO] generating kernel configuration files
[INFO] generating user layers
[INFO] generating workspace directory
[INFO] generating kconfig for Rootfs
[INFO] silentconfig rootfs
[INFO] generating petalinux-user-image.bb
[INFO] devtool finish linux-xlnx <..>/project-spec/meta-user
NOTE: Starting bitbake server...
ERROR: No recipe named 'linux-xlnx' in your workspace
ERROR: Failed to build kernel

0 Kudos
abains
Visitor
Visitor
2,332 Views
Registered: ‎08-29-2019

What worked for me was the following:

petalinux-build -x mrproper

petalinux-build 

petalinux-config -c kernel

 

The patches would not get applied without first doing a full "petalinux-build" (ie "petalinux-build -c kernel" did not apply them either)

0 Kudos
2,315 Views
Registered: ‎02-06-2019

petalinux-build -c kernel -x patch

also works and more quickly then complete build.

 

0 Kudos