diff mbox series

[1/3] systemd-tools: add recipe

Message ID 20240902094117.31156-2-mikko.rapeli@linaro.org
State New
Headers show
Series systemd uki support | expand

Commit Message

Mikko Rapeli Sept. 2, 2024, 9:41 a.m. UTC
From: Erik Schilling <erik.schilling@linaro.org>

Provides systemd-tools-native recipe for ukify.py tooling.
Avoids full systemd native build which is not needed.

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 .../systemd/systemd-tools_256.5.bb            | 41 +++++++++++++++++++
 1 file changed, 41 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd-tools_256.5.bb

Comments

Richard Purdie Sept. 2, 2024, 9:59 a.m. UTC | #1
On Mon, 2024-09-02 at 12:41 +0300, Mikko Rapeli via
lists.openembedded.org wrote:
> From: Erik Schilling <erik.schilling@linaro.org>
> 
> Provides systemd-tools-native recipe for ukify.py tooling.
> Avoids full systemd native build which is not needed.
> 
> Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
> ---
>  .../systemd/systemd-tools_256.5.bb            | 41
> +++++++++++++++++++
>  1 file changed, 41 insertions(+)
>  create mode 100644 meta/recipes-core/systemd/systemd-tools_256.5.bb
> 
> diff --git a/meta/recipes-core/systemd/systemd-tools_256.5.bb
> b/meta/recipes-core/systemd/systemd-tools_256.5.bb
> new file mode 100644
> index 0000000000..f2e419ffe0
> --- /dev/null
> +++ b/meta/recipes-core/systemd/systemd-tools_256.5.bb
> @@ -0,0 +1,41 @@
> +require systemd.inc
> +FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemd:"
> +
> +DEPENDS = " \
> +    intltool-native \
> +    libcap \
> +    util-linux \
> +    gperf-native \
> +    python3-jinja2-native \
> +    python3-pyelftools-native \
> +    python3-pefile \
> +"
> +
> +inherit meson pkgconfig gettext
> +
> +MESON_TARGET = "ukify"
> +
> +# Helper variables to clarify locations. This mirrors the logic in
> systemd's
> +# build system.
> +rootprefix ?= "${root_prefix}"
> +rootlibdir ?= "${base_libdir}"
> +rootlibexecdir = "${rootprefix}/lib"
> +
> +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
> +}
> +
> +BBCLASSEXTEND = "native"

This will fail in CI as there is now maintainers file entry...

Cheers,

Richard
Mikko Rapeli Sept. 2, 2024, 10:05 a.m. UTC | #2
Hi,

On Mon, Sep 02, 2024 at 10:59:22AM +0100, Richard Purdie wrote:
> This will fail in CI as there is now maintainers file entry...

Chen, since you are systemd maintainer, would you mind if I add
systemd-tools for you too? It's only the ukify python script
currently for native use cases at build time.

--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -795,6 +795,7 @@ RECIPE_MAINTAINER:pn-systemd-compat-units = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER:pn-systemd-machine-units = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER:pn-systemd-serialgetty = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER:pn-systemd-systemctl-native = "Chen Qi <Qi.Chen@windriver.com>"
+RECIPE_MAINTAINER:pn-systemd-tools-native = "Chen Qi <Qi.Chen@windriver.com>"
 RECIPE_MAINTAINER:pn-systemtap = "Victor Kamensky <victor.kamensky7@gmail.com>"
 RECIPE_MAINTAINER:pn-systemtap-native = "Victor Kamensky <victor.kamensky7@gmail.com>"
 RECIPE_MAINTAINER:pn-sysvinit = "Ross Burton <ross.burton@arm.com>"

Cheers,

-Mikko
Alexander Kanavin Sept. 2, 2024, 10:17 a.m. UTC | #3
Wait. Isn't this ukify.py thingy already provided from
systemd-boot-native recipe?

Alex

On Mon, 2 Sept 2024 at 12:06, Mikko Rapeli via lists.openembedded.org
<mikko.rapeli=linaro.org@lists.openembedded.org> wrote:
>
> Hi,
>
> On Mon, Sep 02, 2024 at 10:59:22AM +0100, Richard Purdie wrote:
> > This will fail in CI as there is now maintainers file entry...
>
> Chen, since you are systemd maintainer, would you mind if I add
> systemd-tools for you too? It's only the ukify python script
> currently for native use cases at build time.
>
> --- a/meta/conf/distro/include/maintainers.inc
> +++ b/meta/conf/distro/include/maintainers.inc
> @@ -795,6 +795,7 @@ RECIPE_MAINTAINER:pn-systemd-compat-units = "Chen Qi <Qi.Chen@windriver.com>"
>  RECIPE_MAINTAINER:pn-systemd-machine-units = "Chen Qi <Qi.Chen@windriver.com>"
>  RECIPE_MAINTAINER:pn-systemd-serialgetty = "Chen Qi <Qi.Chen@windriver.com>"
>  RECIPE_MAINTAINER:pn-systemd-systemctl-native = "Chen Qi <Qi.Chen@windriver.com>"
> +RECIPE_MAINTAINER:pn-systemd-tools-native = "Chen Qi <Qi.Chen@windriver.com>"
>  RECIPE_MAINTAINER:pn-systemtap = "Victor Kamensky <victor.kamensky7@gmail.com>"
>  RECIPE_MAINTAINER:pn-systemtap-native = "Victor Kamensky <victor.kamensky7@gmail.com>"
>  RECIPE_MAINTAINER:pn-sysvinit = "Ross Burton <ross.burton@arm.com>"
>
> Cheers,
>
> -Mikko
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#204069): https://lists.openembedded.org/g/openembedded-core/message/204069
> Mute This Topic: https://lists.openembedded.org/mt/108223984/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Mikko Rapeli Sept. 2, 2024, 10:29 a.m. UTC | #4
Hi,

