mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 01:19:52 +00:00
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>
This commit is contained in:
@@ -154,7 +154,11 @@ python useradd_sysroot_sstate () {
|
|||||||
bb.build.exec_func("useradd_sysroot", d)
|
bb.build.exec_func("useradd_sysroot", d)
|
||||||
elif task == "prepare_recipe_sysroot":
|
elif task == "prepare_recipe_sysroot":
|
||||||
# Used to update this recipe's own sysroot so the user/groups are available to do_install
|
# Used to update this recipe's own sysroot so the user/groups are available to do_install
|
||||||
scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}")
|
|
||||||
|
# If do_populate_sysroot is triggered and we write the file here, there would be an overlapping
|
||||||
|
# files. See usergrouptests.UserGroupTests.test_add_task_between_p_sysroot_and_package
|
||||||
|
scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}-recipedebug")
|
||||||
|
|
||||||
bb.build.exec_func("useradd_sysroot", d)
|
bb.build.exec_func("useradd_sysroot", d)
|
||||||
elif task == "populate_sysroot":
|
elif task == "populate_sysroot":
|
||||||
# Used when installed in dependent task sysroots
|
# Used when installed in dependent task sysroots
|
||||||
|
|||||||
@@ -18,11 +18,9 @@ class UserGroupTests(OESelftestTestCase):
|
|||||||
self.logger.info("Packaging creategroup2")
|
self.logger.info("Packaging creategroup2")
|
||||||
self.assertTrue(bitbake(' creategroup2 -c package'))
|
self.assertTrue(bitbake(' creategroup2 -c package'))
|
||||||
|
|
||||||
def _test_add_task_between_p_sysroot_and_package(self):
|
def test_add_task_between_p_sysroot_and_package(self):
|
||||||
self.logger.info("Cleaning sstate for useraddbadtask")
|
# Test for YOCTO #14961
|
||||||
self.logger.info("Building useraddbadtask")
|
self.assertTrue(bitbake('useraddbadtask -C fetch'))
|
||||||
# fails due to bug #14961
|
|
||||||
self.assertTrue(bitbake(' useraddbadtask -C fetch'))
|
|
||||||
|
|
||||||
def test_static_useradd_from_dynamic(self):
|
def test_static_useradd_from_dynamic(self):
|
||||||
metaselftestpath = get_test_layer()
|
metaselftestpath = get_test_layer()
|
||||||
|
|||||||
Reference in New Issue
Block a user