[2/2] image-account-extension: Move examples to user manual

Message ID 20240130101506.27451-3-ubely@ilbers.de
State Accepted, archived
Headers show
Series Updates in the documentation | expand

Commit Message

Uladzimir Bely Jan. 30, 2024, 10:15 a.m. UTC
Based on discussion in https://github.com/ilbers/isar/issues/103

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 doc/user_manual.md                           | 22 ++++++++++++++++++++
 meta/classes/image-account-extension.bbclass | 18 ----------------
 2 files changed, 22 insertions(+), 18 deletions(-)

Patch

diff --git a/doc/user_manual.md b/doc/user_manual.md
index 27b86869..747b5ffe 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -700,6 +700,28 @@  The `USERS` and `USER:<username>` variable works similar to the `GROUPS` and `GR
    - `clear-text-password` - The `password` flag of the given user contains a clear-text password and not an encrypted version of it.
    - `force-passwd-change` - Force the user to change to password on first login.
 
+#### Example
+
+```
+GROUPS += "root"
+GROUP_root[gid] = "0"
+GROUP_root[flags] = "system"
+
+USERS += "root"
+USER_root[password] = "$6$rounds=10000$RXeWrnFmkY$DtuS/OmsAS2cCEDo0BF5qQsizIrq6jPgXnwv3PHqREJeKd1sXdHX/ayQtuQWVDHe0KIO0/sVH8dvQm1KthF0d/"
+USER_root[expire] = "180"
+USER_root[inactive] = "30"
+USER_root[uid] = "0"
+USER_root[gid] = "0"
+USER_root[comment] = "The ultimate root user"
+USER_root[home] = "/home/root"
+USER_root[shell] = "/bin/sh"
+USER_root[groups] = "audio video"
+USER_root[flags] = "create-home system force-passwd-change"
+```
+
+Some examples can be also found in `meta-isar/conf/local.conf.sample`.
+
 #### Home directory contents prefilling
 
 To cover all users simply use `/etc/skel`. Files in there will be available in every home directory under correct permissions.
diff --git a/meta/classes/image-account-extension.bbclass b/meta/classes/image-account-extension.bbclass
index 412aa06d..9e67cb91 100644
--- a/meta/classes/image-account-extension.bbclass
+++ b/meta/classes/image-account-extension.bbclass
@@ -6,26 +6,8 @@ 
 # This class extends the image.bbclass for creating user accounts and groups.
 
 USERS ??= ""
-
-#USERS += "root"
-#USER_root[password] = "" # Encrypted password, or clear-text when [flags] = "clear-text-password"
-#USER_root[expire] = ""
-#USER_root[inactive] = ""
-#USER_root[uid] = ""
-#USER_root[gid] = "" # If first character is a number: gid, otherwise groupname
-#USER_root[comment] = "The ultimate root user"
-#USER_root[home] = "/home/root"
-#USER_root[shell] = "/bin/sh"
-#USER_root[groups] = "audio video"
-#USER_root[flags] = "no-create-home create-home system allow-empty-password clear-text-password force-passwd-change"
-
 GROUPS ??= ""
 
-#GROUPS += "root"
-#GROUP_root[gid] = ""
-#GROUP_root[flags] = "system"
-
-
 def image_create_groups(d: "DataSmart") -> None:
     """Creates the groups defined in the ``GROUPS`` bitbake variable.