meta-stx: re-name and re-org to align with upstream
[pti/rtp.git] / meta-starlingx / meta-stx-distro / classes / extrausers-config.bbclass
diff --git a/meta-starlingx/meta-stx-distro/classes/extrausers-config.bbclass b/meta-starlingx/meta-stx-distro/classes/extrausers-config.bbclass
new file mode 100644 (file)
index 0000000..ff5e249
--- /dev/null
@@ -0,0 +1,23 @@
+
+# This bbclass creates users based on EXTRA_USER_PARAMS through
+# extrausers bbclass and is intended to take config options for 
+# configuring users uniq environment.
+
+inherit extrausers
+
+
+PACKAGE_INSTALL_append = " ${@['', 'base-passwd shadow'][bool(d.getVar('EXTRA_USERS_PARAMS_CONFIG'))]}"
+
+ROOTFS_POSTPROCESS_COMMAND_append = " set_user_group_config;"
+
+set_user_group_config () {
+
+# FIXME: parse EXTRA_USERS_PARAMS_CONFIG for options
+       
+       EXTRA_USERS_PARAMS=" ${EXTRA_USERS_PARAMS_CONFIG}"
+       set_user_group
+
+       #Extend path variable for sysadmin
+       echo 'PATH=/sbin:/usr/sbin:$PATH' >> ${IMAGE_ROOTFS}/home/sysadmin/.bashrc
+       chown sysadmin:sys_protected ${IMAGE_ROOTFS}/home/sysadmin/.bashrc
+}