All of lore.kernel.org
 help / color / mirror / Atom feed
* add a user via recipe
@ 2014-12-01  8:46 Matthias.Heise
  2014-12-01  9:43 ` ChenQi
  0 siblings, 1 reply; 4+ messages in thread
From: Matthias.Heise @ 2014-12-01  8:46 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 704 bytes --]

Hi there,

I'm still trying to add a user via recipe. The method with

inherit extrausers
EXTRA_USER_PARAMS = "useradd -p '\$6\$53uYm/0Fnll\$Nc0RbHSvqRrd63Tw98TO3V1n25ORK9oR4QHqRIriXzLy0il/7.LIacX7mz7RJ1tdPIWiCJLNyQa7dKBNURqEg1' fstuser;"

Does not work (no errors just no user in image), as well as this :

ROOTFS_POSTPROCESS_COMMAND += "add_a_user;"

add_a_user(){
     useradd -p '\$6\$53uYm/0Fnll\$Nc0RbHSvqRrd63Tw98TO3V1n25ORK9oR4QHqRIriXzLy0il/7.LIacX7mz7RJ1tdPIWiCJLNyQa7dKBNURqEg1' fstuser;
}

Which results in an error during bitbake :
useradd: /etc/passwd.23966: Permission denied
useradd cannot lock /etc/passwd; try again later

any ideas to that ?
thanks,
regards
Mat

[-- Attachment #2: Type: text/html, Size: 4094 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: add a user via recipe
  2014-12-01  8:46 add a user via recipe Matthias.Heise
@ 2014-12-01  9:43 ` ChenQi
  2014-12-01 12:19   ` Matthias.Heise
  2014-12-01 12:41   ` Matthias.Heise
  0 siblings, 2 replies; 4+ messages in thread
From: ChenQi @ 2014-12-01  9:43 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

On 12/01/2014 04:46 PM, Matthias.Heise@atlas-elektronik.com wrote:
>
> Hi there,
>
> I’m still trying to add a user via recipe. The method with
>
> inherit extrausers
>
> EXTRA_USER_PARAMS = "useradd -p 
> '\$6\$53uYm/0Fnll\$Nc0RbHSvqRrd63Tw98TO3V1n25ORK9oR4QHqRIriXzLy0il/7.LIacX7mz7RJ1tdPIWiCJLNyQa7dKBNURqEg1' 
> fstuser;"
>

EXTRA_USERS_PARAMS instead of EXTRA_USER_PARAMS

Also, clear password is supported. E.g.
EXTRA_USERS_PARAMS = "useradd -P 'hello' tester;"

> Does not work (no errors just no user in image), as well as this :
>
> ROOTFS_POSTPROCESS_COMMAND += "add_a_user;"
>
> add_a_user(){
>
>      useradd -p 
> '\$6\$53uYm/0Fnll\$Nc0RbHSvqRrd63Tw98TO3V1n25ORK9oR4QHqRIriXzLy0il/7.LIacX7mz7RJ1tdPIWiCJLNyQa7dKBNURqEg1' 
> fstuser;
>
> }
>
> Which results in an error during bitbake :
>
> useradd: /etc/passwd.23966: Permission denied
>
> useradd cannot lock /etc/passwd; try again later
>

You need to pass '--root xxx' option to it.

//Chen Qi

> any ideas to that ?
>
> thanks,
>
> regards
>
> Mat
>
>
>


