summaryrefslogtreecommitdiff
path: root/meta-unit-core/recipes-users/useradd
diff options
context:
space:
mode:
Diffstat (limited to 'meta-unit-core/recipes-users/useradd')
-rw-r--r--meta-unit-core/recipes-users/useradd/add-user-svc.bb13
-rw-r--r--meta-unit-core/recipes-users/useradd/add-user-unitexe.bb13
2 files changed, 20 insertions, 6 deletions
diff --git a/meta-unit-core/recipes-users/useradd/add-user-svc.bb b/meta-unit-core/recipes-users/useradd/add-user-svc.bb
index b156019..3e2a8ca 100644
--- a/meta-unit-core/recipes-users/useradd/add-user-svc.bb
+++ b/meta-unit-core/recipes-users/useradd/add-user-svc.bb
@@ -6,16 +6,23 @@ EXCLUDE_FROM_WORLD = "1"
inherit useradd
inherit extrausers
-S = "${UNPACKDIR}"
-
+RDEPENDS:${PN}:append = " base-passwd"
+RDEPENDS:${PN}:append = " busybox"
RDEPENDS:${PN}:append = " shadow"
+RDEPENDS:${PN}:append = " systemd"
USERADD_PACKAGES = "${PN}"
USER_TO_ADD_NAME ?= "svc"
USER_TO_ADD_UID ?= "2000"
USER_TO_ADD_PASSWORD_HASHED ?= "\$6\$1TQs7iLskyTyCjoL\$xhngcFWaPRsoaZCwLSsYXUrRcVdR19zV2vBEzrzSEVu8zbqDlfKu4HLwzsZfiqJCiWqiu9qirD4Ym12CMf7D7."
+COMMA_SEPARATED_LIST_OF_GROUPS_TO_ADD_USER_TO ?= "systemd-journal"
-USERADD_PARAM:${PN} = "--uid ${USER_TO_ADD_UID} --home-dir /home/${USER_TO_ADD_NAME} --shell ${base_bindir}/sh --password '${USER_TO_ADD_PASSWORD_HASHED}' ${USER_TO_ADD_NAME}"
+USERADD_PARAM:${PN} = "-u ${USER_TO_ADD_UID} -d /home/${USER_TO_ADD_NAME} -s ${base_bindir}/sh -G ${COMMA_SEPARATED_LIST_OF_GROUPS_TO_ADD_USER_TO} -p '${USER_TO_ADD_PASSWORD_HASHED}' ${USER_TO_ADD_NAME}"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+# Prior to useradd being performed on the sysroot a couple things must happen:
+# 1. Need the systemd recipe to create the systemd-journal group
+# 2. Need busybox shell present
+do_prepare_recipe_sysroot[depends] += "systemd:do_populate_sysroot busybox:do_populate_sysroot"
diff --git a/meta-unit-core/recipes-users/useradd/add-user-unitexe.bb b/meta-unit-core/recipes-users/useradd/add-user-unitexe.bb
index 97f09f5..faa1d2a 100644
--- a/meta-unit-core/recipes-users/useradd/add-user-unitexe.bb
+++ b/meta-unit-core/recipes-users/useradd/add-user-unitexe.bb
@@ -6,18 +6,25 @@ EXCLUDE_FROM_WORLD = "1"
inherit useradd
inherit extrausers
-S = "${UNPACKDIR}"
-
+RDEPENDS:${PN}:append = " base-passwd"
+RDEPENDS:${PN}:append = " busybox"
RDEPENDS:${PN}:append = " sudo"
RDEPENDS:${PN}:append = " shadow"
RDEPENDS:${PN}:append = " ssh-authorized-keys"
+RDEPENDS:${PN}:append = " systemd"
USERADD_PACKAGES = "${PN}"
USER_TO_ADD_NAME ?= "unitexe"
USER_TO_ADD_UID ?= "1000"
USER_TO_ADD_PASSWORD_HASHED ?= "\$6\$esHchcEKubkj/1v7\$woeV0ChUqcC8J8lOEWB563mX4XRAvYJldGcU/I0Pzg1Nw9bBGOQoLmIsn0wU1gUzpysZr6R18xps5Cjn470Nv/"
+COMMA_SEPARATED_LIST_OF_GROUPS_TO_ADD_USER_TO ?= "systemd-journal"
-USERADD_PARAM:${PN} = "--uid ${USER_TO_ADD_UID} --home-dir /home/${USER_TO_ADD_NAME} --shell ${base_bindir}/sh --password '${USER_TO_ADD_PASSWORD_HASHED}' ${USER_TO_ADD_NAME}"
+USERADD_PARAM:${PN} = "-u ${USER_TO_ADD_UID} -d /home/${USER_TO_ADD_NAME} -s ${base_bindir}/sh -G ${COMMA_SEPARATED_LIST_OF_GROUPS_TO_ADD_USER_TO} -p '${USER_TO_ADD_PASSWORD_HASHED}' ${USER_TO_ADD_NAME}"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+
+# Prior to useradd being performed on the sysroot a couple things must happen:
+# 1. Need the systemd recipe to create the systemd-journal group
+# 2. Need busybox shell present
+do_prepare_recipe_sysroot[depends] += "systemd:do_populate_sysroot busybox:do_populate_sysroot"