meta-nicole: Add default account for administrator

Creates default administrative account for managing the OpenBMC.

(From meta-yadro rev: 7eef85ee0d2e6f8100c06c0f9a9cb52c941ecd50)

Signed-off-by: Artem Senichev <a.senichev@yadro.com>
Change-Id: If4aa85ace08c9628e98252f00c508fbf28385c9b
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-yadro/meta-nicole/recipes-phosphor/users/admin-account.bb b/meta-yadro/meta-nicole/recipes-phosphor/users/admin-account.bb
new file mode 100644
index 0000000..d94952e
--- /dev/null
+++ b/meta-yadro/meta-nicole/recipes-phosphor/users/admin-account.bb
@@ -0,0 +1,38 @@
+SUMMARY = "Default administrative account"
+DESCRIPTION = "Creating default account for system administrator"
+PR = "r1"
+
+inherit useradd
+
+# License info
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+# Dependencies
+DEPENDS = "sudo \
+           phosphor-ipmi-host \
+           phosphor-user-manager"
+
+# Groups
+GROUP_ADMIN = "priv-admin"
+GROUP_OPERATOR = "priv-operator"
+GROUP_USER = "priv-user"
+GROUP_IPMI = "ipmi"
+GROUP_SUDO = "sudo"
+
+# Default administrative account (login: admin, password: admin)
+ADMIN_LOGIN = "admin"
+ADMIN_PASSW = "\$1\$Fze0kFe8\$sylEANC01t.osF8OewyB/1"
+USERADD_PACKAGES = "${PN}"
+USERADD_PARAM_${PN} = "--gid ${GROUP_ADMIN} \
+                       --groups ${GROUP_ADMIN},${GROUP_OPERATOR},${GROUP_USER},${GROUP_IPMI},${GROUP_SUDO} \
+                       --password '${ADMIN_PASSW}' \
+                       ${ADMIN_LOGIN}"
+
+# We don't have package body
+ALLOW_EMPTY_${PN} = "1"
+
+# Workaround for meta-phosphor/classes/phosphor-rootfs-postcommands.bbclass.
+# The bb-script cannot add root to non-empty groups (invalid sed command).
+GROUPMEMS_PARAM_${PN} = "-a root -g ${GROUP_ADMIN}; \
+                         -a root -g ${GROUP_IPMI}"