OpenWrt Forum Archive

Topic: Disable UART console (without recompiling the patched firmware)

The content of this topic has been archived on 19 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Disable UART console (without recompiling the patched firmware by changing Kernel cmdline "console=/dev/ttyS0 or console=/dev/ttyATH0" to "console=null") for any purpose, where requiring UART port.
1. Add the line:

/etc/sysctl.conf wrote:

kernel.printk = 0 4 1 7
...
...

2. Comment the last line:

/etc/inittab wrote:

::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
#::askconsole:/bin/ash --login

3. Install coreutils-stty(via opkg), reset terminal (tty*) to RAW mode(if you need):

/etc/rc.local wrote:

stty -F /dev/ttyATH0 4:0:18b2:0:0:0:0:0:1:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0

(or /dev/ttyS0)

4. Reboot your router.

Source.

(Last edited by Dioptimizer on 17 Dec 2013, 13:40)

Cool solution. Please write it to the wiki (maybe add to article port.serial), too.

MBS wrote:

Cool solution. Please write it to the wiki (maybe add to article port.serial), too.

A little later, when will be end political demonstrations big_smile

Also if need reinit driver of UART:

ttyS0 wrote:

echo "serial8250.0" > /sys/bus/platform/drivers/serial8250/unbind
echo "serial8250.0" > /sys/bus/platform/drivers/serial8250/bind

or

ttyATH0 wrote:

echo "ar933x-uart" > /sys/bus/platform/drivers/ar933x-uart/unbind
echo "ar933x-uart" > /sys/bus/platform/drivers/ar933x-uart/bind

(Last edited by Dioptimizer on 8 Dec 2013, 15:30)

Thanks for the wiki page.

How can-I request a password for root on console?

almost useless as the gpios are still not free. even with console redirected to null.

anarchy99 wrote:

almost useless as the gpios are still not free. even with console redirected to null.

If you have Atheros CPU on your device and to free gpios you need other.

actually this worked https://forum.openwrt.org/viewtopic.php?id=42880 so thanks anyway. only needed to grep thorugh installation for ath79_gpio_function_enable and set to ath79_gpio_function_disable for ar9331 instead of adding code to mach file.

Hi everyone
I am using ar93xx board and need to silence all messages printed on the console, as I found there are separate parts print on console:
1- uboot - can be silenced via its sources
2- early kernel messages starts with something like [    0.000000] Linux version x.x.x - ??????
3- later kernel messages - can be silenced via sysctl.conf
4- login - silenced via inittab

My problem is number 2. I tried different ways like the wiki page of how to terminate console but with no result, here are some options I tried:
- disabling early printk in ar71xx/configxxx
- changing CONFIG_CMDLINE="rootfstype=squashfs,jffs2 noinitrd console=null" in ar71xx/configxxx
- change bootargs in uboot, console=null

none of them was useful, I got confused.
Any help would be greatly appreciated.

Have the same issue - but my goal is not to deactivate messages but make sure serial port is available for writing, I'm testing it with "echo "hello" > /dev/ttyS0"  (connected over ssh)

I even tried to kill the "ash" process (it works), but there is still I/O error while writing

Any hint is appreciated

Instead use "console=null" command you can try to use "loglevel=0" and then recompile firmware (of course use pre-clean build).

P.S.
Also know kernel command "console=none" (instead null)...

write what happened pls

(Last edited by Deoptim on 15 Nov 2016, 15:01)

Deoptim wrote:

Instead use "console=null" command you can try to use "loglevel=0" and then recompile firmware (of course use pre-clean build).

P.S.
Also know kernel command "console=none" (instead null)...

write what happened pls

Thanks for your reply,
I found the problem, there is a "config-default" file in target/linux/ar71xx/generic that the command CONFIG_CMDLINE="rootfstype=squashfs,jffs2 noinitrd" was written on it. so it replaced it with the related line in config-x.x. Thus, it ignored my CONFIG_CMDLINE.
I commented that line and every thing goes well but with "loglevel=0" option not "console=null". Although, it prints some safe mode logs on console but it can be removed via commenting echo command in preinit files.

(Last edited by majid.it on 27 Nov 2016, 11:36)

mua cái anten đó ở đâu vậy?

The discussion might have continued from here.