0

I am using imx8mnevk and I was trying to rebuild an image and removed the tmp directory.

I ran bitbake core-image-minimal but now the tmp directory doesn't seem to have a work-shared folder that is supposed to have all the source files.

I want to modify device tree but cant seem to find where they are located.

Is there a way to get the sources again or do I need to redo everything?

Sohil Shah
  • 25
  • 1
  • 8

1 Answers1

1

Try to avoid making any modifications within the tmp directory (it's named tmp because it's internal & temporary). Specifically, avoid making source code changes there because they may get overwritten during future builds, and in some cases Yocto will fail to detect modified code under tmp and won't actually do what you expect.

Instead, use devtool to extract and modify the source code for a package. For example:

devtool modify virtual/kernel

This will extract the kernel source into a workspace directory, and override the kernel recipe to use that source.

You can modify that source, build, and once you're happy with your changes, devtool has some commands that automatically capture your changes as a patch file and generate a .bbappend file in your chosen layer.

Check out Using devtool to Patch the Kernel in Yocto's kernel development guide for tips.

In your case, I suspect the work-shared directory didn't reappear because Yocto was able to use the sstate-cache (which is outside tmp) to deliver the core-image-minimal recipe from cache, without needing to rebuild the kernel.

justinsg
  • 738
  • 6
  • 11
  • Thank you so much I was looking for this. I used to make changes in tmp which I knew was incorrect but since I was unaware I had no choice kind of , now devtool helps a lot!! – Sohil Shah Oct 14 '21 at 06:26