Ubuntu 20 LTS. How to adjust serial-getty@ttyAMA0.service timeouts?

cn flag

I am running the ARM64 build of Ubuntu 20.04 under QEMU. ~50% of the time the boot process reports this:

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

which means there is no login prompt in the QEMU terminal. SSH access is then required to start the daemon manually:

$ sudo systemctl start serial-getty@ttyAMA0.service

How can I fix this? And where/how do I set a longer timeout value?

Many thanks.

[Added] See for a full set of scripts to reproduce the issue

The answer suggested here for Centos does not work.

System details follow.

$ sudo systemctl show serial-getty@ttyAMA0.service | grep ^Tim 
TimeoutStartUSec=1min 30s
TimeoutStopUSec=1min 30s
TimeoutAbortUSec=1min 30s

$ lsb_release -a && uname -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
Linux miniarm64 5.4.0-96-generic #109-Ubuntu SMP Wed Jan 12 18:07:25 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux

$ qemu-system-aarch64 --version
QEMU emulator version 4.2.1 (Debian 1:4.2-3ubuntu6.19)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.