Hi,

> -----Original Message-----
> From: openwrt-devel [mailto:[email protected]]
> On Behalf Of mans0n
> Sent: Samstag, 22. Februar 2020 13:25
> To: [email protected]
> Subject: [OpenWrt-Devel] Some questions - help needed
> 
> Hi,
> 
> I can't find the answers on my own, so I'm seeking help here. Any opinions
> would be appreciated.
> 
> 1. I found that currently four devices have set DEVICE_TYPE to nas in their
> Device definition.
> But when I tried defconfig, none of them actually had
> DEFAULT_PACKAGES.nas in their .config.
> It seems DEVICE_TYPE cannot be set per device, it only works on a per-
> (sub)target basis.
> Then why DEVICE_TYPE was added to these devices?
> https://github.com/openwrt/openwrt/commit/7a1497fd601d8803f60845034
> 4113db2bdc470e7
> Is this intended or a bug?

to make a variable "per-device", you have to add it to DEVICE_VARS, e.g.
DEVICE_VARS += DEVICE_TYPE

Based on a quick grep, I haven't found this anywhere.

If this is not done, the variable will have the state of the latest assignment 
for _all_ devices, i.e. the last device setting it will determine the value for 
all devices.

When looking through the targets, it seems like DEVICE_TYPE has been partially 
used target-wide and partially device-specifically, where the latter is a 
misuse IMO (or in your words, a "bug").

The easiest option would be to add this to DEVICE_VARS for all targets directly 
in include/target.mk. However, that would be a little shady as there the 
variable DEVICE_TYPE would still be set in a global context, while it is then 
overwritten per-device. In contrast, the classical case of a device-specific 
variable is DEVICE_DTS, where default values are not set globally in 
include/target.mk, but in Device/Default for each target separately (if 
required).

> 
> 2. kmod-usb2 automatically selects kmod-usb-core, but kmod-ata-ahci does
> not select kmod-ata-core.
> Is there a reason to use "DEPENDS += +kmod-usb-core" somewhere and use
> "DEPENDS += kmod-ata-core" elsewhere?
> Can we make a rule here to unify this?

This somehow depends on the organization of those options, where one is nested 
and the other isn't (in make menuconfig). 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.

From my point of view, you are very welcome to solve this mystery.

Best

Adrian

> 
> 3. Could somebody suggest a way to configure port 1 as WAN in ipq40xx DTS?
> https://forum.openwrt.org/t/how-can-i-configure-port-1-as-wan-on-
> ipq40xx/54783
> 
> Thanks in advance.
> 
> _______________________________________________
> openwrt-devel mailing list
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Attachment: openpgp-digital-signature.asc
Description: PGP signature

_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to