diff options
author | Yuki Hoshino <yuki.hoshino@miraclelinux.com> | 2020-06-12 08:16:57 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-15 14:53:45 +0100 |
commit | 8540eca6cd029e52a81c485647de6ecb203c2d7d (patch) | |
tree | 5d57b392326ecc0fbec57d3e858a8e9240fa5ad3 /meta/recipes-core | |
parent | eb226b897fcba0ec1d94e15957e714d241931813 (diff) | |
download | poky-8540eca6cd029e52a81c485647de6ecb203c2d7d.tar.gz |
sysvinit-inittab: Add support for tty devices with 10 or more number.
"start_getty" support for tty devices with under 10 number.
When SERIAL_CONSOLES has tty devices with 10 or more number,
do not't start getty and output the following message.
----------
sh 1: unknown operand
----------
(From OE-Core rev: 39dc49523f5d24db8f8053444c543c371c32d10c)
Signed-off-by: Yuki Hoshino <yuki.hoshino@miraclelinux.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/sysvinit/sysvinit-inittab/start_getty | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty index 96fd6cfcfd..dfa799adac 100644 --- a/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty +++ b/meta/recipes-core/sysvinit/sysvinit-inittab/start_getty | |||
@@ -11,7 +11,7 @@ | |||
11 | active_serial=$(grep "serial" /proc/tty/drivers | cut -d/ -f1 | sed "s/ *$//") | 11 | active_serial=$(grep "serial" /proc/tty/drivers | cut -d/ -f1 | sed "s/ *$//") |
12 | 12 | ||
13 | # Rephrase input parameter from ttyS target index (ttyS1, ttyS2, ttyAMA0, etc). | 13 | # Rephrase input parameter from ttyS target index (ttyS1, ttyS2, ttyAMA0, etc). |
14 | runtime_tty=$(echo $2 | grep -oh '[0-9]') | 14 | runtime_tty=$(echo $2 | grep -oh '[0-9]\+') |
15 | 15 | ||
16 | # busybox' getty does this itself, util-linux' agetty needs extra help | 16 | # busybox' getty does this itself, util-linux' agetty needs extra help |
17 | getty="/sbin/getty" | 17 | getty="/sbin/getty" |
@@ -36,7 +36,7 @@ for line in $active_serial; do | |||
36 | then | 36 | then |
37 | # Remove all unknown entries and discard the first line (desc). | 37 | # Remove all unknown entries and discard the first line (desc). |
38 | activetty=$(grep -v "unknown" "/proc/tty/driver/$line" \ | 38 | activetty=$(grep -v "unknown" "/proc/tty/driver/$line" \ |
39 | | tail -n +2 | grep -oh "^\s*\S*[0-9]") | 39 | | tail -n +2 | grep -oh "^\s*\S*[0-9]\+") |
40 | for active in $activetty; do | 40 | for active in $activetty; do |
41 | # If indexes do match then enable the serial console. | 41 | # If indexes do match then enable the serial console. |
42 | if [ $active -eq $runtime_tty ] | 42 | if [ $active -eq $runtime_tty ] |