cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Observer
Observer
1,398 Views
Registered: ‎08-13-2018

2020.1 Kernel config always overwritten

Jump to solution

When running "petalinux-build -c kernel -x finish" in 2019.2, the devtool-fragment.cfg file was updated with the changes made to the kernel configuration.

 

Under 2020.1, the same command always deletes the existing devtool-fragment.cfg and replaces it with a new one, which contains only the changes made in the last configuration session (petalinux-config -c kernel).

 

What needs to be done with 2020.1 in order to keep the existing file and apply the new changes?

 

Is there a way to use the tools to automate this, or do we have to update the devtool-fragment.cfg manually?

1 Solution

Accepted Solutions
Highlighted
Xilinx Employee
Xilinx Employee
1,082 Views
Registered: ‎10-23-2018

Hi Guys,

Sorry for the delay in response.

This is the known issue from the petalinux 2020.1 tool.

Below is the fix for this,

$ petalinux-create -t project -s <bsp path>

$ petalinux-config --silentconfig

Edit the file <project-dir>/components/yocto/layers/core/scripts/lib/devtool/standard.py line no. 1432 as below:

From:

if bb.data.inherits_class('kernel-yocto', rd):
    fragment_fn = 'devtool-fragment.cfg'
    fragment_path = os.path.join(destdir, fragment_fn)

To:

if not run_do_menuconfig and bb.data.inherits_class('kernel-yocto', rd):
    fragment_fn = 'devtool-fragment.cfg'
    fragment_path = os.path.join(destdir, fragment_fn)

The above change will fix the issue with devtool-fragment.cfg file in the local petalinux project.

To fix this issue in the petalinux tool follow the additional steps below

$ petalinux-build -e

This will generate the esdk file in images/linux/esdk.sh.

$ mv images/linux/esdk.sh images/linux/aarch64

$ petalinux-upgrade -f /scratch/rajuk/xilinx-zcu102-2020.1/images/linux/

The above command will update the tool with new changes made in project sources.

 

Regards,

Rajukumar P.

 

View solution in original post

18 Replies
Highlighted
Mentor
Mentor
1,347 Views
Registered: ‎01-28-2008

Hi @mgarrick 

  I believe the process has changed in Petalinux 2020.1, as the linux configuration is written to $plnx-proj/project-spec/linux-xlnx/plnx_kernel.cfg file.

Thanks,

-Pat

 

https://tuxengineering.com/blog
0 Kudos
Highlighted
Observer
Observer
1,331 Views
Registered: ‎08-13-2018

First off, thank you for your response.

Couple of questions.

First:

$plnx-proj/project-spec/linux-xlnx/plnx_kernel.cfg does not appear to exist.

Did you mean $plnx-proj/project-spec/configs/linux-xlnx/plnx_kernel.cfg? I found that file.

Second:

When I run petalinux-config -c kernel and change some settings, and then run petalinux-build -c kernel -x finish, the file $plnx-proj/project-spec/configs/linux-xlnx/plnx_kernel.cfg does NOT change at all.

However, devtool-fragment.cfg IS created, with the alterations made in the GUI contained within it.

So I thought maybe I could manually copy the values out of the devtool-fragment.cfg file and into the plnx_kernel.cfg file.

I tried this, and then deleted the devtool-fragment.cfg file (and the associated directory and .bb file).

When I ran the petalinux-config -c kernel again, the changes I had transferred were no longer set in the GUI.

Furthermore, the values I had added to the plnx_kernel.cfg file were deleted from the file when the petalinux-config tool was run.

As another test, I tried to turn off one of the settings that was set in the plnx_kernel.cfg ... CONFIG_SPI_CADENCE.

After running petalinux-build -c kernel -x finish, the plnx_kernel.cfg file remained unchanged, while the devtool-fragment.cfg was altered with the single change removing CONFIG_SPI_CADENCE.

So it seems as though the tool may not be using plnx_kernel.cfg?

Is there some other step to get the changes propagated to plnx_kernel.cfg?

Or are we really supposed to use the devtool-fragment.cfg, perhaps manually renaming it every time we produce a new one and adding it to the .bb file, kind of like 2018.3 did it (automatically)?

Then this might be required for every change?

Thanks!

Highlighted
Visitor
Visitor
1,273 Views
Registered: ‎02-21-2020

