From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Luca Bocassi <luca.boccassi@gmail.com>,
openembedded-core@lists.openembedded.org
Cc: paul.eggleton@microsoft.com
Subject: Re: [OE-core] [PATCH v2 1/7] systemd: skip chown when building for nativesdk
Date: Mon, 22 Nov 2021 12:46:50 +0000 [thread overview]
Message-ID: <0e7c2b9d388d01ab7e304b9664ae6501998f93e6.camel@linuxfoundation.org> (raw)
In-Reply-To: <20211119113429.502652-1-luca.boccassi@gmail.com>
On Fri, 2021-11-19 at 11:34 +0000, Luca Bocassi wrote:
> From: Luca Boccassi <luca.boccassi@microsoft.com>
>
> The useradd class is a no-op in the nativesdk case, so chown will fail.
> Skip them.
>
> Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
> ---
> v2: use "${PN}" = "${BPN}" as suggested by reviewers
I think that was bad advice since this would break multilib variants of the
systemd recipe and I'd much prefer this was conditional on nativesdk.
> meta/recipes-core/systemd/systemd_249.5.bb | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/meta/recipes-core/systemd/systemd_249.5.bb b/meta/recipes-core/systemd/systemd_249.5.bb
> index 8bdc0ca028..2df2de0cf3 100644
> --- a/meta/recipes-core/systemd/systemd_249.5.bb
> +++ b/meta/recipes-core/systemd/systemd_249.5.bb
> @@ -275,7 +275,10 @@ do_install() {
> # which is expected to be empty.
> rm -rf ${D}${localstatedir}/log
> else
> - chown root:systemd-journal ${D}${localstatedir}/log/journal
> + # The useradd class is a no-op in the nativesdk case, so chown will fail
> + if [ "${PN}" = "${BPN}" ]; then
> + chown root:systemd-journal ${D}${localstatedir}/log/journal
> + fi
>
> # journal-remote creates this at start
> rm -rf ${D}${localstatedir}/log/journal/remote
I'm guessing this is only failing on systems that don't have a systemd-jounral
group as it built ok for me?
The better way to fix this is probably to replicate what we have for native,
i.e. the entry in the class:
native.bbclass:PATH:prepend = "${COREBASE}/scripts/native-intercept:"
which puts a chown and chgrp into PATH which doesn't do anything. We could do
something similar for nativesdk and it would avoid the need for these if
statements and solve the problem generically.
I am also a bit concerned about some of the other "creeping" dependencies so I
experimented a little with master to see how much it could be cut down. I could
get working builds with the lines below:
"""
PACKAGECONFIG:remove:class-native = "vconsole xkbcommon sysvinit"
PACKAGECONFIG:append:class-native = " serial-getty-generator"
RDEPENDS:${PN}:remove:class-native = "volatile-binds"
RRECOMMENDS:${PN}:remove:class-native = "os-release systemd-conf"
RRECOMMENDS:${PN}-vconsole-setup:class-native = ""
PACKAGECONFIG:remove:class-nativesdk = "vconsole xkbcommon sysvinit"
PACKAGECONFIG:append:class-nativesdk = " serial-getty-generator"
RDEPENDS:${PN}:remove:class-nativesdk = "volatile-binds"
RRECOMMENDS:${PN}:remove:class-nativesdk = "os-release systemd-conf"
RRECOMMENDS:${PN}-vconsole-setup:class-nativesdk = ""
# Nothing picks up /var in the nativesdk case
do_install:append:class-nativesdk () {
rm -rf ${D}/var
}
BBCLASSEXTEND = "native nativesdk"
"""
which removes the need to change os-release, kbd, systemd-conf and systemd-
getty. To merge, we'd want to restructure this to alter the variable
construction so we can avoid the use of the remove operator but it is an easy
way to test and evaluate the extent of changes needed.
The above also nearly has native builds working as well. To get that to build I
had to patch meson.build:
Index: git/meson.build
===================================================================
--- git.orig/meson.buildIndex: git/meson.build
===================================================================
--- git.orig/meson.build
+++ git/meson.build
@@ -745,7 +745,7 @@ conf.set('CONTAINER_UID_BASE_MAX', conta
nobody_user = get_option('nobody-user')
nobody_group = get_option('nobody-group')
-if not meson.is_cross_build()
+if false and not meson.is_cross_build()
getent_result = run_command('getent', 'passwd', '65534')
if getent_result.returncode() == 0
name = getent_result.stdout().split(':')[0]
since we want to use the "cross" codepath there regardless. That lets everything
build but I did then see errors due to absolute path symlinks which would likely
be fixable.
I did this mainly as I wanted to understand how much of systemd is being build
and packaged since many of these packages will not make sense in a SDK or a
native build. I think the final piece of patch which we'd need to be able to
merge something like this is to trim down what is being packaged up to the
pieces which are actually useful in the native or nativesdk cases.
Cheers,
Richard
next prev parent reply other threads:[~2021-11-22 12:46 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 12:31 [PATCH 0/8] systemd: allow building for nativesdk luca.boccassi
2021-11-17 12:31 ` [PATCH 1/8] systemd: skip chown when " luca.boccassi
2021-11-17 18:14 ` [OE-core] " Peter Kjellerstedt
2021-11-17 18:32 ` Luca Boccassi
2021-11-19 11:35 ` Luca Boccassi
2021-11-17 12:31 ` [PATCH 2/8] systemd: skip postinst in nativesdk builds luca.boccassi
2021-11-17 12:31 ` [PATCH 3/8] systemd: remove /var " luca.boccassi
2021-11-17 12:31 ` [PATCH 4/8] volatile-binds: " luca.boccassi
2021-11-17 12:31 ` [PATCH 5/8] volatile-binds: add nativesdk luca.boccassi
2021-11-17 17:40 ` [OE-core] " Richard Purdie
2021-11-17 17:42 ` Luca Boccassi
2021-11-19 11:36 ` Luca Boccassi
2021-11-17 12:31 ` [PATCH 6/8] kbd: " luca.boccassi
2021-11-17 17:43 ` [OE-core] " Richard Purdie
2021-11-17 17:58 ` Luca Boccassi
2021-11-17 12:32 ` [PATCH 7/8] os-release: " luca.boccassi
2021-11-17 12:32 ` [PATCH 8/8] systemd: " luca.boccassi
2021-11-17 12:53 ` [OE-core] [PATCH 0/8] systemd: allow building for nativesdk Alexander Kanavin
2021-11-17 14:59 ` Luca Boccassi
2021-11-17 15:07 ` Alexander Kanavin
2021-11-17 16:11 ` Luca Boccassi
2021-11-17 16:44 ` Alexander Kanavin
2021-11-17 17:41 ` Luca Boccassi
2021-11-17 17:49 ` Alexander Kanavin
2021-11-17 18:04 ` Luca Boccassi
2021-11-17 19:50 ` Alexander Kanavin
2021-11-19 1:43 ` ChenQi
2021-11-19 11:26 ` Luca Boccassi
2021-11-22 3:32 ` ChenQi
2021-11-19 11:34 ` [PATCH v2 1/7] systemd: skip chown when " luca.boccassi
2021-11-19 11:34 ` [PATCH v2 2/7] systemd: skip postinst in nativesdk builds luca.boccassi
2021-11-19 11:34 ` [PATCH v2 3/7] systemd: remove /var " luca.boccassi
2021-11-19 11:34 ` [PATCH v2 4/7] systemd: remove volatile-binds RDEPENDS for nativesdk luca.boccassi
2021-11-22 11:56 ` [OE-core] " Richard Purdie
2021-11-22 22:51 ` Luca Boccassi
2021-11-19 11:34 ` [PATCH v2 5/7] kbd: add nativesdk luca.boccassi
2021-11-19 11:34 ` [PATCH v2 6/7] os-release: " luca.boccassi
2021-11-19 11:34 ` [PATCH v2 7/7] systemd: " luca.boccassi
2021-11-19 11:39 ` [OE-core] " Alexander Kanavin
2021-11-19 11:55 ` Luca Boccassi
2021-11-22 12:46 ` Richard Purdie [this message]
2021-11-22 13:57 ` [OE-core] [PATCH v2 1/7] systemd: skip chown when building for nativesdk Konrad Weihmann
2021-11-22 14:17 ` Alexander Kanavin
2021-11-22 22:47 ` Luca Boccassi
2021-11-24 8:09 ` Konrad Weihmann
2021-11-24 11:53 ` Luca Boccassi
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=0e7c2b9d388d01ab7e304b9664ae6501998f93e6.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=luca.boccassi@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=paul.eggleton@microsoft.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