From: Mikko Rapeli <mikko.rapeli@linaro.org>
To: uvv.mail@gmail.com
Cc: Openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH v2 3/3] systemd: Build the systemctl executable
Date: Tue, 4 Feb 2025 15:18:21 +0200 [thread overview]
Message-ID: <Z6ITnblSwyvezrQT@nuoska> (raw)
In-Reply-To: <20250204105315.84079-3-uvv.mail@gmail.com>
Hi,
On Tue, Feb 04, 2025 at 11:53:15AM +0100, Vyacheslav Yurkov via lists.openembedded.org wrote:
> From: Vyacheslav Yurkov <uvv.mail@gmail.com>
>
> Instead of the python re-implementation build the actual systemctl from
> the systemd source tree. The python script was used when systemd didn't
> provide an option to build individual executables. It is possible in the
> meantime, so instead of always adapting the script when there's a new
> functionality, we simply use upstream implementation.
Good reason, no objections!
> Signed-off-by: Vyacheslav Yurkov <uvv.mail@gmail.com>
> ---
> .../systemd/systemd-systemctl-native.bb | 20 +-
> ...-meson-add-install-tag-for-systemctl.patch | 25 ++
> .../systemd/systemd-systemctl/systemctl | 366 ------------------
> 3 files changed, 33 insertions(+), 378 deletions(-)
> create mode 100644 meta/recipes-core/systemd/systemd-systemctl/0001-meson-add-install-tag-for-systemctl.patch
> delete mode 100755 meta/recipes-core/systemd/systemd-systemctl/systemctl
>
> diff --git a/meta/recipes-core/systemd/systemd-systemctl-native.bb b/meta/recipes-core/systemd/systemd-systemctl-native.bb
> index ffa024caef..57bb1ab830 100644
> --- a/meta/recipes-core/systemd/systemd-systemctl-native.bb
> +++ b/meta/recipes-core/systemd/systemd-systemctl-native.bb
> @@ -1,17 +1,13 @@
> -SUMMARY = "Wrapper for enabling systemd services"
> +SUMMARY = "Systemctl executable from systemd"
>
> -LICENSE = "MIT"
> -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
> +require systemd.inc
>
> +DEPENDS = "gperf-native libcap-native util-linux-native python3-jinja2-native"
>
> -inherit native
> +inherit pkgconfig meson native
>
> -SRC_URI = "file://systemctl"
> +SRC_URI = "file://0001-meson-add-install-tag-for-systemctl.patch"
Hmm, doesn't this overwrite SRC_URI from systemd.inc?
SRC_URI += "file://...patch" would amend the patch file.
> -S = "${WORKDIR}/sources"
> -UNPACKDIR = "${S}"
> -
> -do_install() {
> - install -d ${D}${bindir}
> - install -m 0755 ${S}/systemctl ${D}${bindir}
> -}
> +MESON_TARGET = "systemctl:executable"
> +MESON_INSTALL_TAGS = "systemctl"
> +EXTRA_OEMESON:append = " -Dlink-systemctl-shared=false"
I wonder why this tag support is needed since MESON_TARGET already
compiles only the correct executable with static linking. Is it there
just to let meson handle the install step of a single systemctl
executable?
Or does it install more files, like config files too?
I'm comparing this to a draft systemd-boot-native recipe for ukify
which I had and which sets the build target but installs manually:
MESON_TARGET = "ukify"
EXTRA_OEMESON += "-Dnobody-user=nobody \
-Dnobody-group=nogroup \
-Drootlibdir=${rootlibdir} \
-Drootprefix=${rootprefix} \
-Ddefault-locale=C \
-Dmode=release \
-Dsystem-alloc-uid-min=101 \
-Dsystem-uid-max=999 \
-Dsystem-alloc-gid-min=101 \
-Dsystem-gid-max=999 \
"
do_install() {
install -d ${D}${bindir}/
install -m 0755 ${S}/src/ukify/ukify.py ${D}${bindir}/ukify
}
So the custom do_install() step could be avoided if systemd meson config
would have "install_tag" for ukify too?
Current systemd-boot-native recipe installs/copies the unmodified ukify.py
from source tree and uses that in native. It doesn't run meson build for it
and thus things like version details are incorrect. Also some additional tools
like systemd-measure, systemd-sbsign etc are not compiled so some usecases may
not be supported atm. If those would also include the install tags, then they
could be compiled and installed too, I presume.
> diff --git a/meta/recipes-core/systemd/systemd-systemctl/0001-meson-add-install-tag-for-systemctl.patch b/meta/recipes-core/systemd/systemd-systemctl/0001-meson-add-install-tag-for-systemctl.patch
> new file mode 100644
> index 0000000000..a9b3e62708
> --- /dev/null
> +++ b/meta/recipes-core/systemd/systemd-systemctl/0001-meson-add-install-tag-for-systemctl.patch
> @@ -0,0 +1,25 @@
> +From fbf1ae3b7bd074a8d3bfb741f54b8539123399f1 Mon Sep 17 00:00:00 2001
> +From: Vyacheslav Yurkov <uvv.mail@gmail.com>
> +Date: Sun, 2 Feb 2025 10:13:38 +0100
> +Subject: [PATCH] meson: add install tag for systemctl
> +
> +Upstream-Status: Backport
> +[https://github.com/systemd/systemd/commit/b1e5a7aa3f1e552c56d5adbeed6ff67d88d1e103]
Thanks for getting this upstreamed!
Cheers,
-Mikko
next prev parent reply other threads:[~2025-02-04 13:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-04 10:53 [PATCH v2 1/3] bitbake.conf: Add conditional host tool getent uvv.mail
2025-02-04 10:53 ` [PATCH v2 2/3] meson.bbclass: Add an option to specify install tags uvv.mail
2025-02-04 10:53 ` [PATCH v2 3/3] systemd: Build the systemctl executable uvv.mail
2025-02-04 11:02 ` Patchtest results for " patchtest
2025-02-04 13:18 ` Mikko Rapeli [this message]
2025-02-05 7:06 ` [OE-core] " Vyacheslav Yurkov
2025-02-05 8:30 ` Böszörményi Zoltán
2025-02-04 11:03 ` [OE-core] [PATCH v2 1/3] bitbake.conf: Add conditional host tool getent Richard Purdie
2025-02-04 11:33 ` Vyacheslav Yurkov
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=Z6ITnblSwyvezrQT@nuoska \
--to=mikko.rapeli@linaro.org \
--cc=Openembedded-core@lists.openembedded.org \
--cc=uvv.mail@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.