[-- Attachment #2: Type: text/html, Size: 5795 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: add a user via recipe
  2014-12-01  9:43 ` ChenQi
@ 2014-12-01 12:19   ` Matthias.Heise
  2014-12-01 12:41   ` Matthias.Heise
  1 sibling, 0 replies; 4+ messages in thread
From: Matthias.Heise @ 2014-12-01 12:19 UTC (permalink / raw)
  To: Qi.Chen, yocto

[-- Attachment #1: Type: text/plain, Size: 1602 bytes --]

Hi ChenQui,

thanks very much for your reply, the ROOTFS_POSTPROCESS_COMMAND does work now with
"useradd -root ${IMAGE_ROOTFS} -p ..... " as you suggested

However with the EXTRA_USERS_PARAMS the user is now added (thanks to the removed typo) but I can't add a valid password, neither encrypted nor cleartext, with or without <'  ' > around it


Von: yocto-bounces@yoctoproject.org [mailto:yocto-bounces@yoctoproject.org] Im Auftrag von ChenQi
Gesendet: Montag, 1. Dezember 2014 10:43
An: yocto@yoctoproject.org
Betreff: Re: [yocto] add a user via recipe

On 12/01/2014 04:46 PM, Matthias.Heise@atlas-elektronik.com<mailto:Matthias.Heise@atlas-elektronik.com> wrote:
Hi there,

I'm still trying to add a user via recipe. The method with

inherit extrausers
EXTRA_USER_PARAMS = "useradd -p '\$6\$53uYm/0Fnll\$Nc0RbHSvqRrd63Tw98TO3V1n25ORK9oR4QHqRIriXzLy0il/7.LIacX7mz7RJ1tdPIWiCJLNyQa7dKBNURqEg1' fstuser;"


EXTRA_USERS_PARAMS instead of EXTRA_USER_PARAMS

Also, clear password is supported. E.g.
EXTRA_USERS_PARAMS = "useradd -P 'hello' tester;"

Does not work (no errors just no user in image), as well as this :

ROOTFS_POSTPROCESS_COMMAND += "add_a_user;"

add_a_user(){
     useradd -p '\$6\$53uYm/0Fnll\$Nc0RbHSvqRrd63Tw98TO3V1n25ORK9oR4QHqRIriXzLy0il/7.LIacX7mz7RJ1tdPIWiCJLNyQa7dKBNURqEg1' fstuser;
}

Which results in an error during bitbake :
useradd: /etc/passwd.23966: Permission denied
useradd cannot lock /etc/passwd; try again later


You need to pass '--root xxx' option to it.

//Chen Qi


any ideas to that ?
thanks,
regards
Mat




[-- Attachment #2: Type: text/html, Size: 7273 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: add a user via recipe
  2014-12-01  9:43 ` ChenQi
  2014-12-01 12:19   ` Matthias.Heise
@ 2014-12-01 12:41   ` Matthias.Heise
  1 sibling, 0 replies; 4+ messages in thread
From: Matthias.Heise @ 2014-12-01 12:41 UTC (permalink / raw)
  To: Qi.Chen, yocto

[-- Attachment #1: Type: text/plain, Size: 1528 bytes --]

Ok, the EXTRA_USERS_PARAMS method now also works, it was the typo with USER and USERS and an encrypted password with '  ' around it which is needed, strangely the encrypted string for one and the same password all of a sudden was different, after re-generating it, it worked

Von: yocto-bounces@yoctoproject.org [mailto:yocto-bounces@yoctoproject.org] Im Auftrag von ChenQi
Gesendet: Montag, 1. Dezember 2014 10:43
An: yocto@yoctoproject.org
Betreff: Re: [yocto] add a user via recipe

On 12/01/2014 04:46 PM, Matthias.Heise@atlas-elektronik.com<mailto:Matthias.Heise@atlas-elektronik.com> wrote:
Hi there,

I'm still trying to add a user via recipe. The method with

inherit extrausers
EXTRA_USER_PARAMS = "useradd -p '\$6\$53uYm/0Fnll\$Nc0RbHSvqRrd63Tw98TO3V1n25ORK9oR4QHqRIriXzLy0il/7.LIacX7mz7RJ1tdPIWiCJLNyQa7dKBNURqEg1' fstuser;"


EXTRA_USERS_PARAMS instead of EXTRA_USER_PARAMS

Also, clear password is supported. E.g.
EXTRA_USERS_PARAMS = "useradd -P 'hello' tester;"


Does not work (no errors just no user in image), as well as this :

ROOTFS_POSTPROCESS_COMMAND += "add_a_user;"

add_a_user(){
     useradd -p '\$6\$53uYm/0Fnll\$Nc0RbHSvqRrd63Tw98TO3V1n25ORK9oR4QHqRIriXzLy0il/7.LIacX7mz7RJ1tdPIWiCJLNyQa7dKBNURqEg1' fstuser;
}

Which results in an error during bitbake :
useradd: /etc/passwd.23966: Permission denied
useradd cannot lock /etc/passwd; try again later


You need to pass '--root xxx' option to it.

//Chen Qi


any ideas to that ?
thanks,
regards
Mat




[-- Attachment #2: Type: text/html, Size: 6562 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-01 12:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-01  8:46 add a user via recipe Matthias.Heise
2014-12-01  9:43 ` ChenQi
2014-12-01 12:19   ` Matthias.Heise
2014-12-01 12:41   ` Matthias.Heise

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.