* [PATCH 0/2] Mask systemd-firstboot
@ 2022-11-19 18:20 T. Schaffner
2022-11-19 18:20 ` [PATCH 1/2] " T. Schaffner
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: T. Schaffner @ 2022-11-19 18:20 UTC (permalink / raw)
To: isar-users; +Cc: florian.bezdeka, quirin.gylstorff, Tobias Schaffner
From: Tobias Schaffner <tobias.schaffner@siemens.com>
systemd-firstboot asks the user interactively for missing system configurations
like locale or hostname if not configured.
Mask this service as we do not want to depend on user interaction to allow an
image to boot.
As other packages might depend on the configurations enforced by
systemd-firstboot run it in a postproc step and warn if it misses something.
Tobias Schaffner (2):
Mask systemd-firstboot
Warn if systemd-firstboot misses configurations
meta/classes/image-postproc-extension.bbclass | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--
2.34.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 1/2] Mask systemd-firstboot
2022-11-19 18:20 [PATCH 0/2] Mask systemd-firstboot T. Schaffner
@ 2022-11-19 18:20 ` T. Schaffner
2022-11-19 18:20 ` [PATCH 2/2] Warn if systemd-firstboot misses configurations T. Schaffner
2023-02-27 4:39 ` [PATCH 0/2] Mask systemd-firstboot Uladzimir Bely
2 siblings, 0 replies; 12+ messages in thread
From: T. Schaffner @ 2022-11-19 18:20 UTC (permalink / raw)
To: isar-users; +Cc: florian.bezdeka, quirin.gylstorff, Tobias Schaffner
From: Tobias Schaffner <tobias.schaffner@siemens.com>
systemd-firstboot asks the user interactively for missing system configurations
like locale or hostname.
Disable the service as we do not want to depend on user interaction on boot.
Signed-off-by: Tobias Schaffner <tobias.schaffner@siemens.com>
---
meta/classes/image-postproc-extension.bbclass | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass
index 4a901cb..942b929 100644
--- a/meta/classes/image-postproc-extension.bbclass
+++ b/meta/classes/image-postproc-extension.bbclass
@@ -79,3 +79,14 @@ image_postprocess_sshd_key_regen() {
exit 1
fi
}
+
+ROOTFS_POSTPROCESS_COMMAND =+ "image_posprocess_disable_systemd_firstboot"
+image_posprocess_disable_systemd_firstboot() {
+ SYSTEMD_VERSION=$(sudo chroot '${ROOTFSDIR}' dpkg-query \
+ --showformat='${source:Upstream-Version}' \
+ --show systemd || echo "0" )
+
+ if dpkg --compare-versions "$SYSTEMD_VERSION" "ge" "251"; then
+ sudo chroot '${ROOTFSDIR}' systemctl mask systemd-firstboot
+ fi
+}
--
2.34.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/2] Warn if systemd-firstboot misses configurations
2022-11-19 18:20 [PATCH 0/2] Mask systemd-firstboot T. Schaffner
2022-11-19 18:20 ` [PATCH 1/2] " T. Schaffner
@ 2022-11-19 18:20 ` T. Schaffner
2022-11-22 10:04 ` Anton Mikanovich
2023-02-27 4:39 ` [PATCH 0/2] Mask systemd-firstboot Uladzimir Bely
2 siblings, 1 reply; 12+ messages in thread
From: T. Schaffner @ 2022-11-19 18:20 UTC (permalink / raw)
To: isar-users; +Cc: florian.bezdeka, quirin.gylstorff, Tobias Schaffner
From: Tobias Schaffner <tobias.schaffner@siemens.com>
systemd-firstboot checks the existence of different system configurations
like locale or hostname. Debian packages may trust that these configurations
are in the location that systemd-firstboot enforced.
Warn the user in the image postproc step if systemd-firstboot misses any
configurations in the image.
Signed-off-by: Tobias Schaffner <tobias.schaffner@siemens.com>
---
meta/classes/image-postproc-extension.bbclass | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/meta/classes/image-postproc-extension.bbclass b/meta/classes/image-postproc-extension.bbclass
index 942b929..f7f762c 100644
--- a/meta/classes/image-postproc-extension.bbclass
+++ b/meta/classes/image-postproc-extension.bbclass
@@ -88,5 +88,10 @@ image_posprocess_disable_systemd_firstboot() {
if dpkg --compare-versions "$SYSTEMD_VERSION" "ge" "251"; then
sudo chroot '${ROOTFSDIR}' systemctl mask systemd-firstboot
+ if ! cmd_output=$(sudo chroot '${ROOTFSDIR}' systemd-firstboot \
+ --prompt --welcome=false </dev/null 2>/dev/null); then
+ bbwarn "Your image is not configured completely according to systemd-firstboot."
+ bbwarn "It prompted: \"${cmd_output}\""
+ fi
fi
}
--
2.34.1
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] Warn if systemd-firstboot misses configurations
2022-11-19 18:20 ` [PATCH 2/2] Warn if systemd-firstboot misses configurations T. Schaffner
@ 2022-11-22 10:04 ` Anton Mikanovich
2022-11-22 10:24 ` Florian Bezdeka
0 siblings, 1 reply; 12+ messages in thread
From: Anton Mikanovich @ 2022-11-22 10:04 UTC (permalink / raw)
To: T. Schaffner, isar-users; +Cc: florian.bezdeka, quirin.gylstorff
19.11.2022 21:20, T. Schaffner wrote
> From: Tobias Schaffner <tobias.schaffner@siemens.com>
>
> systemd-firstboot checks the existence of different system configurations
> like locale or hostname. Debian packages may trust that these configurations
> are in the location that systemd-firstboot enforced.
>
> Warn the user in the image postproc step if systemd-firstboot misses any
> configurations in the image.
>
> Signed-off-by: Tobias Schaffner <tobias.schaffner@siemens.com>
If we have a warning here, do we really need to mask the service in p1?
User should fix the reason but not hide it, and masking can be optional just
in case there are no other ways.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] Warn if systemd-firstboot misses configurations
2022-11-22 10:04 ` Anton Mikanovich
@ 2022-11-22 10:24 ` Florian Bezdeka
2023-02-23 11:43 ` Uladzimir Bely
0 siblings, 1 reply; 12+ messages in thread
From: Florian Bezdeka @ 2022-11-22 10:24 UTC (permalink / raw)
To: Anton Mikanovich, T. Schaffner, isar-users; +Cc: quirin.gylstorff
On Tue, 2022-11-22 at 13:04 +0300, Anton Mikanovich wrote:
> 19.11.2022 21:20, T. Schaffner wrote
> > From: Tobias Schaffner <tobias.schaffner@siemens.com>
> >
> > systemd-firstboot checks the existence of different system configurations
> > like locale or hostname. Debian packages may trust that these configurations
> > are in the location that systemd-firstboot enforced.
> >
> > Warn the user in the image postproc step if systemd-firstboot misses any
> > configurations in the image.
> >
> > Signed-off-by: Tobias Schaffner <tobias.schaffner@siemens.com>
>
> If we have a warning here, do we really need to mask the service in p1?
> User should fix the reason but not hide it, and masking can be optional just
> in case there are no other ways.
I didn't have the time to review the patches in detail yet, so I might
be wrong. But: If systemd-firstboot is enabled (not masked) and we miss
one of the config settings that it checks the image won't boot up.
It will enter a interactive mode and ask you questions on how to
configure your system (locale, keyboard layout, ...). Especially for CI
and embedded systems that's a real issue.
So I guess the idea was to simply mask systemd-firstboot (we don't like
interactive mode) and warn the user that the system might not be fully
configured.
Tobias, please correct me if need to.
Florian
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] Warn if systemd-firstboot misses configurations
2022-11-22 10:24 ` Florian Bezdeka
@ 2023-02-23 11:43 ` Uladzimir Bely
2023-02-24 11:36 ` Schaffner, Tobias
0 siblings, 1 reply; 12+ messages in thread
From: Uladzimir Bely @ 2023-02-23 11:43 UTC (permalink / raw)
To: Anton Mikanovich, T. Schaffner, isar-users
Cc: quirin.gylstorff, Florian Bezdeka
In the email from Tuesday, 22 November 2022 13:24:53 +03 user Florian Bezdeka wrote:
> On Tue, 2022-11-22 at 13:04 +0300, Anton Mikanovich wrote:
> > 19.11.2022 21:20, T. Schaffner wrote
> > > From: Tobias Schaffner <tobias.schaffner@siemens.com>
> > >
> > > systemd-firstboot checks the existence of different system configurations
> > > like locale or hostname. Debian packages may trust that these configurations
> > > are in the location that systemd-firstboot enforced.
> > >
> > > Warn the user in the image postproc step if systemd-firstboot misses any
> > > configurations in the image.
> > >
> > > Signed-off-by: Tobias Schaffner <tobias.schaffner@siemens.com>
> >
> > If we have a warning here, do we really need to mask the service in p1?
> > User should fix the reason but not hide it, and masking can be optional just
> > in case there are no other ways.
>
> I didn't have the time to review the patches in detail yet, so I might
> be wrong. But: If systemd-firstboot is enabled (not masked) and we miss
> one of the config settings that it checks the image won't boot up.
>
> It will enter a interactive mode and ask you questions on how to
> configure your system (locale, keyboard layout, ...). Especially for CI
> and embedded systems that's a real issue.
>
> So I guess the idea was to simply mask systemd-firstboot (we don't like
> interactive mode) and warn the user that the system might not be fully
> configured.
>
> Tobias, please correct me if need to.
>
> Florian
>
> >
>
>
We are still waiting for the answer, so the merge process is delayed.
Anyway, CI on recent `next` is still passed OK with the patch, so if no one against, we would merge it soon.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/2] Warn if systemd-firstboot misses configurations
2023-02-23 11:43 ` Uladzimir Bely
@ 2023-02-24 11:36 ` Schaffner, Tobias
0 siblings, 0 replies; 12+ messages in thread
From: Schaffner, Tobias @ 2023-02-24 11:36 UTC (permalink / raw)
To: Uladzimir Bely, Anton Mikanovich, isar-users
Cc: Gylstorff, Quirin, Bezdeka, Florian
On 23.02.23 12:43, Uladzimir Bely wrote:
> In the email from Tuesday, 22 November 2022 13:24:53 +03 user Florian Bezdeka wrote:
>> On Tue, 2022-11-22 at 13:04 +0300, Anton Mikanovich wrote:
>>> 19.11.2022 21:20, T. Schaffner wrote
>>>> From: Tobias Schaffner <tobias.schaffner@siemens.com>
>>>>
>>>> systemd-firstboot checks the existence of different system configurations
>>>> like locale or hostname. Debian packages may trust that these configurations
>>>> are in the location that systemd-firstboot enforced.
>>>>
>>>> Warn the user in the image postproc step if systemd-firstboot misses any
>>>> configurations in the image.
>>>>
>>>> Signed-off-by: Tobias Schaffner <tobias.schaffner@siemens.com>
>>>
>>> If we have a warning here, do we really need to mask the service in p1?
>>> User should fix the reason but not hide it, and masking can be optional just
>>> in case there are no other ways.
>>
>> I didn't have the time to review the patches in detail yet, so I might
>> be wrong. But: If systemd-firstboot is enabled (not masked) and we miss
>> one of the config settings that it checks the image won't boot up.
>>
>> It will enter a interactive mode and ask you questions on how to
>> configure your system (locale, keyboard layout, ...). Especially for CI
>> and embedded systems that's a real issue.
>>
>> So I guess the idea was to simply mask systemd-firstboot (we don't like
>> interactive mode) and warn the user that the system might not be fully
>> configured.
>>
>> Tobias, please correct me if need to.
>>
>> Florian
>>
>>>
>>
>>
>
> We are still waiting for the answer, so the merge process is delayed.
>
> Anyway, CI on recent `next` is still passed OK with the patch, so if no one against, we would merge it soon.
Hi Uladzimir,
sorry for the late reply. It behaves as Florian described it. We want to
avoid a non booting image in any case but utilize systemd-firstboot to
warn the user about possibly missing configurations.
Tobias
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Mask systemd-firstboot
2022-11-19 18:20 [PATCH 0/2] Mask systemd-firstboot T. Schaffner
2022-11-19 18:20 ` [PATCH 1/2] " T. Schaffner
2022-11-19 18:20 ` [PATCH 2/2] Warn if systemd-firstboot misses configurations T. Schaffner
@ 2023-02-27 4:39 ` Uladzimir Bely
2023-02-27 12:23 ` Cedric Hombourger
2 siblings, 1 reply; 12+ messages in thread
From: Uladzimir Bely @ 2023-02-27 4:39 UTC (permalink / raw)
To: isar-users; +Cc: Tobias Schaffner
In mail from Saturday, 19 November 2022 21:20:29 +03 user T. Schaffner wrote:
> From: Tobias Schaffner <tobias.schaffner@siemens.com>
>
> systemd-firstboot asks the user interactively for missing system
> configurations like locale or hostname if not configured.
>
> Mask this service as we do not want to depend on user interaction to allow
> an image to boot.
>
> As other packages might depend on the configurations enforced by
> systemd-firstboot run it in a postproc step and warn if it misses something.
>
> Tobias Schaffner (2):
> Mask systemd-firstboot
> Warn if systemd-firstboot misses configurations
>
> meta/classes/image-postproc-extension.bbclass | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
Merged to next, thanks
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Mask systemd-firstboot
2023-02-27 4:39 ` [PATCH 0/2] Mask systemd-firstboot Uladzimir Bely
@ 2023-02-27 12:23 ` Cedric Hombourger
2023-02-27 12:37 ` Jan Kiszka
0 siblings, 1 reply; 12+ messages in thread
From: Cedric Hombourger @ 2023-02-27 12:23 UTC (permalink / raw)
To: isar-users
[-- Attachment #1.1: Type: text/plain, Size: 996 bytes --]
On Monday, February 27, 2023 at 5:39:30 AM UTC+1 Uladzimir Bely wrote:
In mail from Saturday, 19 November 2022 21:20:29 +03 user T. Schaffner
wrote:
> From: Tobias Schaffner <tobias.s...@siemens.com>
>
> systemd-firstboot asks the user interactively for missing system
> configurations like locale or hostname if not configured.
>
> Mask this service as we do not want to depend on user interaction to
allow
> an image to boot.
This is IMO a distro/product level decision and I am not sure if Isar, as a
build-system, should make such decisions
>
> As other packages might depend on the configurations enforced by
> systemd-firstboot run it in a postproc step and warn if it misses
something.
>
> Tobias Schaffner (2):
> Mask systemd-firstboot
> Warn if systemd-firstboot misses configurations
>
> meta/classes/image-postproc-extension.bbclass | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
Merged to next, thanks
[-- Attachment #1.2: Type: text/html, Size: 1515 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Mask systemd-firstboot
2023-02-27 12:23 ` Cedric Hombourger
@ 2023-02-27 12:37 ` Jan Kiszka
2023-02-27 12:53 ` Uladzimir Bely
0 siblings, 1 reply; 12+ messages in thread
From: Jan Kiszka @ 2023-02-27 12:37 UTC (permalink / raw)
To: Cedric Hombourger, isar-users
On 27.02.23 13:23, Cedric Hombourger wrote:
>
>
> On Monday, February 27, 2023 at 5:39:30 AM UTC+1 Uladzimir Bely wrote:
>
> In mail from Saturday, 19 November 2022 21:20:29 +03 user T.
> Schaffner wrote:
> > From: Tobias Schaffner <tobias.s...@siemens.com>
> >
> > systemd-firstboot asks the user interactively for missing system
> > configurations like locale or hostname if not configured.
> >
> > Mask this service as we do not want to depend on user interaction
> to allow
> > an image to boot.
>
> This is IMO a distro/product level decision and I am not sure if Isar,
> as a build-system, should make such decisions
>
Does the current approach now prevent to re-enable it at that level -
obviously only after fixing all the issues that motivated the disabling?
Then we need to be aware of the use case, and things should be made
configurable.
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Mask systemd-firstboot
2023-02-27 12:37 ` Jan Kiszka
@ 2023-02-27 12:53 ` Uladzimir Bely
2023-02-27 12:55 ` Jan Kiszka
0 siblings, 1 reply; 12+ messages in thread
From: Uladzimir Bely @ 2023-02-27 12:53 UTC (permalink / raw)
To: Cedric Hombourger, isar-users; +Cc: Jan Kiszka
In mail from Monday, 27 February 2023 15:37:16 +03 user Jan Kiszka wrote:
> On 27.02.23 13:23, Cedric Hombourger wrote:
> > On Monday, February 27, 2023 at 5:39:30 AM UTC+1 Uladzimir Bely wrote:
> > In mail from Saturday, 19 November 2022 21:20:29 +03 user T.
> >
> > Schaffner wrote:
> > > From: Tobias Schaffner <tobias.s...@siemens.com>
> > >
> > > systemd-firstboot asks the user interactively for missing system
> > > configurations like locale or hostname if not configured.
> > >
> > > Mask this service as we do not want to depend on user interaction
> >
> > to allow
> >
> > > an image to boot.
> >
> > This is IMO a distro/product level decision and I am not sure if Isar,
> > as a build-system, should make such decisions
> >
>
> Does the current approach now prevent to re-enable it at that level -
> obviously only after fixing all the issues that motivated the disabling?
> Then we need to be aware of the use case, and things should be made
> configurable.
>
> Jan
It's possible to reenable it by local.conf:
```
ROOTFS_POSTPROCESS_COMMAND:remove =
"image_posprocess_disable_systemd_firstboot"
```
Of course, we could not to add this to ROOTFS_POSTPROCESS_COMMAND in image-
postproc-extension.bbclass by default, but leave an opportunity for
downstreams to make this :append. But it would be a kind of dead code in Isar
in this case.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 0/2] Mask systemd-firstboot
2023-02-27 12:53 ` Uladzimir Bely
@ 2023-02-27 12:55 ` Jan Kiszka
0 siblings, 0 replies; 12+ messages in thread
From: Jan Kiszka @ 2023-02-27 12:55 UTC (permalink / raw)
To: Uladzimir Bely, Cedric Hombourger, isar-users
On 27.02.23 13:53, Uladzimir Bely wrote:
> In mail from Monday, 27 February 2023 15:37:16 +03 user Jan Kiszka wrote:
>> On 27.02.23 13:23, Cedric Hombourger wrote:
>>> On Monday, February 27, 2023 at 5:39:30 AM UTC+1 Uladzimir Bely wrote:
>>> In mail from Saturday, 19 November 2022 21:20:29 +03 user T.
>>>
>>> Schaffner wrote:
>>> > From: Tobias Schaffner <tobias.s...@siemens.com>
>>> >
>>> > systemd-firstboot asks the user interactively for missing system
>>> > configurations like locale or hostname if not configured.
>>> >
>>> > Mask this service as we do not want to depend on user interaction
>>>
>>> to allow
>>>
>>> > an image to boot.
>>>
>>> This is IMO a distro/product level decision and I am not sure if Isar,
>>> as a build-system, should make such decisions
>>>
>>
>> Does the current approach now prevent to re-enable it at that level -
>> obviously only after fixing all the issues that motivated the disabling?
>> Then we need to be aware of the use case, and things should be made
>> configurable.
>>
>> Jan
>
> It's possible to reenable it by local.conf:
> ```
> ROOTFS_POSTPROCESS_COMMAND:remove =
> "image_posprocess_disable_systemd_firstboot"
> ```
>
> Of course, we could not to add this to ROOTFS_POSTPROCESS_COMMAND in image-
> postproc-extension.bbclass by default, but leave an opportunity for
> downstreams to make this :append. But it would be a kind of dead code in Isar
> in this case.
>
I agree that this switch can be a distro/project topic, but if that
switch makes sense for 99% of the cases (and it feels to me like this
ATM), then having it default-on reduces the efforts downstream.
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-02-27 12:55 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-19 18:20 [PATCH 0/2] Mask systemd-firstboot T. Schaffner
2022-11-19 18:20 ` [PATCH 1/2] " T. Schaffner
2022-11-19 18:20 ` [PATCH 2/2] Warn if systemd-firstboot misses configurations T. Schaffner
2022-11-22 10:04 ` Anton Mikanovich
2022-11-22 10:24 ` Florian Bezdeka
2023-02-23 11:43 ` Uladzimir Bely
2023-02-24 11:36 ` Schaffner, Tobias
2023-02-27 4:39 ` [PATCH 0/2] Mask systemd-firstboot Uladzimir Bely
2023-02-27 12:23 ` Cedric Hombourger
2023-02-27 12:37 ` Jan Kiszka
2023-02-27 12:53 ` Uladzimir Bely
2023-02-27 12:55 ` Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox