* [PATCH] systemd-systemctl: Create machine-id with "uninitialized" text in it
@ 2023-02-27 19:15 Marek Vasut
2023-03-15 10:10 ` [OE-core] " ChenQi
0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2023-02-27 19:15 UTC (permalink / raw)
To: openembedded-core
Cc: Marek Vasut, Alexandre Belloni, Armin Kuster, Bob Henz,
Kristian Klausen, Nick Potenski, Richard Purdie
Instead of creating empty /etc/machine-id file using touch, write
text "uninitialized" into it. Systemd requires "uninitialized" in
the /etc/machine-id file to trigger systemd-firstboot .
Signed-off-by: Marek Vasut <marex@denx.de>
---
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Armin Kuster <akuster808@gmail.com>
Cc: Bob Henz <robert_henz@jabil.com>
Cc: Kristian Klausen <kristian@klausen.dk>
Cc: Nick Potenski <nick.potenski@garmin.com>
Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
---
meta/recipes-core/systemd/systemd-systemctl/systemctl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
index cddae75a06..45b29671ee 100755
--- a/meta/recipes-core/systemd/systemd-systemctl/systemctl
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -302,7 +302,7 @@ def preset_all(root):
# For the stateless configuration, where /etc is generated at runtime
# (for example on a tmpfs), this script shouldn't run at all and we
# allow systemd to completely populate /etc.
- (root / SYSCONFDIR / "machine-id").touch()
+ (root / SYSCONFDIR / "machine-id").write_text("uninitialized")
def main():
--
2.39.2
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH] systemd-systemctl: Create machine-id with "uninitialized" text in it
2023-02-27 19:15 [PATCH] systemd-systemctl: Create machine-id with "uninitialized" text in it Marek Vasut
@ 2023-03-15 10:10 ` ChenQi
2023-03-17 11:53 ` Marek Vasut
0 siblings, 1 reply; 7+ messages in thread
From: ChenQi @ 2023-03-15 10:10 UTC (permalink / raw)
To: Marek Vasut, openembedded-core
Cc: Alexandre Belloni, Armin Kuster, Bob Henz, Kristian Klausen,
Nick Potenski, Richard Purdie
This patch is forcing systemd to do preset-all at boot time (first boot)
in a function that simulates 'preset-all' at rootfs time.
If we look at the comments above the changed line, we can see that the
/etc/machine-id file was deliberately created as empty, for the purpose
of making systemd not treat the system as first boot.
"""
# If we populate the systemd links we also create /etc/machine-id,
which
# allows systemd to boot with the filesystem read-only before
generating
# a real value and then committing it back.
#
# For the stateless configuration, where /etc is generated at runtime
# (for example on a tmpfs), this script shouldn't run at all and we
# allow systemd to completely populate /etc.
"""
I'm going to send out a patch to revert this patch.
Regards,
Qi
On 2/28/23 03:15, Marek Vasut wrote:
> Instead of creating empty /etc/machine-id file using touch, write
> text "uninitialized" into it. Systemd requires "uninitialized" in
> the /etc/machine-id file to trigger systemd-firstboot .
>
> Signed-off-by: Marek Vasut <marex@denx.de>
> ---
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Armin Kuster <akuster808@gmail.com>
> Cc: Bob Henz <robert_henz@jabil.com>
> Cc: Kristian Klausen <kristian@klausen.dk>
> Cc: Nick Potenski <nick.potenski@garmin.com>
> Cc: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
> meta/recipes-core/systemd/systemd-systemctl/systemctl | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
> index cddae75a06..45b29671ee 100755
> --- a/meta/recipes-core/systemd/systemd-systemctl/systemctl
> +++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
> @@ -302,7 +302,7 @@ def preset_all(root):
> # For the stateless configuration, where /etc is generated at runtime
> # (for example on a tmpfs), this script shouldn't run at all and we
> # allow systemd to completely populate /etc.
> - (root / SYSCONFDIR / "machine-id").touch()
> + (root / SYSCONFDIR / "machine-id").write_text("uninitialized")
>
>
> def main():
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#177804): https://lists.openembedded.org/g/openembedded-core/message/177804
> Mute This Topic: https://lists.openembedded.org/mt/97273986/7304865
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [Qi.Chen@eng.windriver.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH] systemd-systemctl: Create machine-id with "uninitialized" text in it
2023-03-15 10:10 ` [OE-core] " ChenQi
@ 2023-03-17 11:53 ` Marek Vasut
2023-03-17 14:32 ` Chen, Qi
0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2023-03-17 11:53 UTC (permalink / raw)
To: ChenQi, openembedded-core
Cc: Alexandre Belloni, Armin Kuster, Bob Henz, Kristian Klausen,
Nick Potenski, Richard Purdie
On 3/15/23 11:10, ChenQi wrote:
Hi,
> This patch is forcing systemd to do preset-all at boot time (first boot)
> in a function that simulates 'preset-all' at rootfs time.
>
> If we look at the comments above the changed line, we can see that the
> /etc/machine-id file was deliberately created as empty, for the purpose
> of making systemd not treat the system as first boot.
> """
> # If we populate the systemd links we also create /etc/machine-id,
> which
> # allows systemd to boot with the filesystem read-only before
> generating
> # a real value and then committing it back.
> #
> # For the stateless configuration, where /etc is generated at runtime
> # (for example on a tmpfs), this script shouldn't run at all and we
> # allow systemd to completely populate /etc.
> """
>
> I'm going to send out a patch to revert this patch.
Hmmm, the problem is that without this patch, systemd firstboot does not
work and I would like to use that. How can we accommodate both options,
i.e. no breakage for you and working systemd-firstboot ?
^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [OE-core] [PATCH] systemd-systemctl: Create machine-id with "uninitialized" text in it
2023-03-17 11:53 ` Marek Vasut
@ 2023-03-17 14:32 ` Chen, Qi
2023-03-19 22:55 ` Marek Vasut
0 siblings, 1 reply; 7+ messages in thread
From: Chen, Qi @ 2023-03-17 14:32 UTC (permalink / raw)
To: Marek Vasut, openembedded-core
Cc: Alexandre Belloni, Armin Kuster, Bob Henz, Kristian Klausen,
Nick Potenski, Richard Purdie
Hi Marek,
I used the following line in local.conf and the firstboot worked:
IMAGE_PREPROCESS_COMMAND:remove = "systemd_preset_all;"
Regards,
Qi
-----Original Message-----
From: Marek Vasut <marex@denx.de>
Sent: Friday, March 17, 2023 7:54 PM
To: Chen, Qi <Qi.Chen@windriver.com>; openembedded-core@lists.openembedded.org
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>; Armin Kuster <akuster808@gmail.com>; Bob Henz <robert_henz@jabil.com>; Kristian Klausen <kristian@klausen.dk>; Nick Potenski <nick.potenski@garmin.com>; Richard Purdie <richard.purdie@linuxfoundation.org>
Subject: Re: [OE-core] [PATCH] systemd-systemctl: Create machine-id with "uninitialized" text in it
On 3/15/23 11:10, ChenQi wrote:
Hi,
> This patch is forcing systemd to do preset-all at boot time (first
> boot) in a function that simulates 'preset-all' at rootfs time.
>
> If we look at the comments above the changed line, we can see that the
> /etc/machine-id file was deliberately created as empty, for the
> purpose of making systemd not treat the system as first boot.
> """
> # If we populate the systemd links we also create
> /etc/machine-id, which
> # allows systemd to boot with the filesystem read-only before
> generating
> # a real value and then committing it back.
> #
> # For the stateless configuration, where /etc is generated at
> runtime
> # (for example on a tmpfs), this script shouldn't run at all and
> we
> # allow systemd to completely populate /etc.
> """
>
> I'm going to send out a patch to revert this patch.
Hmmm, the problem is that without this patch, systemd firstboot does not work and I would like to use that. How can we accommodate both options, i.e. no breakage for you and working systemd-firstboot ?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH] systemd-systemctl: Create machine-id with "uninitialized" text in it
2023-03-17 14:32 ` Chen, Qi
@ 2023-03-19 22:55 ` Marek Vasut
2023-03-20 2:23 ` ChenQi
0 siblings, 1 reply; 7+ messages in thread
From: Marek Vasut @ 2023-03-19 22:55 UTC (permalink / raw)
To: Chen, Qi, openembedded-core
Cc: Alexandre Belloni, Armin Kuster, Bob Henz, Kristian Klausen,
Nick Potenski, Richard Purdie
On 3/17/23 15:32, Chen, Qi wrote:
> Hi Marek,
Hi,
sorry for the delay
> I used the following line in local.conf and the firstboot worked:
> IMAGE_PREPROCESS_COMMAND:remove = "systemd_preset_all;"
But doesn't that also inhibit the rootfs-time preset-all ? I would like
to keep that, I just need for the systemd firstboot units to run on
first boot to do first boot system setup things, which they won't
without the 'uninitialized' in /etc/machine-id .
> -----Original Message-----
> From: Marek Vasut <marex@denx.de>
> Sent: Friday, March 17, 2023 7:54 PM
> To: Chen, Qi <Qi.Chen@windriver.com>; openembedded-core@lists.openembedded.org
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>; Armin Kuster <akuster808@gmail.com>; Bob Henz <robert_henz@jabil.com>; Kristian Klausen <kristian@klausen.dk>; Nick Potenski <nick.potenski@garmin.com>; Richard Purdie <richard.purdie@linuxfoundation.org>
> Subject: Re: [OE-core] [PATCH] systemd-systemctl: Create machine-id with "uninitialized" text in it
>
> On 3/15/23 11:10, ChenQi wrote:
>
> Hi,
>
>> This patch is forcing systemd to do preset-all at boot time (first
>> boot) in a function that simulates 'preset-all' at rootfs time.
>>
>> If we look at the comments above the changed line, we can see that the
>> /etc/machine-id file was deliberately created as empty, for the
>> purpose of making systemd not treat the system as first boot.
>> """
>> # If we populate the systemd links we also create
>> /etc/machine-id, which
>> # allows systemd to boot with the filesystem read-only before
>> generating
>> # a real value and then committing it back.
>> #
>> # For the stateless configuration, where /etc is generated at
>> runtime
>> # (for example on a tmpfs), this script shouldn't run at all and
>> we
>> # allow systemd to completely populate /etc.
>> """
>>
>> I'm going to send out a patch to revert this patch.
>
> Hmmm, the problem is that without this patch, systemd firstboot does not work and I would like to use that. How can we accommodate both options, i.e. no breakage for you and working systemd-firstboot ?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH] systemd-systemctl: Create machine-id with "uninitialized" text in it
2023-03-19 22:55 ` Marek Vasut
@ 2023-03-20 2:23 ` ChenQi
2023-03-20 10:21 ` Marek Vasut
0 siblings, 1 reply; 7+ messages in thread
From: ChenQi @ 2023-03-20 2:23 UTC (permalink / raw)
To: Marek Vasut, openembedded-core
Cc: Alexandre Belloni, Armin Kuster, Bob Henz, Kristian Klausen,
Nick Potenski, Richard Purdie
On 3/20/23 06:55, Marek Vasut wrote:
> On 3/17/23 15:32, Chen, Qi wrote:
>> Hi Marek,
>
> Hi,
>
> sorry for the delay
>
>> I used the following line in local.conf and the firstboot worked:
>> IMAGE_PREPROCESS_COMMAND:remove = "systemd_preset_all;"
>
> But doesn't that also inhibit the rootfs-time preset-all ? I would
> like to keep that, I just need for the systemd firstboot units to run
> on first boot to do first boot system setup things, which they won't
> without the 'uninitialized' in /etc/machine-id .
1) Lacking of /etc/machine-id file also triggers firstboot.
2) systemd firstboot does 'preset-all'. If you enable firstboot, then
you don't need rootfs-time preset-all.
Regards,
Qi
>
>> -----Original Message-----
>> From: Marek Vasut <marex@denx.de>
>> Sent: Friday, March 17, 2023 7:54 PM
>> To: Chen, Qi <Qi.Chen@windriver.com>;
>> openembedded-core@lists.openembedded.org
>> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>; Armin Kuster
>> <akuster808@gmail.com>; Bob Henz <robert_henz@jabil.com>; Kristian
>> Klausen <kristian@klausen.dk>; Nick Potenski
>> <nick.potenski@garmin.com>; Richard Purdie
>> <richard.purdie@linuxfoundation.org>
>> Subject: Re: [OE-core] [PATCH] systemd-systemctl: Create machine-id
>> with "uninitialized" text in it
>>
>> On 3/15/23 11:10, ChenQi wrote:
>>
>> Hi,
>>
>>> This patch is forcing systemd to do preset-all at boot time (first
>>> boot) in a function that simulates 'preset-all' at rootfs time.
>>>
>>> If we look at the comments above the changed line, we can see that the
>>> /etc/machine-id file was deliberately created as empty, for the
>>> purpose of making systemd not treat the system as first boot.
>>> """
>>> # If we populate the systemd links we also create
>>> /etc/machine-id, which
>>> # allows systemd to boot with the filesystem read-only before
>>> generating
>>> # a real value and then committing it back.
>>> #
>>> # For the stateless configuration, where /etc is generated at
>>> runtime
>>> # (for example on a tmpfs), this script shouldn't run at all and
>>> we
>>> # allow systemd to completely populate /etc.
>>> """
>>>
>>> I'm going to send out a patch to revert this patch.
>>
>> Hmmm, the problem is that without this patch, systemd firstboot does
>> not work and I would like to use that. How can we accommodate both
>> options, i.e. no breakage for you and working systemd-firstboot ?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH] systemd-systemctl: Create machine-id with "uninitialized" text in it
2023-03-20 2:23 ` ChenQi
@ 2023-03-20 10:21 ` Marek Vasut
0 siblings, 0 replies; 7+ messages in thread
From: Marek Vasut @ 2023-03-20 10:21 UTC (permalink / raw)
To: ChenQi, openembedded-core
Cc: Alexandre Belloni, Armin Kuster, Bob Henz, Kristian Klausen,
Nick Potenski, Richard Purdie
On 3/20/23 03:23, ChenQi wrote:
> On 3/20/23 06:55, Marek Vasut wrote:
>> On 3/17/23 15:32, Chen, Qi wrote:
>>> Hi Marek,
>>
>> Hi,
>>
>> sorry for the delay
>>
>>> I used the following line in local.conf and the firstboot worked:
>>> IMAGE_PREPROCESS_COMMAND:remove = "systemd_preset_all;"
>>
>> But doesn't that also inhibit the rootfs-time preset-all ? I would
>> like to keep that, I just need for the systemd firstboot units to run
>> on first boot to do first boot system setup things, which they won't
>> without the 'uninitialized' in /etc/machine-id .
>
>
> 1) Lacking of /etc/machine-id file also triggers firstboot.
>
> 2) systemd firstboot does 'preset-all'. If you enable firstboot, then
> you don't need rootfs-time preset-all.
All right, thank you. Please go ahead with the revert.
But can you please document this IMAGE_PREPROCESS_COMMAND:remove =
"systemd_preset_all;" somewhere at least in the commit message, so
others who run into non-working firstboot won't have to struggle with it
? Maybe even add this into the comment in 'systemctl' script ?
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-03-20 10:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-27 19:15 [PATCH] systemd-systemctl: Create machine-id with "uninitialized" text in it Marek Vasut
2023-03-15 10:10 ` [OE-core] " ChenQi
2023-03-17 11:53 ` Marek Vasut
2023-03-17 14:32 ` Chen, Qi
2023-03-19 22:55 ` Marek Vasut
2023-03-20 2:23 ` ChenQi
2023-03-20 10:21 ` Marek Vasut
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.