cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
senkoo
Observer
Observer
888 Views
Registered: ‎08-28-2018

Petalinux Project overrides edited files

Jump to solution

Hello,

 

My name is Senna. I am working on a project with ZC702 dev kit. But my board does NOT have a phyiscal ethernet switch.

 

So i made changes in xilinx_emacps.c and fixed_phy.c so i wanted to test them.

 

But when i put them in: /data/projects/aet/senkoo/Ets-Prg/Firmware/ets-prg-firmware/petalinux/ets-prg$ cd build/tmp/work-shared/plnx_arm/kernel-source/drivers/net/ethernet/xilinx/

 

They seem to get overriden. When i run: petalinux-build and program the kernel to SPI flash and boot. The log does not show my prints i put in the file. So i was wondering do i need to place the modified files somewhere else where it can include them or i need to set some configuration some where?

 

I also included the files for clarification.

 

Thanks in advance.

 

Greetings,

Senna

0 Kudos
1 Solution

Accepted Solutions
aravindb
Moderator
Moderator
846 Views
Registered: ‎02-07-2018

Hi @senkoo

 

You should not modify anything that build directory, that will be overwritten  every time when it builds.

You can follow below methods, if you would like to add any changes in driver, this will be reflected in your code while building and you can check in the board.

 

Method1:

1. Download same kernel tag from repository

2. modify your changes and create patch using git

3. follow the steps mentioned in this link :http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips section "Patching the Linux Kernel of a PetaLinux Project "

4. petalinux-build

 

 

Method 2:

You can build kernel as External kernel source option

Build steps for External source using petalinux:
1. petalinux-config and go to -> Linux Components Selection ---> linux-kernel (ext-local-src)
External linux-kernel local source settings --->/aravind_working_dir/source_code/my_xlnx (EXternal linux-kernel local source path)

2. Go to -> Auto Config Settings and select Specify a manual device tree include directory and enter the path to the new kernel include directory.

Auto Config Settings ---> [*] Specify a manual device tree include directory
(/aravind_working_dir/source_code/my_xlnx/arch/arm64/boot/dts/include) Manual device tree include directory

3. Save and exit petalinux-config

4. Do a petalinux-build

 

 

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.
----------------------------------------------------------------------------------------------

 

View solution in original post

0 Kudos
2 Replies
aravindb
Moderator
Moderator
847 Views
Registered: ‎02-07-2018

Hi @senkoo

 

You should not modify anything that build directory, that will be overwritten  every time when it builds.

You can follow below methods, if you would like to add any changes in driver, this will be reflected in your code while building and you can check in the board.

 

Method1:

1. Download same kernel tag from repository

2. modify your changes and create patch using git

3. follow the steps mentioned in this link :http://www.wiki.xilinx.com/PetaLinux+Yocto+Tips section "Patching the Linux Kernel of a PetaLinux Project "

4. petalinux-build

 

 

Method 2:

You can build kernel as External kernel source option

Build steps for External source using petalinux:
1. petalinux-config and go to -> Linux Components Selection ---> linux-kernel (ext-local-src)
External linux-kernel local source settings --->/aravind_working_dir/source_code/my_xlnx (EXternal linux-kernel local source path)

2. Go to -> Auto Config Settings and select Specify a manual device tree include directory and enter the path to the new kernel include directory.

Auto Config Settings ---> [*] Specify a manual device tree include directory
(/aravind_working_dir/source_code/my_xlnx/arch/arm64/boot/dts/include) Manual device tree include directory

3. Save and exit petalinux-config

4. Do a petalinux-build

 

 

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.
----------------------------------------------------------------------------------------------

 

View solution in original post

0 Kudos
senkoo
Observer
Observer
835 Views
Registered: ‎08-28-2018

HI @aravindb,

 

Thank you so much ! :)

 

Cheers

0 Kudos