Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: minglin on March 26, 2017, 11:13:50 PM

Title: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: minglin on March 26, 2017, 11:13:50 PM
I install TinyCore-current and Boot ok, after I click [Exit]-->Shutdown, the screen is cleared and showing:
Syncing all filesystems.
Disabling swap space.
......
Shutdown in progress.

But if I append console=ttyS0 in order to avoid booting messages show on screen, then after I click [Exit]-->Shutdown, the screen is not cleared and all shutdown messages were not shown too. This will confused user whether shutdown is completed or not.

I want append console=ttyS0 and see shutdowm messages show on screen. Can I do this and how? Thanks in advance.
Title: Re: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: curaga on March 27, 2017, 01:12:45 AM
It may be possible to change the console at runtime, though I don't know how.
Title: Re: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: minglin on March 27, 2017, 08:31:50 PM
Yes, I have the same idea to change the console after boot to solve this problem, but unfortunately I can not find the way to do it too. So I need help from this forum. Thanks!
Title: Re: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: Rich on March 27, 2017, 09:39:14 PM
Hi minglin
I want append console=ttyS0 and see shutdowm messages show on screen. Can I do this and how? Thanks in advance.
Actually, it sounds like what you really want to do is suppress the kernel messages. Maybe try setting  loglevel  to 0 or 1
instead.
Title: Re: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: minglin on March 28, 2017, 10:42:20 PM
I have tried Richs suggestion to set loglevel to 0 and 1, but this way is still useless. I am thinking whether this is a bug or not?
Title: Re: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: polikuo on March 28, 2017, 11:21:12 PM
I have tried Richs suggestion to set loglevel to 0 and 1, but this way is still useless. I am thinking whether this is a bug or not?
Hi, use "quiet" instead of "loglevel=1"
Title: Re: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: minglin on March 29, 2017, 01:38:57 AM
Actually, "quiet" is already set in extlinux.conf in the beginning.
Title: Re: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: Rich on March 29, 2017, 07:32:02 AM
Hi minglin
I have tried Richs suggestion to set loglevel to 0 and 1, but this way is still useless. I am thinking whether this is a bug or not?
Not a bug, I misunderstood the problem. I thought you were referring to kernel messages. The messages you are seeing come
from  /etc/init.d/tc-config  which is the startup script.
Title: Re: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: minglin on March 29, 2017, 08:37:27 PM
Yes, thank Rich very much. Now I am happy to learn more about TinyCore and it is close to solve my problem. Is it possible to make my own tc-config without echo and make it persistence? I think "Make Extensions for Settings" seems not early enough to replace it.
Title: Re: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: Rich on March 29, 2017, 09:39:17 PM
Hi minglin
It's a big script. You'd have to edit out all the echo statements. There might be one or two scripts called by  tc-config  that get
backgrounded, though if they have echo statements I don't know if they'll reach the console. Once you've edited copies of any
scripts, you'll need to unpack the initrd and replace the scripts in there and repack it.

I read somewhere that a splash screen is the way to hide startup messages. Someone on this forum worked on implementing
that. Go to the forums search page:
http://forum.tinycorelinux.net/index.php?action=search
and search for  plymouth.
Title: Re: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: minglin on April 10, 2017, 01:53:45 AM
Thanks Rich.
I vi tc-config to redirect message to /dev/null and also vi motd to be an empty file and then make my own core.gz. It works!
But there are still many kernel messages can not hide.

My another question is :
If I add console=/dev/null in extlinux.conf, is it possible that I use "setconsole" to restore console=/dev/tty1 after booting?
Thanks again.
Title: Re: rc.shutdown can not clear and echo after console=ttyS0 is set
Post by: Rich on April 10, 2017, 05:10:28 AM
Hi minglin
Wow, that certainly looks promising. According to its help:

Code: [Select]
tc@box:~$ setconsole --help
BusyBox v1.19.3 (2011-10-30 01:47:29 UTC) multi-call binary.

Usage: setconsole [-r|--reset] [DEVICE]

Redirect system console output to DEVICE (default: /dev/tty)

        -r      Reset output to /dev/console

tc@box:~$

That looks like it does exactly what you are looking for. Try:

Code: [Select]
setconsole -r
to reset the console back to its default.