How to add your package to an existing feed?

I see it was asked already and not only once:

Could we add the missing documentation maybe?

@Grommish @stangri

1 Like

Been there! Done that too. :crazy_face:

Here is what works for me.

From your buildroot user/home directory set your local source tree like this:

mypackage
└── source
    └── yourpackagename
        ├── files
        │   ├── sourcefile1
        │   └── sourcefile2 . . .
        ├── Makefile
        ├── patches
        │   └── test.patch
        └── README.md

Modify your feeds.conf.default and insert your source feed as the top entry. I usually also do a clean feeds. This serves a dual purpose if you are modding a package name that exists in any of the other feeds by ensuring they won't be picked up from feeds update/install.

You need to set your Makefile to allow menuconf/nconfig to find and populate your package.

define Package/mypackagename
        SECTION:=source
        CATEGORY:=Myprograms
        TITLE:=mypackagename

Update and Install feeds, and invoke make menuconfig/nconfig.

You will find a menu entry in menuconfig/nconfig Myprograms with your programname as a sub menu.

Thanks, what you suggested is more suited for "Adding your package to your own feed", isn't it?:

1 Like

This was your question?

A custom feed is one defined by you. Its contents could reside anywhere. In this case, you add your additonal package to your local feed directory. ie Your local fork, an openwrt/package you decide to modify for your own use, Helloworld,. . .

Assuming your local custom feed points to user/home/mypackages, just expand the tree and any new package you propagate into it will be picked up by feeds update/install.

mypackages
├── source
│   ├── yourpackagename1		# package 1
│   │   ├── files
│   │   │   ├── sourcefile1
│   │   │   └── sourcefile2
│   │   ├── Makefile
│   │   ├── patches
│   │   │   └── test.patch
│   │   └── READ.me
│   ├── yourpackagename2		# package 2
│   │   └── files
│   └── yourpackagename3		# package 3
│       └── files
└── test.txt
2 Likes

Well, not quite. I think working with custom feeds is already addressed here:

however, you added the missing detail about Makefile, thanks.

What follows more closely to a missing clause about existing feed in the OP is probably these two ways of adding the package:

It was also mentioned in different places, so looks like a pattern:

Probably worth to be documented.

Well, I see these as being the standard feeds used by the OpenWrt build process by default:

src-git packages https://git.openwrt.org/feed/packages.git^78bcd00c13587571b5c79ed2fc3363aa674aaef7
src-git luci https://git.openwrt.org/project/luci.git^fe09ab990256d8b63e76cc1ab2435baef921b8b4
src-git routing https://git.openwrt.org/feed/routing.git^a0d61bddb3ce4ca54bd76af86c28f58feb6cc044
src-git telephony https://git.openwrt.org/feed/telephony.git^0183c1adda0e7581698b0ea4bff7c08379acf447

ergo, by default any other feed I define must be a Custom Feed.

Your first reference is titled "Adding a Package to Existing Feed" but the OP is asking about "Adding" a package to an existing "Custom Feed".

Yes the solution provided by @grommish works by injecting your package into the buildroot "Standard Feeds". But carefully read his caveats about this process, and his rational for circumventing the normal process.

Your other reference to Luci application for the 3ginfo project follows this similar protocol by injecting the package into the buildroot Standard Feeds.

There is little redundancy here. A distclean and you've got to recreate the process.

The Build System provides for Custom Feeds to accomplish the referenced processes, and IMHO, I think these posts lead to much of the confusion around this process.

I have 3 custom feeds

src-link mypackages /home/user/mypackages
src-git mytheme https://github.com/myfork/luci-theme-mytheme
Stangri's Melmac feed

they define a local feed including my mods to two existing OpenWrt Packages Feed packages, and of course my HelloWorld package, a github fork of a personal LuCI theme I use, and Stan's feed repo.

In nconfig my local feed packages show up under MyPackages in the main menu, Stan's repository is there in it's place, and luci-app-mytheme shows up as the bottom entry in the standard OpenWrt LuCI themes submenu.

I will also point you back to another reference you provided. https://openwrt.org/docs/guide-developer/feeds#adding_your_package_to_an_existing_feed

See the Fix Me?

I'll leave it at that.

I do though think that https://openwrt.org/docs/guide-developer/feeds#adding_your_package_to_your_own_feed needs revision to point the source locally outside of the buildroot.

It's extremely easy to recreate your buildroot environment. Even if you have to blow it away. Copy Your backup feeds.conf.default and Your .config to the newly cloned buildroot and away you go. Your custom package(s) are ensconed locally, and your remote packages remain intact, ¯\_(ツ)__/¯

I hoped you or someone else could actually fix it. If not, well, thanks anyway.

Frankly, I don't see anything that needs fixing. Have you tried the recipe?

Please, show me a rationale wherein you must inject a package into an OpenWrt Standard feed in order to compile it into an installable .ipk and/or your firmware build.

Use the leverage the Build System affords you.

If we don't need it, maybe just delete the "Fix it" clause from the doc, to eliminate the confusion?
Can you do that, as it seems you are more experienced in OpenWrt build system than me?

No. It still has validity for specific purposes as I alluded to in @Grommish caveats. I just don’t see the forum references to it as being suited to the typical build process and “custom feeds” aka “non-official OpenWrt packages”.

I just posted a recipe that Works for Me and how to use it that incorporates non-OpenWrt packages as well as “self modified OpenWrt packages” into the build system, and follows the typical Wiki Build Process seamlessly for me - “clone, update/install feeds, patch, nconfig, build.

You asked a question. I provided an answer. Try it or reject it - your choice.

You noted my reference to the package Makefile. This was, by the way, the missing key that lead to my ‘recipe’.

Yes, I guess I could but as stated above it’s a valid scenario that will remain Fix Me ATM.

No. Just my journey here and what I’ve learned along the way.

Maybe the question hasn't been answered yet because it is too obvious? An "existing custom feed" somehow implies that you already arranged a package feed somewhere and linked it into the buildsystem. Wouldn't adding a package just entail creating a new subdirectory in the feed and placing the Makefile and/or copying the existing package directory w/ Makefile & resources as-is into the feed?

What exactly is it you want to do? Use an unofficial feed remotely hosted by someone else and placing one custom package inside it? In this case clone the feed somewhere locally, place your package and reference the feed parent directly using src-link in feeds.conf instead of src-git.

1 Like

Yes, this is probably most closely describes what I came up with, too.
I just hoped to keep src-git and just inject my package to the existing feed somehow.
This is needed so that the injected packages and other packages from the feed would end up with a common directory after build, this should ease using imagebuilder afterwards.
Can we add it to the docs as a "fix" maybe? This thing is not self-explanatory and I had hard times figuring this out.