On Mon, Sep 02, 2024 at 12:17:53PM +0200, Alexander Kanavin wrote:
> Wait. Isn't this ukify.py thingy already provided from
> systemd-boot-native recipe?

Oh, it is. I've somehow missed this. Will switch over to it.

Cheers,

-Mikko
Erik Schilling Sept. 2, 2024, 10:36 a.m. UTC | #5
On Mon Sep 2, 2024 at 12:17 PM CEST, Alexander Kanavin wrote:
> Wait. Isn't this ukify.py thingy already provided from
> systemd-boot-native recipe?

Yes. It was added while I did this change as part of a PoC ~a year ago.

I am not a huge fan of it having landed in systemd-boot-native. I
think there are further tools that would be interesting to have in a
systemd-native-style recipe (for example systemd-repart [1]). But as of
now, I agree that this recipe is probably not required!

- Erik

[1] https://lore.kernel.org/all/20240426-systemd-repart-v1-1-a6a710a14a8c@linaro.org/

>
> Alex
>
> On Mon, 2 Sept 2024 at 12:06, Mikko Rapeli via lists.openembedded.org
> <mikko.rapeli=linaro.org@lists.openembedded.org> wrote:
> >
> > Hi,
> >
> > On Mon, Sep 02, 2024 at 10:59:22AM +0100, Richard Purdie wrote:
> > > This will fail in CI as there is now maintainers file entry...
> >
> > Chen, since you are systemd maintainer, would you mind if I add
> > systemd-tools for you too? It's only the ukify python script
> > currently for native use cases at build time.
> >
> > --- a/meta/conf/distro/include/maintainers.inc
> > +++ b/meta/conf/distro/include/maintainers.inc
> > @@ -795,6 +795,7 @@ RECIPE_MAINTAINER:pn-systemd-compat-units = "Chen Qi <Qi.Chen@windriver.com>"
> >  RECIPE_MAINTAINER:pn-systemd-machine-units = "Chen Qi <Qi.Chen@windriver.com>"
> >  RECIPE_MAINTAINER:pn-systemd-serialgetty = "Chen Qi <Qi.Chen@windriver.com>"
> >  RECIPE_MAINTAINER:pn-systemd-systemctl-native = "Chen Qi <Qi.Chen@windriver.com>"
> > +RECIPE_MAINTAINER:pn-systemd-tools-native = "Chen Qi <Qi.Chen@windriver.com>"
> >  RECIPE_MAINTAINER:pn-systemtap = "Victor Kamensky <victor.kamensky7@gmail.com>"
> >  RECIPE_MAINTAINER:pn-systemtap-native = "Victor Kamensky <victor.kamensky7@gmail.com>"
> >  RECIPE_MAINTAINER:pn-sysvinit = "Ross Burton <ross.burton@arm.com>"
> >
> > Cheers,
> >
> > -Mikko
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#204069): https://lists.openembedded.org/g/openembedded-core/message/204069
> > Mute This Topic: https://lists.openembedded.org/mt/108223984/1686489
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alex.kanavin@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd-tools_256.5.bb b/meta/recipes-core/systemd/systemd-tools_256.5.bb
new file mode 100644
index 0000000000..f2e419ffe0
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-tools_256.5.bb
@@ -0,0 +1,41 @@ 
+require systemd.inc
+FILESEXTRAPATHS =. "${FILE_DIRNAME}/systemd:"
+
+DEPENDS = " \
+    intltool-native \
+    libcap \
+    util-linux \
+    gperf-native \
+    python3-jinja2-native \
+    python3-pyelftools-native \
+    python3-pefile \
+"
+
+inherit meson pkgconfig gettext
+
+MESON_TARGET = "ukify"
+
+# Helper variables to clarify locations. This mirrors the logic in systemd's
+# build system.
+rootprefix ?= "${root_prefix}"
+rootlibdir ?= "${base_libdir}"
+rootlibexecdir = "${rootprefix}/lib"
+
+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
+}
+
+BBCLASSEXTEND = "native"