[OE-core] [PATCH] systemd: fix useradd parameter generation

Enrico Joerns ejo at pengutronix.de
Tue Aug 9 08:24:03 UTC 2016


On 08/09/2016 07:17 AM, Anders Darander wrote:
> * Enrico Jorns <ejo at pengutronix.de> [160808 15:55]:
>> Constructing the USERADD_PARAM_${PN} value with += (as done before)
>> resulted in having a whitespace added for each entry not having its
>> PACKAGECONFIG parameter activated.
>
>> This is not only a cosmetical issue. The useradd class concatenates all
>> useradd commands from all subpackages of a package by doing a
>> ";".join(). When having a useradd command that ends with ";" and some
>> extra spaces, concatenation will result in an empty useradd argument
>> ("commandA;    ;commandB"). The useradd command will be called with this
>> and make the Yocto build break by returning an error code.
>
>> Fortunately, there is no problem when having a "commandA;;commandB" in
>> the useradd string, this will be ignored. Thus using "_append" instead of
>> "+=" is sufficient here.
>
> NAK
>
> Fix useradd.bbclass instead. Otherwise, the same issue will happen with
> other recipes. Having a single variable, that you're not allowed to use
> the normal way to add to, would be more confusing. Personally, I would
> find it hard to rember that I need to use .= for USERADD_PARAM...

Yes, I did not have .= in mind when creating this solution, but this 
would be the better approach.
Nevertheless, I also prefer a more general solution, but was not sure 
about how it could look like. Maybe I've found one now.

So, forget about this patch, I will post a useradd class patch in a 
separate thread instead.

Regards, Enrico

-- 
Pengutronix e.K.                           | Enrico Jörns                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-5080 |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |




More information about the Openembedded-core mailing list