mirror of
https://github.com/brain-hackers/brain-config.git
synced 2024-12-22 20:20:06 +09:00
New method for testing whether serial is enabled.
This commit is contained in:
parent
ba7865c9f4
commit
2c138cf97e
16
raspi-config
16
raspi-config
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user