public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 0/1] enable-fsck: Run after udev devices coldplugged
@ 2022-02-18  5:37 Uladzimir Bely
  2022-02-18  5:37 ` [PATCH 1/1] " Uladzimir Bely
  2022-02-25  6:12 ` [PATCH 0/1] " Anton Mikanovich
  0 siblings, 2 replies; 3+ messages in thread
From: Uladzimir Bely @ 2022-02-18  5:37 UTC (permalink / raw)
  To: isar-users

Earlier patch removing `update-initramfs` call from enable-fsck script
(`enable-fsck: don't run update-initramfs after fstab modification`)
discovered a bug that happens in arm/arm64 qemu targets.

Without running `update-initramfs`, this one-time service is executed
now very quickly and it creates terms when systemd can't find `ttyAMA0`
device and is unable to run serial getty on it.

Failed log:
| [ TIME ] Timed out waiting for device /dev/ttyAMA0.
| [DEPEND] Dependency failed for Serial Getty on ttyAMA0.

Normal (expected) log:
| [  OK  ] Found device /dev/ttyAMA0.
| [  OK  ] Started Serial Getty on ttyAMA0.

There is no direct relation between device handling and `enable-fsck`,
but enabling this "fast" service, due its "After" and "Before" service
dependencies leads to this device issue.

There are 3 possible situations:

1. `enable-fsck` is disabled:
 - Boot is OK in this case

2. `enable-fsck` is enabled and executed fast (only fstab modified):
 - Boot fails, device `/dev/ttyAMA0` is not found by systemd

3. `enable-fsck` is enabled and executed slow (can be simply achieved
by adding "sleep 10" to `/usr/share/enable-fsck/enable-fsck.sh`:
 - Boot is OK in this case

Case 3 earlier was the main case, while "update-initramfs" was that
slow operation that was "fixing" the issue.

The problem looks like some race in services. It is probably related
to Debian and/or Qemu.

The patch below is a workaround that adds some udev dependency to the
`enable-fsck` service, so it now runs after udev devices coldplugged.

Uladzimir Bely (1):
  enable-fsck: Run after udev devices coldplugged

 meta/recipes-support/enable-fsck/files/enable-fsck.service | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] enable-fsck: Run after udev devices coldplugged
  2022-02-18  5:37 [PATCH 0/1] enable-fsck: Run after udev devices coldplugged Uladzimir Bely
@ 2022-02-18  5:37 ` Uladzimir Bely
  2022-02-25  6:12 ` [PATCH 0/1] " Anton Mikanovich
  1 sibling, 0 replies; 3+ messages in thread
From: Uladzimir Bely @ 2022-02-18  5:37 UTC (permalink / raw)
  To: isar-users

This workarounds a problem when CI fails for arm/arm64 due to timeout on
finding ttyAMA0 device by systemd. So, serial getty fails to start.

This problem appears only if enable-fsck recipe is included to build. It
looks like its "After" and "Before" service dependencies somehow break
device appearing.

If enable-fsck service is delayed a bit (placed after device coldplug
finished) problem gets resolved. But it's actually looks like a
workaround for some issue specific to qemu/bullseye.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/recipes-support/enable-fsck/files/enable-fsck.service | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-support/enable-fsck/files/enable-fsck.service b/meta/recipes-support/enable-fsck/files/enable-fsck.service
index 846497d1..8b33cdb9 100644
--- a/meta/recipes-support/enable-fsck/files/enable-fsck.service
+++ b/meta/recipes-support/enable-fsck/files/enable-fsck.service
@@ -7,7 +7,7 @@
 Description=Enable fsck for mounted devices
 DefaultDependencies=no
 Conflicts=shutdown.target
-After=systemd-remount-fs.service
+After=systemd-remount-fs.service systemd-udev-trigger.service
 Before=sysinit.target shutdown.target
 ConditionPathIsReadWrite=/etc
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/1] enable-fsck: Run after udev devices coldplugged
  2022-02-18  5:37 [PATCH 0/1] enable-fsck: Run after udev devices coldplugged Uladzimir Bely
  2022-02-18  5:37 ` [PATCH 1/1] " Uladzimir Bely
@ 2022-02-25  6:12 ` Anton Mikanovich
  1 sibling, 0 replies; 3+ messages in thread
From: Anton Mikanovich @ 2022-02-25  6:12 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

Applied to next, thanks.

18.02.2022 08:37, Uladzimir Bely wrote:
> Earlier patch removing `update-initramfs` call from enable-fsck script
> (`enable-fsck: don't run update-initramfs after fstab modification`)
> discovered a bug that happens in arm/arm64 qemu targets.
>
> Without running `update-initramfs`, this one-time service is executed
> now very quickly and it creates terms when systemd can't find `ttyAMA0`
> device and is unable to run serial getty on it.
>
> Failed log:
> | [ TIME ] Timed out waiting for device /dev/ttyAMA0.
> | [DEPEND] Dependency failed for Serial Getty on ttyAMA0.
>
> Normal (expected) log:
> | [  OK  ] Found device /dev/ttyAMA0.
> | [  OK  ] Started Serial Getty on ttyAMA0.
>
> There is no direct relation between device handling and `enable-fsck`,
> but enabling this "fast" service, due its "After" and "Before" service
> dependencies leads to this device issue.
>
> There are 3 possible situations:
>
> 1. `enable-fsck` is disabled:
>   - Boot is OK in this case
>
> 2. `enable-fsck` is enabled and executed fast (only fstab modified):
>   - Boot fails, device `/dev/ttyAMA0` is not found by systemd
>
> 3. `enable-fsck` is enabled and executed slow (can be simply achieved
> by adding "sleep 10" to `/usr/share/enable-fsck/enable-fsck.sh`:
>   - Boot is OK in this case
>
> Case 3 earlier was the main case, while "update-initramfs" was that
> slow operation that was "fixing" the issue.
>
> The problem looks like some race in services. It is probably related
> to Debian and/or Qemu.
>
> The patch below is a workaround that adds some udev dependency to the
> `enable-fsck` service, so it now runs after udev devices coldplugged.
>
> Uladzimir Bely (1):
>    enable-fsck: Run after udev devices coldplugged
>
>   meta/recipes-support/enable-fsck/files/enable-fsck.service | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-02-25  6:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-18  5:37 [PATCH 0/1] enable-fsck: Run after udev devices coldplugged Uladzimir Bely
2022-02-18  5:37 ` [PATCH 1/1] " Uladzimir Bely
2022-02-25  6:12 ` [PATCH 0/1] " Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox