Skip to content
Snippets Groups Projects
Commit 705ea75c authored by Tobias Kahlki's avatar Tobias Kahlki
Browse files

helper: Add script to enable/disable the standard output on the terminal

This is required by some tests that exchange data on the default tty.

MODV-98
parent 2340d9b2
No related branches found
No related tags found
1 merge request!294Add script to enable/disable the default output on the terminal
#!/bin/sh
# @TODO: What about USB serial? Will it still work?
print_help() {
echo "Usage: config_debug_serial.sh {enable|disable|help}"
}
if [ ! $# -eq 1 ]; then
print_help
exit 1
fi
# @TODO: Check for /boot
# Backup default config before changing it
if [ ! -e /boot/boot.cfg.bak ]; then
cp /boot/boot.cfg /boot/boot.cfg.bak
fi
if [ "$1" = "enable" ]; then
# Enable Kernel output
sed -i -e 's/ quiet//' -e 's/console=\S*/console=ttymxc0,115200/' /boot/boot.cfg
# Enable auto spawning of getty
systemctl unmask serial-getty@.service
elif [ "$1" = "disable" ]; then
# Disable Kernel output
#
# Note: Always try to remove the quiet
# argument, because it might be added
# twice when calling 'disable' more than
# one time.
sed -i -e 's/ quiet//' -e 's/console=\S*/console=ttynull quiet/' /boot/boot.cfg
# Disable auto spawning of getty
systemctl mask serial-getty@.service
else
print_help
exit 1
fi
echo "INFO: Please reboot the device for the change to take effect"
exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment