summaryrefslogtreecommitdiffstats
path: root/meta/classes/useradd.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/useradd.bbclass')
-rw-r--r--meta/classes/useradd.bbclass29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 0a6f2be0d4..ee402acef1 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -127,6 +127,35 @@ useradd_sysroot_sstate () {
127 fi 127 fi
128} 128}
129 129
130userdel_sysroot_sstate () {
131if test "x${STAGING_DIR_TARGET}" != "x"; then
132 if [ "${BB_CURRENTTASK}" = "configure" -o "${BB_CURRENTTASK}" = "clean" ]; then
133 export PSEUDO="${FAKEROOTENV} PSEUDO_LOCALSTATEDIR=${STAGING_DIR_TARGET}${localstatedir}/pseudo ${STAGING_DIR_NATIVE}${bindir}/pseudo"
134 OPT="--root ${STAGING_DIR_TARGET}"
135
136 # Remove groups and users defined for package
137 GROUPADD_PARAM="${@get_all_cmd_params(d, 'groupadd')}"
138 USERADD_PARAM="${@get_all_cmd_params(d, 'useradd')}"
139
140 if test "x`echo $USERADD_PARAM | tr -d '[:space:]'`" != "x"; then
141 user=`echo "$USERADD_PARAM" | cut -d ';' -f 1 | awk '{ print $NF }'`
142 perform_userdel "${STAGING_DIR_TARGET}" "$OPT $user"
143 fi
144
145 if test "x`echo $GROUPADD_PARAM | tr -d '[:space:]'`" != "x"; then
146 group=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1 | awk '{ print $NF }'`
147 perform_groupdel "${STAGING_DIR_TARGET}" "$OPT $group"
148 fi
149
150 fi
151fi
152}
153
154SSTATECLEANFUNCS = "userdel_sysroot_sstate"
155SSTATECLEANFUNCS_class-cross = ""
156SSTATECLEANFUNCS_class-native = ""
157SSTATECLEANFUNCS_class-nativesdk = ""
158
130do_install[prefuncs] += "${SYSROOTFUNC}" 159do_install[prefuncs] += "${SYSROOTFUNC}"
131SYSROOTFUNC = "useradd_sysroot" 160SYSROOTFUNC = "useradd_sysroot"
132SYSROOTFUNC_class-cross = "" 161SYSROOTFUNC_class-cross = ""