1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-09 05:29:32 +00:00

useradd.bbclass: Fix order of postinst-useradd-*

postinst-useradd-* haven't been running in order of dependency.

This patch is reworked from Piotr Łobacz's patch and fixes:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=15084
https://bugzilla.yoctoproject.org/show_bug.cgi?id=13904

basepasswd_sysroot_postinst in base-passwd can install postinst-useradd-*
scripts with any order. Sometimes this means, for example a useradd postinst
will attempt to run without the corresponding group postinst causing errors.
This patch ensures that we first run groupadd, then useradd and then
group membership.

[RP: Tweaked to avoid removing previous fixes and for whitespace/style issues
     Also ensure the scripts are changed to execute with -e to highlight errors]

(From OE-Core rev: 322ef726132a47d977d2c6ee41de5358f1e85994)

Signed-off-by: Eilís 'pidge' Ní Fhlannagáin <pidge@baylibre.com>
Signed-off-by: Piotr Łobacz <p.lobacz@welotec.com>
Signed-off-by: Jan Górski <j.gorski@welotec.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Piotr Łobacz
2024-02-23 13:25:20 +00:00
committed by Richard Purdie
parent 0e3bcc5103
commit f6daeba2e9
2 changed files with 44 additions and 25 deletions
+2 -2
View File
@@ -245,7 +245,7 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d):
continue
staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d)
for p in postinsts:
for p in sorted(postinsts):
bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)))
#
@@ -629,7 +629,7 @@ python extend_recipe_sysroot() {
for f in fixme:
staging_processfixme(fixme[f], f, recipesysroot, recipesysrootnative, d)
for p in postinsts:
for p in sorted(postinsts):
bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT)))
for dep in manifests: