summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorQuentin Schulz <quentin.schulz@theobroma-systems.com>2022-02-18 17:49:50 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-03-04 09:39:37 +0000
commit0966ba1ebb5ca9feb60eb41316a9abc5d242ffe8 (patch)
tree781556ed2d095282b6029115b54747ab120698f7 /documentation
parent61ee42131cdbfb1a7eb3405008317f9bb8d25ca1 (diff)
downloadpoky-0966ba1ebb5ca9feb60eb41316a9abc5d242ffe8.tar.gz
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>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/ref-manual/classes.rst7
1 files changed, 3 insertions, 4 deletions
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index bf39d5e4cc..03dd375776 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -574,12 +574,11 @@ Here is an example that uses this class in an image recipe::
574 " 574 "
575 575
576Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns 576Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns
577passwords. First on host, create the password hash:: 577passwords. First on host, create the (escaped) password hash::
578 578
579 mkpasswd -m sha256crypt tester01 579 printf "%q" $(mkpasswd -m sha256crypt tester01)
580 580
581The resulting hash is set to a variable and used in ``useradd`` command parameters. 581The resulting hash is set to a variable and used in ``useradd`` command parameters::
582Remember to escape the character ``$``::
583 582
584 inherit extrausers 583 inherit extrausers
585 PASSWD = "\$X\$ABC123\$A-Long-Hash" 584 PASSWD = "\$X\$ABC123\$A-Long-Hash"