diff options
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/sstate.bbclass | 5 | ||||
-rw-r--r-- | meta/classes/useradd.bbclass | 29 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 6f285da6b4..3234e7914c 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass | |||
@@ -51,6 +51,7 @@ SSTATEPREINSTFUNCS = "" | |||
51 | SSTATEPOSTUNPACKFUNCS = "sstate_hardcode_path_unpack" | 51 | SSTATEPOSTUNPACKFUNCS = "sstate_hardcode_path_unpack" |
52 | SSTATEPOSTINSTFUNCS = "" | 52 | SSTATEPOSTINSTFUNCS = "" |
53 | EXTRA_STAGING_FIXMES ?= "" | 53 | EXTRA_STAGING_FIXMES ?= "" |
54 | SSTATECLEANFUNCS = "" | ||
54 | 55 | ||
55 | SIGGEN_LOCKEDSIGS_CHECK_LEVEL ?= 'error' | 56 | SIGGEN_LOCKEDSIGS_CHECK_LEVEL ?= 'error' |
56 | 57 | ||
@@ -444,6 +445,10 @@ def sstate_clean(ss, d): | |||
444 | stfile.endswith(rm_nohash): | 445 | stfile.endswith(rm_nohash): |
445 | oe.path.remove(stfile) | 446 | oe.path.remove(stfile) |
446 | 447 | ||
448 | # Removes the users/groups created by the package | ||
449 | for cleanfunc in (d.getVar('SSTATECLEANFUNCS', True) or '').split(): | ||
450 | bb.build.exec_func(cleanfunc, d) | ||
451 | |||
447 | sstate_clean[vardepsexclude] = "SSTATE_MANFILEPREFIX" | 452 | sstate_clean[vardepsexclude] = "SSTATE_MANFILEPREFIX" |
448 | 453 | ||
449 | CLEANFUNCS += "sstate_cleanall" | 454 | CLEANFUNCS += "sstate_cleanall" |
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 | ||
130 | userdel_sysroot_sstate () { | ||
131 | if 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 | ||
151 | fi | ||
152 | } | ||
153 | |||
154 | SSTATECLEANFUNCS = "userdel_sysroot_sstate" | ||
155 | SSTATECLEANFUNCS_class-cross = "" | ||
156 | SSTATECLEANFUNCS_class-native = "" | ||
157 | SSTATECLEANFUNCS_class-nativesdk = "" | ||
158 | |||
130 | do_install[prefuncs] += "${SYSROOTFUNC}" | 159 | do_install[prefuncs] += "${SYSROOTFUNC}" |
131 | SYSROOTFUNC = "useradd_sysroot" | 160 | SYSROOTFUNC = "useradd_sysroot" |
132 | SYSROOTFUNC_class-cross = "" | 161 | SYSROOTFUNC_class-cross = "" |