[OpenWrt-Devel] Some questions - help needed

Adrian Schmutzler mail at adrianschmutzler.de
Tue Feb 25 07:41:52 EST 2020


Hi,

> -----Original Message-----
> From: mans0n at gorani.run [mailto:mans0n at gorani.run]
> Sent: Samstag, 22. Februar 2020 16:29
> To: mail at adrianschmutzler.de; openwrt-devel at lists.openwrt.org
> Subject: Re: [OpenWrt-Devel] Some questions - help needed
> 
> On 20. 2. 22. 9:48 PM, mail at adrianschmutzler.de wrote:
> > to make a variable "per-device", you have to add it to DEVICE_VARS, e.g.
> > DEVICE_VARS += DEVICE_TYPE
> 
> I've tried it, but it did not work. DEVICE_VARS is used in include/image.mk but
> DEVICE_TYPE is used in include/target.mk, I guess that is the cause.

The different files shouldn't be the problem, but if you have added DEVICE_TYPE to DEVICE_VARS, every device will need to have it set. Those which do not have a DEVICE_TYPE of their own will just take over the DEVICE_TYPE of the previous device (!), so setting it for one device will effectively also set it
for all the others after it.

The default DEVICE_TYPE in target.mk then will most probably only work for those devices before the first per-device definition. So, if you chose to have DEVICE_TYPE per-device, you will have to add it to Device/Default definitions in all targets using it, as this will then provide a real per-device default value in contrast to the situation just described.

Note that this just describes how DEVICE_VARS works, I have not had a look into what DEVICE_TYPE actually does.

Best

Adrian

> 
> It seems "DEVICE_TYPE:=nas" does two things:
> 1. add more packages to DEFAULT_PACKAGES
> 2. add hdparm in busybox
> The first one might be done in a device-specific way, but I'm not sure about the
> second one...
> 
> > I've once tried to solve this for the same problem but with kmod-i2c-core IIRC,
> > and then quit at some point because I couldn't find the initial source of the
> problem.
> 
> I found it: i2c-gpio-custom. If I remove the package directory, all i2c packages
> are nested now. Maybe scripts/package-metadata.pl has some bugs? But it's not
> the
> main topic here.
> 
> I replaced all "DEPENDS:=kmod-i2c-core" with "DEPENDS:=+kmod-i2c-core", and
> removed
> unnecessary kmod-i2c-core in DEVICE_PACKAGES. And build test (on ramips) was
> successful.
> So I think I can provide a patch for it (though it needs more build tests).
> 
> But what I'm wondering is, how far will we go? Can we add "+" to all kernel
> packages (unless it leads to a dependency error)? If "select" alone is enough,
> then why do we also use "depends on"?


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list