From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: "André Draszik" <git@andred.net>,
openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] sysvinit-inittab: support non-busybox-getty on serial consoles
Date: Fri, 08 Feb 2019 14:07:42 +0000 [thread overview]
Message-ID: <c637a3a45fb3d5f40e22a54f59649908f5500794.camel@linuxfoundation.org> (raw)
In-Reply-To: <20190208120210.31861-1-git@andred.net>
On Fri, 2019-02-08 at 12:02 +0000, André Draszik wrote:
> From: André Draszik <andre.draszik@jci.com>
>
> Busybox' getty has code to try to make itself a session leader,
> whereas util-linux' agetty doesn't. It expects this to happen
> from outside.
> When getty is not a session leader, many things don't work on
> the serial console, e.g. setting the terminal process group,
> job control doesn't work, etc.
>
> Executing image tests also fails with AssertionErrors, because
> Feb 5 16:12:55 qemuarm getty[590]: /dev/ttyAMA1: cannot get
> controlling tty: Operation not permitted
> Feb 5 16:12:55 qemuarm getty[590]: /dev/ttyAMA1: cannot set
> process group: Inappropriate ioctl for device
>
> Update the start_getty script to invoke getty via the setsid
> utility if needed, i.e. if /sbin/getty is not busybox getty.
>
> [YOCTO #13058]
>
> Signed-off-by: André Draszik <andre.draszik@jci.com>
> ---
> meta/recipes-core/sysvinit/sysvinit-inittab/start_getty | 9
> ++++++++-
> meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | 1 +
> 2 files changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
> b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
> index e15ae35f90..ae613f1e54 100644
> --- a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
> +++ b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty
> @@ -13,6 +13,13 @@ active_serial=$(grep "serial" /proc/tty/drivers |
> cut -d/ -f1 | sed "s/ *$//")
> # Rephrase input parameter from ttyS target index (ttyS1, ttyS2,
> ttyAMA0, etc).
> runtime_tty=$(echo $2 | grep -oh '[0-9]')
>
> +# busybox' getty does this itself, util-linux' getty needs extra
> help
> +getty="/sbin/getty"
> +if ! basename $(readlink -f "${getty}") | grep -q busybox \
> + && [ -x "/usr/bin/setsid" ] ; then
> + getty="/usr/bin/setsid ${getty}"
> +fi
The reason I'm reluctant to take changes like this is you just added 3
fork calls above. This does have a significant effect on boot time on
slower devices.
Is there a way we can do a shell string comparison rather than using
grep? case statement maybe?
Cheers,
Richard
next prev parent reply other threads:[~2019-02-08 14:07 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-08 12:02 [PATCH] sysvinit-inittab: support non-busybox-getty on serial consoles André Draszik
2019-02-08 14:07 ` Richard Purdie [this message]
2019-02-08 16:55 ` André Draszik
2019-02-08 17:47 ` Richard Purdie
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=c637a3a45fb3d5f40e22a54f59649908f5500794.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=git@andred.net \
--cc=openembedded-core@lists.openembedded.org \
/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