diff options
author | Ross Burton <ross.burton@arm.com> | 2023-10-06 12:21:58 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-10-09 15:51:13 +0100 |
commit | 18a8d773c5d078f07f31d5802133de842ab1b350 (patch) | |
tree | 37dd202bdcdb7e07ec2c032a9ae439e336f7814c | |
parent | a4857688c395f6baf93f20e44cec6d1ed6745d0b (diff) | |
download | poky-18a8d773c5d078f07f31d5802133de842ab1b350.tar.gz |
sysvinit-initab: rewrite loop to generate inittab
Instead of one-letter variables and arcane sed expressions, use English
words and 'cut'.
(From OE-Core rev: de9833792dd0cfac6f17d5c733c263b976e89cf6)
(From OE-Core rev: c79f6e66283e506453d1643259d18e2d13eb10ea)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb index b1f9cb4caa..e70dc705c0 100644 --- a/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb +++ b/meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb | |||
@@ -21,14 +21,14 @@ do_install() { | |||
21 | install -m 0755 ${WORKDIR}/start_getty ${D}${base_bindir}/start_getty | 21 | install -m 0755 ${WORKDIR}/start_getty ${D}${base_bindir}/start_getty |
22 | sed -e 's,/usr/bin,${bindir},g' -i ${D}${base_bindir}/start_getty | 22 | sed -e 's,/usr/bin,${bindir},g' -i ${D}${base_bindir}/start_getty |
23 | 23 | ||
24 | set -x | 24 | CONSOLES="${SERIAL_CONSOLES}" |
25 | tmp="${SERIAL_CONSOLES}" | 25 | for s in $CONSOLES |
26 | for i in $tmp | ||
27 | do | 26 | do |
28 | j=`echo ${i} | sed s/\;/\ /g` | 27 | speed=$(echo $s | cut -d\; -f 1) |
29 | l=`echo ${i} | sed -e 's/tty//' -e 's/^.*;//' -e 's/;.*//'` | 28 | device=$(echo $s | cut -d\; -f 2) |
30 | label=`echo $l | sed 's/.*\(....\)/\1/'` | 29 | label=$(echo $device | sed -e 's/tty//' | tail --bytes=5) |
31 | echo "$label:12345:respawn:${base_bindir}/start_getty ${j} vt102" >> ${D}${sysconfdir}/inittab | 30 | |
31 | echo "$label:12345:respawn:${base_bindir}/start_getty $speed $device vt102" >> ${D}${sysconfdir}/inittab | ||
32 | done | 32 | done |
33 | 33 | ||
34 | if [ "${USE_VT}" = "1" ]; then | 34 | if [ "${USE_VT}" = "1" ]; then |