aboutsummaryrefslogtreecommitdiff
path: root/meta-linaro
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2013-10-10 14:18:37 +0300
committerFathi Boudra <fathi.boudra@linaro.org>2013-10-10 14:23:24 +0300
commit1951d3b8b34aaf3ed3f496297d298c8ecaa2c692 (patch)
treed374a5ec16f4665985184d60330d31f63f57dd79 /meta-linaro
parent1eaada958f76a6c72e61e9c9ef52891b98082873 (diff)
auto-serial-console: fix auto-getty hardcodes device names (LP: #1233786)
The auto-getty script is very badly behaved, as it assumes that the console on which to run getty must be called tty*. While this is true most of the time, this doesn't fly at all when using a paravirtualized console (the standard hvc console, for example). You end up with a booted guest and no way to interact with it. The attached patch tries to work around this issue and parse /etc/securetty to find out if the device passed on the kernel command line has been vetted for root use. If so, there is no reason to prevent getty from running on this console. It also fix a very silly bug where GETTY_ARGS will forever expand each time getty is re-spawned. Change-Id: I6109d48bca13850cf90a37f11fd9aa24ce2dba43 Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'meta-linaro')
-rwxr-xr-xmeta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-getty8
1 files changed, 5 insertions, 3 deletions
diff --git a/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-getty b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-getty
index 05d8fb62..97efb9d3 100755
--- a/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-getty
+++ b/meta-linaro/recipes-linaro/auto-serial-console/auto-serial-console/auto-getty
@@ -10,9 +10,10 @@ while true; do
console=*)
tty=${arg#console=}
tty=${tty#/dev/}
+ secure=`echo "${tty}" | cut -f1 -d,`
+ secure=`/bin/egrep "^${secure}$" /etc/securetty`
- case $tty in
- tty[a-zA-Z]* )
+ if [ -n "$tty" -a -n "${secure}" ]; then
PORT=${tty%%,*}
tmp=${tty##$PORT,}
@@ -30,7 +31,8 @@ while true; do
GETTY_ARGS="$AUTOGETTY_ARGS $GETTY_ARGS $SPEED $PORT"
/sbin/getty $GETTY_ARGS
- esac
+ unset GETTY_ARGS
+ fi
esac
done
done