New method for testing whether serial is enabled.

This commit is contained in:
spl 2016-05-06 14:47:12 +01:00 committed by Serge Schneider
parent ba7865c9f4
commit 2c138cf97e

View File

@ -680,6 +680,22 @@ do_i2c() {
modprobe i2c-dev
}
get_serial() {
if ! grep -q "ttyAMA" /proc/cmdline ; then
if ! grep -q -E "^enable_uart=1" $CONFIG; then
echo 1
else
echo 0
fi
else
if ! grep -q -E "^enable_uart=0" $CONFIG; then
echo 0
else
echo 1
fi
fi
}
do_serial() {
DEFAULT=
CUR_SERIAL=$(get_serial)