ref-manual: classes: provide command with ready-to-use password

mkpasswd output requires to be escaped before being used as password in
a Bitbake variable. It was explicitly stated after the command, but to
be sure it's not missed, let's give the printf command which does escape
the string for us.

Cc: Quentin Schulz <foss+yocto@0leil.net>
(From yocto-docs rev: 13064e7bea18e999d4a294e298a7980a4dcbe69e)

Signed-off-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Quentin Schulz
2022-02-18 17:49:50 +01:00
committed by Richard Purdie
parent 61ee42131c
commit 0966ba1ebb

View File

@@ -574,12 +574,11 @@ Here is an example that uses this class in an image recipe::
"
Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns
passwords. First on host, create the password hash::
passwords. First on host, create the (escaped) password hash::
mkpasswd -m sha256crypt tester01
printf "%q" $(mkpasswd -m sha256crypt tester01)
The resulting hash is set to a variable and used in ``useradd`` command parameters.
Remember to escape the character ``$``::
The resulting hash is set to a variable and used in ``useradd`` command parameters::
inherit extrausers
PASSWD = "\$X\$ABC123\$A-Long-Hash"