diff options
Diffstat (limited to 'meta/classes/useradd.bbclass')
-rw-r--r-- | meta/classes/useradd.bbclass | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass index 0f51e5522b..686e5fbefe 100644 --- a/meta/classes/useradd.bbclass +++ b/meta/classes/useradd.bbclass | |||
@@ -138,22 +138,19 @@ useradd_sysroot () { | |||
138 | EXTRA_STAGING_FIXMES += "COMPONENTS_DIR" | 138 | EXTRA_STAGING_FIXMES += "COMPONENTS_DIR" |
139 | 139 | ||
140 | python useradd_sysroot_sstate () { | 140 | python useradd_sysroot_sstate () { |
141 | scriptfile = None | ||
141 | task = d.getVar("BB_CURRENTTASK") | 142 | task = d.getVar("BB_CURRENTTASK") |
142 | if task == "package_setscene": | 143 | if task == "package_setscene": |
143 | bb.build.exec_func("useradd_sysroot", d) | 144 | bb.build.exec_func("useradd_sysroot", d) |
144 | elif task == "prepare_recipe_sysroot": | 145 | elif task == "prepare_recipe_sysroot": |
145 | # Used to update this recipe's own sysroot so the user/groups are available to do_install | 146 | # Used to update this recipe's own sysroot so the user/groups are available to do_install |
146 | scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}") | 147 | scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}") |
147 | bb.utils.mkdirhier(os.path.dirname(scriptfile)) | ||
148 | with open(scriptfile, 'w') as script: | ||
149 | script.write("#!/bin/sh\n") | ||
150 | bb.data.emit_func("useradd_sysroot", script, d) | ||
151 | script.write("useradd_sysroot\n") | ||
152 | os.chmod(scriptfile, 0o755) | ||
153 | bb.build.exec_func("useradd_sysroot", d) | 148 | bb.build.exec_func("useradd_sysroot", d) |
154 | elif task == "populate_sysroot": | 149 | elif task == "populate_sysroot": |
155 | # Used when installed in dependent task sysroots | 150 | # Used when installed in dependent task sysroots |
156 | scriptfile = d.expand("${SYSROOT_DESTDIR}${bindir}/postinst-useradd-${PN}") | 151 | scriptfile = d.expand("${SYSROOT_DESTDIR}${bindir}/postinst-useradd-${PN}") |
152 | |||
153 | if scriptfile: | ||
157 | bb.utils.mkdirhier(os.path.dirname(scriptfile)) | 154 | bb.utils.mkdirhier(os.path.dirname(scriptfile)) |
158 | with open(scriptfile, 'w') as script: | 155 | with open(scriptfile, 'w') as script: |
159 | script.write("#!/bin/sh\n") | 156 | script.write("#!/bin/sh\n") |