[LEDE-DEV] [PATCH 1/5] base-files: introduce /lib/functions/board.sh

Roman Yeryomin leroi.lists at gmail.com
Mon May 1 15:30:42 PDT 2017


On 30 April 2017 at 12:44, Felix Fietkau <nbd at nbd.name> wrote:
> On 2017-04-30 11:23, Bastian Bittorf wrote:
>> * Felix Fietkau <nbd at nbd.name> [30.04.2017 09:30]:
>>> > +board_name()
>>> > +{
>>> > +  sysinfo board_name
>>> > +}
>>> > +
>>> > +board_model()
>>> > +{
>>> > +  sysinfo model
>>> > +}
>>
>>> Do we really need board_model() at all? I think it's better to leave the
>>> board_name() function where it is instead of adding this extra include file.
>>
>> the difference is that:
>>
>> # root at box:~ cat /tmp/sysinfo/model
>> # TP-Link TL-WDR4300 v1
>> # root at box:~ cat /tmp/sysinfo/board_name
>> # tl-wdr4300
>>
>> we use 'model' e.g. for our monitoring.
> Right, but you don't need that shell function in a separate include
> file. For your purposes, you can simply use 'cat
> /tmp/sysinfo/board_name' in your script.
>

simply `cat` (and check for file and NULL) doesn't look good to me for
a generic "api"



More information about the Lede-dev mailing list