cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
387 Views
Registered: ‎01-27-2019

petalinux 2020.1 kernel config file

Jump to solution

Hi, I migrated from petalinux 19.1 to 20.1. I use local external kernel git repository.

When I change some kernel features in menuconfig and save them, It saves in external repo, not on project folders.

Even when I use petalinux-build -fx mrproper, all kernel changes destroyed!!

How can I save .config file for kernel and use it in petalinux project?

Thanks.

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Explorer
Explorer
234 Views
Registered: ‎10-04-2017

  I can tell you it does update the cfg.  However, it loses my previous changes and it deletes my patches from the files directory and also deletes them from the recipe.  
  So I have to manually restore everything then fix the cfg file to have my latest changes.
   It’s not flaky it’s totally broke!

jeff 

View solution in original post

8 Replies
Highlighted
Mentor
Mentor
306 Views
Registered: ‎01-28-2008

@johnblackxilinx 

  Have you tried using

petalinux-build -c kernel -x finish

Thanks,

-Pat

https://tuxengineering.com/blog
Highlighted
Moderator
Moderator
271 Views
Registered: ‎02-07-2018

HI @johnblackxilinx 

The kernel .config file is saved in this below path after you configure the kernel & build it.

petalinux-config -c kernel

petalinux-build

vim build/tmp/work-shared/zcu102-zynqmp/kernel-build-artifacts/.config 

 This "petalinux-build -fx mrproper"  command  will remove tmp files, <PROJECT>/images/, <PROJECT>/build/ and <PROJECT>/components/plnx_workspace directories

 

Thanks & Regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
---------------------------------------------------------------------------------------------

Highlighted
Xilinx Employee
Xilinx Employee
247 Views
Registered: ‎05-15-2018

Hi @johnblackxilinx 

As suggested, you need to run "petalinux-build -c kernel -x finish" after doing a "petalinux-config -c kernel" and changing config options via menuconfig. After exiting the menuconfig window, a .cfg file will be generated in <linux-xlnx>/oe-local-files containing your config changes. When you do a "petalinux-build -c kernel -x finish", the .cfg file will be pulled over into your <plnx_proj>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx directory. Also, this task will update the linux-xlnlx_%.bbappend file to include the new .cfg file in the SRC_URI variable. 

I must say this flow has been a little flakey in Petalinux 2020.1 Could you let me know if your kernel config changes are captured after adding the "-x finish" step, followed by building the entire kernel image?

Thanks,

Shiril

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Highlighted
Explorer
Explorer
235 Views
Registered: ‎10-04-2017

  I can tell you it does update the cfg.  However, it loses my previous changes and it deletes my patches from the files directory and also deletes them from the recipe.  
  So I have to manually restore everything then fix the cfg file to have my latest changes.
   It’s not flaky it’s totally broke!

jeff 

View solution in original post

Highlighted
Contributor
Contributor
181 Views
Registered: ‎01-27-2019

Hi all! thanks for reply.

@patocarr and @shirilt , I used this method but @jrhtech said that it loses all previous changes and it deletes all patches from the files directory and also deletes them from the recipe. its not applicable. 

@aravindb , I can use this method manually for save changes, but how can I load this file again in petalinux?

I decided back to last version (v2019.1) again! I think this version is full of bugs! I hope next release is been correct.

thanks all. 

 

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
116 Views
Registered: ‎05-15-2018

Hi all,

I've verified that the either of the following two flows are successful in capturing kernel config changes with Petalinux 2020.1:

This common workaround needs to be applied for either flow: Add the following line to <plnx_proj>/project-spec/meta-user/conf/petalinuxbsp.conf

SRCTREECOVEREDTASKS_remove_pn-linux-xlnx = "do_kernel_configme"

Flow 1: Using the menuconfig GUI

1. petalinux-config -c kernel (make changes, save and exit)

2. petalinux-build -c kernel -x finish

3. Step 2 above will copy devtool_fragment.cfg into <plnx_proj>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/, but will also delete any other files placed in this directory manually. Restore these deleted files.

