summaryrefslogtreecommitdiffstats
path: root/meta/classes/useradd.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-15 22:42:03 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-30 00:02:22 +0100
commit065ca6b7b04d6153e8d53aeda0e93a488e3c81e9 (patch)
tree9564089f8d7bd68a28b16f75f3693aaf6a793209 /meta/classes/useradd.bbclass
parent09ac5229955a5f26c7d70577fd94faa2d5b2f551 (diff)
downloadpoky-065ca6b7b04d6153e8d53aeda0e93a488e3c81e9.tar.gz
useradd: Ensure preinst data is expanded correctly in pkgdata
The preinst data in pkgdata will not expand out the ${XXX_PARAM} variables since they don't use a package suffix. It happens that the final expansion used for the packages is corrected by a second trip through the datastore. The first version is used for calculation of the task output hash and recent improvements in hash reuse showed this data wasn't using included in the hashes, meaning for example builds with dynamic IDs were mixing sstate with builds using static IDs. The result was a mess. Fix this by expanding the data in the preinst correctly to use the package specific _PARAM values. (From OE-Core rev: fbd5a1f877d805d810562985c7a5dac4a5761263) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 375430f249e7e0b6622e566e2478b40ba7e606ab) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/useradd.bbclass')
-rw-r--r--meta/classes/useradd.bbclass4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index e5f3ba24f9..0f0ed3446d 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -230,6 +230,10 @@ fakeroot python populate_packages_prepend () {
230 preinst += 'perform_useradd () {\n%s}\n' % d.getVar('perform_useradd') 230 preinst += 'perform_useradd () {\n%s}\n' % d.getVar('perform_useradd')
231 preinst += 'perform_groupmems () {\n%s}\n' % d.getVar('perform_groupmems') 231 preinst += 'perform_groupmems () {\n%s}\n' % d.getVar('perform_groupmems')
232 preinst += d.getVar('useradd_preinst') 232 preinst += d.getVar('useradd_preinst')
233 # Expand out the *_PARAM variables to the package specific versions
234 for rep in ["GROUPADD_PARAM", "USERADD_PARAM", "GROUPMEMS_PARAM"]:
235 val = d.getVar(rep + "_" + pkg) or ""
236 preinst = preinst.replace("${" + rep + "}", val)
233 d.setVar('pkg_preinst_%s' % pkg, preinst) 237 d.setVar('pkg_preinst_%s' % pkg, preinst)
234 238
235 # RDEPENDS setup 239 # RDEPENDS setup