From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: "Eilís 'pidge' Ní Fhlannagáin" <pidge@baylibre.com>,
openembedded-core@lists.openembedded.org
Cc: "Piotr Łobacz" <p.lobacz@welotec.com>,
"Jan Górski" <j.gorski@welotec.com>
Subject: Re: [OE-core] [PATCH v3 1/3] useradd.bbclass: Fix order of postinst-useradd-*
Date: Sat, 24 Feb 2024 12:11:33 +0000 [thread overview]
Message-ID: <a5977a0ecacb24582118735fa1b5d511827b4b5c.camel@linuxfoundation.org> (raw)
In-Reply-To: <07eb596dd4e8cfc319add777a3069d6e50d33e56.1708694024.git.pidge@baylibre.com>
On Fri, 2024-02-23 at 13:25 +0000, Eilís 'pidge' Ní Fhlannagáin wrote:
> python useradd_sysroot_sstate () {
> - scriptfile = None
> - task = d.getVar("BB_CURRENTTASK")
> - if task == "package_setscene":
> - bb.build.exec_func("useradd_sysroot", d)
> - elif task == "prepare_recipe_sysroot":
> - # Used to update this recipe's own sysroot so the user/groups are available to do_install
> -
> - # 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)
> - elif task == "populate_sysroot":
> - # Used when installed in dependent task sysroots
> - scriptfile = d.expand("${SYSROOT_DESTDIR}${bindir}/postinst-useradd-${PN}")
> -
> - if scriptfile:
> - bb.utils.mkdirhier(os.path.dirname(scriptfile))
> - with open(scriptfile, 'w') as script:
> - script.write("#!/bin/sh -e\n")
> - bb.data.emit_func("useradd_sysroot", script, d)
> - script.write("useradd_sysroot\n")
> - os.chmod(scriptfile, 0o755)
> + for type, sort_prefix in [("group", "01"), ("user", "02"), ("groupmems", "03")]:
> + scriptfile = None
> + task = d.getVar("BB_CURRENTTASK")
> + if task == "package_setscene":
> + bb.build.exec_func(f"{type}add_sysroot", d)
> + elif task == "prepare_recipe_sysroot":
> + # Used to update this recipe's own sysroot so the user/groups are available to do_install
> + scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/" f"postinst-useradd-{sort_prefix}{type}" "-${PN}")
> + bb.build.exec_func(f"{type}add_sysroot", d)
> + elif task == "populate_sysroot":
> + # Used when installed in dependent task sysroots
> + scriptfile = d.expand("${SYSROOT_DESTDIR}${bindir}/" f"postinst-useradd-{sort_prefix}{type}" "-${PN}")
> +
> + if scriptfile:
> + bb.utils.mkdirhier(os.path.dirname(scriptfile))
> + with open(scriptfile, 'w') as script:
> + script.write("#!/bin/sh\n")
> + bb.data.emit_func(f"{type}add_sysroot", script, d)
> + script.write(f"{type}add_sysroot\n")
> + os.chmod(scriptfile, 0o755)
> }
This change has all kinds of hidden issues and changes. The -e change
isn't mentioned but probably a good idea. The addition of trailing
whitespace is not great but harmless. This is on top of the previous
issues the series had.
What really upsets me though is that this reverted:
https://git.yoctoproject.org/poky/commit/?id=4bb222e0d71a4cb159b8a4f1a90b65b1af32ac10
which thankfully we have a test for, which then failed:
https://autobuilder.yoctoproject.org/typhoon/#/builders/80/builds/6395/steps/14/logs/stdio
This amounts to a lack of attention to detail and really frustrates me.
I'll queue something in -next to fix this up as I do want to fix the
ordering issue and we are now close with that but it will make me worry
a lot about future patches.
Richard
next prev parent reply other threads:[~2024-02-24 12:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-23 13:25 [PATCH v3 0/3] Useradd postinstall fixes and tests Eilís 'pidge' Ní Fhlannagáin
2024-02-23 13:25 ` [PATCH v3 1/3] useradd.bbclass: Fix order of postinst-useradd-* Eilís 'pidge' Ní Fhlannagáin
2024-02-24 12:11 ` Richard Purdie [this message]
2024-02-23 13:25 ` [PATCH v3 2/3] selftest-users: Convoluted selftest for USERADD_DEPENDS Eilís 'pidge' Ní Fhlannagáin
2024-02-23 13:25 ` [PATCH v3 3/3] creategroup*: Remove coreutils-native as a DEPENDS Eilís 'pidge' Ní Fhlannagáin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a5977a0ecacb24582118735fa1b5d511827b4b5c.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=j.gorski@welotec.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=p.lobacz@welotec.com \
--cc=pidge@baylibre.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox