OpenWrt Forum Archive

Topic: Packaging a new build target in a feed [SOLVED]

The content of this topic has been archived on 4 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to package a new build target into a feed.

Looking at the info in the top level of the feeds folder, a build target is successfully recognized and parsed by the build system as the target data correctly appears in the feeds/<feed-name>/<feed-name.tmp>/.targetinfo file. and there is a .kernel-<TARGETNAME> file.

No info pertaining to this target is to be found in tmp/.targetinfo and there is no corresponding .kernel-<TARGETNAME> in tmp

No matter what I do, I cannot seem to get the new target to show up in menuconfig (which it does if the folder is placed directly into target/linux).

Does anyone know if this is even possible - to package up a new platform build target in a feed and have it integrate seamlessly into build process? I'm not sure if I'm doing something wrong or if this is just not possible.

Thanks
/dl

EDIT: I cleaned out tmp multiple times...and touched the target/linux/Makefile

(Last edited by dl12345 on 6 Sep 2016, 10:01)

Tired of thinking ???

Three simple steps
OpenWRT(Mainpage)->Documentaion->DeveloperGuid->Feeds

Bonus:
what are purpuse of tmp and .* files/dirs ??

elektroman wrote:

Tired of thinking ???

Three simple steps
OpenWRT(Mainpage)->Documentaion->DeveloperGuid->Feeds

Bonus:
what are purpuse of tmp and .* files/dirs ??

What is it about the anonymity of a forum that allows people like you to think they can insult others with impunity?

The developer documentation was the obvious place to start. I read this many years ago. I've created many custom packages in a custom feed and I know how to use custom feeds.

However, nowhere does the documentation address creating a BUILD TARGET, not a user package. My point is that the build system, even though it seems to parse a Makefile for a build target, doesn't seem to include it in the menuconfig as a target. If you knew enough about the build system (which clearly you don't from your remark about tmp and files folders, you would know that this is where the metadata from the packages and feeds is stored.

I suggest you avoid replying to threads where you clearly don't have any information. Perhaps you're the one who is tired of thinking?

dl12345 wrote:

What is it about the anonymity of a forum that allows people like you to think they can insult others with impunity?

First of all I'm not anonym, you maybe find my real name here.

Second, If you feel offended from my post it's your problem.
If I will insult people, I will call them bad names and other things.
And if you call me bad names, I don't care and think about my fault.
Because I've done/ask some stupid action/question and I must have know it better. This thing is called learning by the hard way (tm).

Third you are messing up with feeds and "base" system.

feeds are *only* seen as add on to the base system, with the TARGET from the base system.
You can't switch the TARGET in feeds. The base system is responsible for creating the right toolchain for the TARGET.

I don't know/care if this is here documented or not
because if you do

ls target/linux/

you see the targets in OpenWRT and this is *my* first place to look.
Obviously because of the name

dl12345 wrote:

