WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: rc.shutdown can not clear and echo after console=ttyS0 is set  (Read 737 times)

Offline minglin

  • WikiUser
  • *
  • Posts: 6
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.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 9591
Re: rc.shutdown can not clear and echo after console=ttyS0 is set
« Reply #1 on: March 27, 2017, 12:12:45 AM »
It may be possible to change the console at runtime, though I don't know how.
The only barriers that can stop you are the ones you create yourself.

Offline minglin

  • WikiUser
  • *
  • Posts: 6
Re: rc.shutdown can not clear and echo after console=ttyS0 is set
« Reply #2 on: March 27, 2017, 07: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!

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5430
Re: rc.shutdown can not clear and echo after console=ttyS0 is set
« Reply #3 on: March 27, 2017, 08: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.

Offline minglin

  • WikiUser
  • *
  • Posts: 6
Re: rc.shutdown can not clear and echo after console=ttyS0 is set
« Reply #4 on: March 28, 2017, 09: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?

Offline polikuo

  • Full Member
  • ***
  • Posts: 239
Re: rc.shutdown can not clear and echo after console=ttyS0 is set
« Reply #5 on: March 28, 2017, 10: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"

Offline minglin

  • WikiUser
  • *
  • Posts: 6
Re: rc.shutdown can not clear and echo after console=ttyS0 is set
« Reply #6 on: March 29, 2017, 12:38:57 AM »
Actually, "quiet" is already set in extlinux.conf in the beginning.

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5430
Re: rc.shutdown can not clear and echo after console=ttyS0 is set
« Reply #7 on: March 29, 2017, 06: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.

Offline minglin

  • WikiUser
  • *
  • Posts: 6
Re: rc.shutdown can not clear and echo after console=ttyS0 is set
« Reply #8 on: March 29, 2017, 07: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.

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5430
Re: rc.shutdown can not clear and echo after console=ttyS0 is set
« Reply #9 on: March 29, 2017, 08: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.

Offline minglin

  • WikiUser
  • *
  • Posts: 6
Re: rc.shutdown can not clear and echo after console=ttyS0 is set
« Reply #10 on: April 10, 2017, 12: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.

Offline Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5430
Re: rc.shutdown can not clear and echo after console=ttyS0 is set
« Reply #11 on: April 10, 2017, 04: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.