Install package source and dependencies in top level package directory?

How can I add/install packages from OpenWRT into the top level package directory of the build tree? I would like to add packages with their dependencies and have the package source copied into the package directory at the top level of the tree.

I installed and built my image with the additional package and dependencies using feeds, but it installed links in the package/feeds directory that point to the source packages in the feeds directory. I would like to install the new package source and dependencies in the top level packages directory instead, like the other packages in the tree.

Also, when I built my project with the new packages from feeds and pushed to my git repo, clones from that repo don't build with the new packages. What is the workflow to update the build tree with new package sources (using feeds) and preserve the package source in the tree?

Thanks in advance for any help.

Copying files into a package is always technically possible, but doing so -while possible- is neither 'supported' (in the sense of valid packaging/ implicit 'policy' compliance), nor actually useful, as the build dependencies to actually build on target usually aren't packaged (not self-hosting), nor would most of the devices in question would even be capable of compiling anything but the most trivial hello_world.c type of source (lack of RAM (virtual and physical), very slow SOCs, totally unsuitable main storage).

So, to configure using feeds, and make the source tree ready to build e.g. CI builds, should I use the following workflow?

  • clone openwrt
  • scripts/feeds update to fetch the packages I want
  • scripts/feeds install to add to the source tree
  • make menuconfig selecting the package and dependencies to build
  • push changes in the source tree to the repository
  • make, etc. to build the image