mirror of
https://github.com/brain-hackers/brain-config.git
synced 2025-10-14 12:18:42 +09:00
New method for testing whether serial is enabled.
This commit is contained in:
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)
|
||||
|
Reference in New Issue
Block a user