I'm having the same issue with 2020.1 petalinux. Firstly, I'm pretty sure plnx_kernel.cfg is what older versions of Petalinux use and devtool-fragment.cfg is the new way (although I can't say for certain because this isn't very well documented at all).

1) I had kernel configs that were previously saved to devtool-fragment.cfg
2) I made new config modifications with 'petalinux-config -c kernel'
3) petalinux-build -c kernel
4) petalinux-build -c kernel -x finish
5) ONLY new changes made in step 2 are now in devtool-fragment.cfg and all previous changes are lost!
6) 'petalinux-config -c kernel' again confirms that only the recent changes made are present. All previous changes are reset to defaults in the GUI

 

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
1,083 Views
Registered: ‎10-23-2018

Hi Guys,

Sorry for the delay in response.

This is the known issue from the petalinux 2020.1 tool.

Below is the fix for this,

$ petalinux-create -t project -s <bsp path>

$ petalinux-config --silentconfig

Edit the file <project-dir>/components/yocto/layers/core/scripts/lib/devtool/standard.py line no. 1432 as below:

From:

if bb.data.inherits_class('kernel-yocto', rd):
    fragment_fn = 'devtool-fragment.cfg'
    fragment_path = os.path.join(destdir, fragment_fn)

To:

if not run_do_menuconfig and bb.data.inherits_class('kernel-yocto', rd):
    fragment_fn = 'devtool-fragment.cfg'
    fragment_path = os.path.join(destdir, fragment_fn)

The above change will fix the issue with devtool-fragment.cfg file in the local petalinux project.

To fix this issue in the petalinux tool follow the additional steps below

$ petalinux-build -e

This will generate the esdk file in images/linux/esdk.sh.

$ mv images/linux/esdk.sh images/linux/aarch64

$ petalinux-upgrade -f /scratch/rajuk/xilinx-zcu102-2020.1/images/linux/

The above command will update the tool with new changes made in project sources.

 

Regards,

Rajukumar P.

 

View solution in original post

Highlighted
Mentor
Mentor
1,065 Views
Registered: ‎01-28-2008

Folks,

  The line in question in standard.py should be 1432, not 2318.

 

Thanks,

-Pat

 

https://tuxengineering.com/blog
Highlighted
Xilinx Employee
Xilinx Employee
1,060 Views
Registered: ‎10-23-2018

@patocarr 

Thanks for correcting it. Yes its 1432, not 2318.

Highlighted
Visitor
Visitor
954 Views
Registered: ‎02-21-2020

Hi @rajuk , I tried your instructions below and after creating a new project the standard.py script was still the original version. Would using an XSA instead of BSP affect anything? This is the process I followed

  • petalinux-create --type project --template zynqMP --name new
  • petalinux-config --get-hw-description=<path to XSA>
  • Make edits to <project-dir>/components/yocto/layers/core/scripts/lib/devtool/standard.py
  • petalinux-build -e
  • mkdir <project-dir>/images/linux/aarch64
    • This directory didn't exist so I needed to create it
  • mv <project-dir>/images/linux/esdk.sh <project-dir>/images/linux/aarch64
  • petalinux-upgrade -f <project-dir>/images/linux/
    • Is this the right path?

 

I then created a new project:

  • petalinux-create --type project --template zynqMP --name new
  • petalinux-config --get-hw-description=<path to XSA>

...and standard.py does not have the edits. Did I do something wrong?

 

 

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
937 Views
Registered: ‎10-23-2018
  • mkdir <project-dir>/images/linux/aarch64
    • This directory didn't exist so I needed to create it
  • mv <project-dir>/images/linux/esdk.sh <project-dir>/images/linux/aarch64

Small correction in your above steps:

<project-dir>/images/linux/aarch64 -> This is a file will generate when you run the petalinux-build -e command. You dont need to create the directory.

mv <project-dir>/images/linux/esdk.sh <project-dir>/images/linux/aarch64 -> Rename the generated esdk.sh file as aarch64 to detected by the petalinux-upgrade command.

Then run the petalinux-upgrade -f <project-dir>/images/linux/

0 Kudos
Highlighted
Mentor
Mentor
930 Views
Registered: ‎01-28-2008

Hi @rajuk 

  Thanks for your response.

  I believe @inve7 refers to whether that upgrade command modifies the current project's tool or rather the system-wide tool, such that a new project would automatically get the fixed standard.py.

 

