diff options
author | Piotr Łobacz <p.lobacz@welotec.com> | 2024-02-23 13:25:20 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-02-24 16:10:22 +0000 |
commit | f6daeba2e97e47550e959fb85d4639ef81d268e7 (patch) | |
tree | 6b6a19eeee05e76416689e18c1973fbec43241f3 /meta/classes-global | |
parent | 0e3bcc51037aa8e1f7992756f7476a879625b114 (diff) | |
download | poky-f6daeba2e97e47550e959fb85d4639ef81d268e7.tar.gz |
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>
Diffstat (limited to 'meta/classes-global')
-rw-r--r-- | meta/classes-global/staging.bbclass | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes-global/staging.bbclass b/meta/classes-global/staging.bbclass index ab3e1d71b5..3678a1b441 100644 --- a/meta/classes-global/staging.bbclass +++ b/meta/classes-global/staging.bbclass | |||
@@ -245,7 +245,7 @@ def staging_populate_sysroot_dir(targetsysroot, nativesysroot, native, d): | |||
245 | continue | 245 | continue |
246 | 246 | ||
247 | staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d) | 247 | staging_processfixme(fixme, targetdir, targetsysroot, nativesysroot, d) |
248 | for p in postinsts: | 248 | for p in sorted(postinsts): |
249 | bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT))) | 249 | bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT))) |
250 | 250 | ||
251 | # | 251 | # |
@@ -629,7 +629,7 @@ python extend_recipe_sysroot() { | |||
629 | for f in fixme: | 629 | for f in fixme: |
630 | staging_processfixme(fixme[f], f, recipesysroot, recipesysrootnative, d) | 630 | staging_processfixme(fixme[f], f, recipesysroot, recipesysrootnative, d) |
631 | 631 | ||
632 | for p in postinsts: | 632 | for p in sorted(postinsts): |
633 | bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT))) | 633 | bb.note("Running postinst {}, output:\n{}".format(p, subprocess.check_output(p, shell=True, stderr=subprocess.STDOUT))) |
634 | 634 | ||
635 | for dep in manifests: | 635 | for dep in manifests: |