UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Contributor
Contributor
379 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

 

4 Replies
294 Views
Registered: ‎02-06-2019

Re: Petalinux 2019.2 - howto place kernel config under version control

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
Contributor
Contributor
267 Views
Registered: ‎07-01-2016

Re: Petalinux 2019.2 - howto place kernel config under version control

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!

 

 

0 Kudos
Scholar vanmierlo
Scholar
207 Views
Registered: ‎06-10-2008

Re: Petalinux 2019.2 - howto place kernel config under version control

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
89 Views
Registered: ‎02-06-2019

Re: Petalinux 2019.2 - howto place kernel config under version control


@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