[OE-core] [PATCH 1/5] useradd.bbclass: Strip trailing '; ' in cmd params

Khem Raj raj.khem at gmail.com
Wed May 18 19:38:04 UTC 2016


This fix was not sufficient and there has to be extra fix done to also
consider the case
when sysroot is created during image build time. I have updated it in
pull request here

http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/pu&id=642c6cf0b6a0371de476513162bd0cefa9c438b3

On Tue, May 17, 2016 at 9:40 PM, Khem Raj <raj.khem at gmail.com> wrote:
> When there are more than 1 packages in a recipe requiring useradd
> services, they are concatnated and a ';' is inserted just after
> each of the users being added by the packages. A situation arises
> in cases where this is controlled by PACKAGECONFIG then we add a
> ';' separator in the USERADD_PARAM value itself for each packagecofig
> since we do not know which one will be picked, we end up in situation
> where the final string returned from get_all_cmd_params() appears to be
>
> a; ; b; c;
>
> and then the logic which uses these cmds triggers with ';' as separator
> but in this case it will fail after executing useradd 'a' because the next
> cmd it will call will be just a whitespace
>
> This is highlighted by the systemd patch to add more users as needed
> by systemd 229 components.
>
> Signed-off-by: Khem Raj <raj.khem at gmail.com>
> ---
>  meta/classes/useradd.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
> index ee402ac..ae27c01 100644
> --- a/meta/classes/useradd.bbclass
> +++ b/meta/classes/useradd.bbclass
> @@ -203,7 +203,7 @@ def get_all_cmd_params(d, cmd_type):
>      for pkg in useradd_packages.split():
>          param = d.getVar(param_type % pkg, True)
>          if param:
> -            params.append(param)
> +            params.append(param.rstrip(" ;"))
>
>      return "; ".join(params)
>
> --
> 2.8.2
>



More information about the Openembedded-core mailing list