Thanks again,

-Pat

 

https://tuxengineering.com/blog
0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
923 Views
Registered: ‎10-23-2018

@patocarr The upgrade command will update the system wide tool. If you create the project with that tool the standard.py changes should reflect in newer project.

Make sure you should have write access to that tool.

Highlighted
Visitor
Visitor
917 Views
Registered: ‎02-21-2020

Hi @rajuk ...thanks for pointing out my error! I was now able to perform petalinux-upgrade successfully and new created projects now have the edit to standard.py

0 Kudos
Highlighted
Explorer
Explorer
848 Views
Registered: ‎10-04-2017

Rajuk,

So I tried this and it did generated a new edsk which is installed when I start a clean build.  However, I have user layers added in my config file and now I get this error:

ERROR: Failed to add user layer:  < my layer>

So I can't get past the config phase now.

 

jeff

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
818 Views
Registered: ‎10-23-2018

@jrhtech Can you please share the <project-dir>/build/config.log file to debug further ?

0 Kudos
Highlighted
Explorer
Explorer
780 Views
Registered: ‎10-04-2017

Failing log:

ERROR: Unable to start bitbake server (None)
ERROR: Server log for this session (/home/jhane/workarea/trenz/2020/te821/mbed-ultrascale-build/mbed-petalinux/te821-703-dyno/build/bitbake-cookerdaemon.log):
--- Starting bitbake server pid 31242 at 2020-08-21 20:36:13.945667 ---
ERROR: Found duplicated BBFILE_COLLECTIONS 'mojo-core', check bblayers.conf or layer.conf to fix it.
ERROR: Found duplicated BBFILE_COLLECTIONS 'mojo-core', check bblayers.conf or layer.conf to fix it.
ERROR: Found duplicated BBFILE_COLLECTIONS 'mojo-core', check bblayers.conf or layer.conf to fix it.

and the bblayers does add it twice:

${SDKBASEMETAPATH}/layers/meta-vitis-ai \
${SDKBASEMETAPATH}/layers/../../../user-layers/meta-mojo/meta-mojo-core \
${SDKBASEMETAPATH}/layers/../../../user-layers/meta-mojo/meta-mojo-xilinx \
/home/jhane/workarea/trenz/2020/te821/mbed-ultrascale-build/mbed-petalinux/te821-703-dyno/project-spec/meta-user \
/home/jhane/workarea/trenz/2020/te821/mbed-ultrascale-build/mbed-petalinux/te821-703-dyno/user-layers/meta-mojo/meta-mojo-core \

 

But if I look at the bblayers from a build with the default aarch64 only the full path entry exist the relative path entries have not been added.

 

thanks,

jeff

 

 

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
751 Views
Registered: ‎10-23-2018

The 'meta-mojo-core' layer was already added into the tool bblayers.conf file when you run the petalinux-build -e and petalinux-upgrade  commands.

Please remove the layer from petalinux-config -> user layers  to unblock this issue.

0 Kudos
Highlighted
Explorer
Explorer
728 Views
Registered: ‎10-04-2017

Hi Rajuk,

Are you saying remove them and any rootfs components before i do petalinux-build -e or just remove them from my config?  Removing from the config would not work.   If I remove those from the config that means everyone else and the CI/CD builds will break unless everyone updates their eSDK.  And those layers don't exist for all projects so I don't want them in my eSDK.

 

thanks,

jeff

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
720 Views
Registered: ‎10-23-2018

Hi jrhtech,

If the layers cannot be removed from the config before building the eSDK, add the user layers paths to the SDK_LAYERS_EXCLUDE_append in petalinuxbsp.conf file which will not include those layers into the eSDK.

EX: SDK_LAYERS_EXCLUDE_append = " <layerspath>"

0 Kudos
Highlighted
Explorer
Explorer
539 Views
Registered: ‎10-04-2017

I was about to build by removing all the user layer from my config.  I tried use the EXCLUDE but then it threw an error about the meta-user layer also being duplicated.   I didn't try excluding that to see what happens, I just temporarily modified my config.

But this process is useful since previously I would modify my petalinux install.  This method is better because I could share a generated aarch64 with other developers if necessary.

 

thanks,

jeff

0 Kudos