4. Open up <plnx_proj>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend. Contrary to earlier posts on this thread, I don't see petalinux deleting SRC_URI lines for any manually placed patch files. One discrepancy however is that the .bbappend file still contains the line KERNEL_FEATURES_append = " bsp.cfg", despite bsp.cfg already having been deleted. You need to comment out or delete this line. At this point the .bbappend include content will be consistent with the files present in <plnx_proj>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/

5. petalinux-build -c kernel (upon booting on the target with the newly built image.ub, I can verify that the config option from step 1 is enabled)

Flow 2: Manually placing a .cfg file in the meta-user layer

1. Create a file my.cfg in <plnx_proj>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/ and enable some kernel config option in it, for example add the line: CONFIG_EXT4_DEBUG=y

2. Add the following line to <plnx_proj>/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend -- SRC_URI_append = " file://my.cfg"

3. Add any patch files to the linux-xlnx directory, and add corresponding lines to the .bbappend file to include these patches in the SRC_URI variable.

4. petalinux-build -c kernel (upon booting on the target with the newly built image.ub, I can verify that the config option from the file my.cfg in step 1 is enabled)

Compared to the previous flow, you need not do the petalinux-config -c kernel and the petalinux-build -c kernel -x finish steps. This method thus skips the use of the 'devtool' utility from the petalinux backend, which is clearly having issues when configuring the kernel.

Please let me know if either of the above two methods work for you guys. Regarding issues with the menuconfig flow when petalinux-build -c kernel -x finish is invoked, I have filed a bug-fix request, and hopefully should be fixed in the next release.

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
Highlighted
Explorer
Explorer
82 Views
Registered: ‎10-04-2017

I haven't tried anything new yet, but here is a log and it's clearly deleting a SRC_URI line from my bbappends

 

galactus:[2679] petalinux-build -c kernel -x finish
INFO: sourcing build tools
[INFO] building kernel
[INFO] sourcing build environment
[INFO] generating user layers
[INFO] generating workspace directory
[INFO] Specified component linux-xlnx already exists in workspace, Using the same...
[INFO] devtool finish linux-xlnx myproj/project-spec/meta-user
NOTE: Starting bitbake server...
Loading cache: 100% |#####################################################################################################| Time: 0:00:00
Loaded 4252 entries from dependency cache.
Parsing recipes: 100% |###################################################################################################| Time: 0:00:05
Parsing of 2986 .bb files complete (2978 cached, 8 parsed). 4261 targets, 169 skipped, 0 masked, 0 errors.
INFO: Updating config fragment /tmp/devtoolv323cn18/tmpcgvetr4h/devtool-fragment.cfg
NOTE: Writing append file myproj/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend
NOTE: Copying devtool-fragment.cfg to myproj/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/devtool-fragment.cfg
INFO: Removing file myproj/project-spec/meta-user/recipes-kernel/linux/linux-xlnx/0001-Revert-tty-xilinx_uartps-Add-the-id-to-the-console.patch
INFO: Cleaning sysroot for recipe linux-xlnx...
INFO: Leaving source tree myproj/components/yocto/workspace/sources/linux-xlnx as-is; if you no longer need it then please delete it manually
[INFO] Removing source tree from workspace: myproj/components/yocto/workspace/sources/linux-xlnx
[INFO] successfully built kernel

galactus:[2968] git diff linux-xlnx_%.bbappend
diff --git a/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend b/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend
index 00d95e9..5c9cb80 100644
--- a/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend
+++ b/project-spec/meta-user/recipes-kernel/linux/linux-xlnx_%.bbappend
@@ -1,4 +1,3 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

SRC_URI += "file://devtool-fragment.cfg"
-SRC_URI += "file://0001-Revert-tty-xilinx_uartps-Add-the-id-to-the-console.patch"

 

jeff

 

Highlighted
Xilinx Employee
Xilinx Employee
61 Views
Registered: ‎05-15-2018

Hi @jrhtech 

I can confirm that the following line was not deleted from my .bbappend file:

SRC_URI_append = " file://0001-linux-driver-fix.patch"

However, the following line (which has the same effect as above) does get deleted from the .bbappend file:

SRC_URI += "file://0001-linux-driver-fix.patch"

This seems to be a bug as well, and has been communicated to our factory.

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