If you knew enough about the build system (which clearly you don't from your remark about tmp and files folders, you would know that this is where the metadata from the packages and feeds is stored.

I don't look into the tmp files this is a complete waste of time.
It's only needed for people messing around with the buildsystem itself.
Not for creating a new TARGET.
If your TARGET doesn't shows up the problem is not in tmp

So if you want to create a new TARGET do this in
/target/linux
Use some TARGET with the same ARCH as your new TARGET as sample

elektroman wrote:

Third you are messing up with feeds and "base" system.

feeds are *only* seen as add on to the base system, with the TARGET from the base system.
You can't switch the TARGET in feeds. The base system is responsible for creating the right toolchain for the TARGET.

Incorrect. Targets in the feeds folder are "seen" by the build system. They are correctly parsed. An examination of the metadata in the feeds folder will show this to be the case. Hence my original question: if targets are not meant to be added via feeds, then why are they parsed out and metadata inserted into the feeds folder. This is a reasonable question.

elektroman wrote:

I don't look into the tmp files this is a complete waste of time.
It's only needed for people messing around with the buildsystem itself.
Not for creating a new TARGET.
If your TARGET doesn't shows up the problem is not in tmp

See above. My question is about the build system itself. This seems to have escaped you, since you pointed out that "It's only needed for people messing around with the buildsystem itself". Precisely.

elektroman wrote:

So if you want to create a new TARGET do this in
/target/linux
Use some TARGET with the same ARCH as your new TARGET as sample

Obviously. But this is not very portable, especially if you want to package the target up for other people to use. For my own personal use, it's a no-brainer. I'm trying to create a new build target for an unsupported platform that is easy for other people to use. Hence a desire to use a feed that integrates seamlessly.

Since you've nothing to contribute beyond what I already know, thanks for your input and suggest you move on to another topic.

dl12345 wrote:

Incorrect. Targets in the feeds folder are "seen" by the build system. They are correctly parsed. An examination of the metadata in the feeds folder will show this to be the case. Hence my original question: if targets are not meant to be added via feeds, then why are they parsed out and metadata inserted into the feeds folder. This is a reasonable question.

Yes for the build of a package in feeds.
Think about crosscompile an external kernel module or another tools.
Some buildsystems export *all* data to the lower buildsystem hence feeds.
Maybe they need some symbols or other things here.
If you have done some crosscompile by hand you will know.
This is hard stuff, you have to cheat autoconf/automake

The *real* (technical) reason why you can't add a new target in feeds is crosscompile.
If you create a crosscompiler for $TARGET this one a only run on $TARGET.
So if you add $NEW_TARGET to feeds the build system will use the crosscompiler
from $TARGET to build a new one for $NEW_TARGET and will crash

For more deeper understanding this site may help
http://www.linuxfromscratch.org/
Look for crosscompile

elektroman wrote:

Yes for the build of a package in feeds.
Think about crosscompile an external kernel module or another tools.
Some buildsystems export *all* data to the lower buildsystem hence feeds.
Maybe they need some symbols or other things here.
If you have done some crosscompile by hand you will know.
This is hard stuff, you have to cheat autoconf/automake

The *real* (technical) reason why you can't add a new target in feeds is crosscompile.
If you create a crosscompiler for $TARGET this one a only run on $TARGET.
So if you add $NEW_TARGET to feeds the build system will use the crosscompiler
from $TARGET to build a new one for $NEW_TARGET and will crash

For more deeper understanding this site may help
http://www.linuxfromscratch.org/
Look for crosscompile

I've been using Linux and tinkering with kernel code since it first came out in 1991. I've ported external kernel modules to openwrt and at one stage a number of years ago was an optware developer. I'm sure your "linuxfromscratch" link will come in really handy for me.....

For anyone searching for information on this topic, the correct answer is is YES, you can add a new target via a feed.

The perl script "scripts/feeds" has a fair amount of code to allow for the adding of targets via a feed (hence the creation of the metadata referred to above), although it seems to be sensitive to existing metadata. If experiencing trouble with the addition of a new target, it's a good idea to uninstall all feeds first and clear the metadata contents of the openwrt tmp folder as follows...

[openwrt@openwrt-host openwrt]$ scripts/feeds uninstall -a
[openwrt@openwrt-host openwrt]$ rm -fr tmp/*

Once I did this I was able to install my target successfully using

[openwrt@openwrt-host openwrt]$ scripts/feeds update <feedname>
[openwrt@openwrt-host openwrt]$ scripts/feeds install -p <feedname> -f <targetname>

The target name then shows up in menuconfig after the feeds script creates a link in target/linux to the feeds folder containing the target definition. Targets in a feed will be prefixed with the word "TARGET: " when issuing a "list" command on the feed

[openwrt@openwrt-host openwrt]$ scripts/feeds list -r <feedname>
TARGET: <name>                                        Target description

@elektroman - suggest you go back to your linuxfromscratch and that you confine your forum comments to subjects that you actually know something about. In this case, you were not only wrong, but you also managed to be both patronising and offensive.

The discussion might have continued from here.