diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-09 15:28:11 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-12-10 09:24:01 +0000 |
commit | 4bb222e0d71a4cb159b8a4f1a90b65b1af32ac10 (patch) | |
tree | 9b8d19fd97cb34838c0b108667371019a357ba41 /meta/classes/useradd.bbclass | |
parent | 61805f6d60a33045546a5657a9c9f3b899a209b2 (diff) | |
download | poky-4bb222e0d71a4cb159b8a4f1a90b65b1af32ac10.tar.gz |
useradd: Fix useradd do_populate_sysroot dependency bug
If a task is adde which has a dependency on the do_populate_sysroot task of
the recipe, it will cause it to be installed into the sysroot (similar to
do_addto_recipe_sysroot). This fails since the postinst script is an overlapping
file:
Exception: FileExistsError: [Errno 17] File exists:
'tmp/sysroots-components/all/useraddbadtask/usr/bin/postinst-useradd-useraddbadtask'
->
'tmp/work/all-poky-linux/useraddbadtask/1.0/recipe-sysroot/usr/bin/postinst-useradd-useraddbadtask'
The copy written out at do_prepare_recipe_sysroot time is just for debug so
rename it, meaning there are no longer overlapping files and the installation
can be successful, removing the error.
[YCOTO #14961]
With the bug fixed, enable the test.
(From OE-Core rev: 564339afb73fc52a66c1a08437587cad1c4d46e7)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/useradd.bbclass')
-rw-r--r-- | meta/classes/useradd.bbclass | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass index a4b8a2d6d6..0997b3da7a 100644 --- a/meta/classes/useradd.bbclass +++ b/meta/classes/useradd.bbclass | |||
@@ -154,7 +154,11 @@ python useradd_sysroot_sstate () { | |||
154 | bb.build.exec_func("useradd_sysroot", d) | 154 | bb.build.exec_func("useradd_sysroot", d) |
155 | elif task == "prepare_recipe_sysroot": | 155 | elif task == "prepare_recipe_sysroot": |
156 | # Used to update this recipe's own sysroot so the user/groups are available to do_install | 156 | # Used to update this recipe's own sysroot so the user/groups are available to do_install |
157 | scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}") | 157 | |
158 | # If do_populate_sysroot is triggered and we write the file here, there would be an overlapping | ||
159 | # files. See usergrouptests.UserGroupTests.test_add_task_between_p_sysroot_and_package | ||
160 | scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}-recipedebug") | ||
161 | |||
158 | bb.build.exec_func("useradd_sysroot", d) | 162 | bb.build.exec_func("useradd_sysroot", d) |
159 | elif task == "populate_sysroot": | 163 | elif task == "populate_sysroot": |
160 | # Used when installed in dependent task sysroots | 164 | # Used when installed in dependent task sysroots |