LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How do I echo colors on Slackware boot up? (https://www.linuxquestions.org/questions/linux-newbie-8/how-do-i-echo-colors-on-slackware-boot-up-506947/)

polarbear20000 12-02-2006 06:19 PM

How do I echo colors on Slackware boot up?
 
Hello, all - I seem to stumble more and more into certain "projects" that I need help with or reference to. I'm currently working with Slackware 11 - very speedy compared to the others I've kibbitzed with. However...

When I select the 'Slackware' entry from my GRUB menu, I get nothing but gray letters on a black screen while the system opens up for business. I've decided that it would be easier on me (and my eyes) if I had a way to colorize the boot processes, in something that is somewhat similar to Knoppix's start-up. I've searched, here and on Google, but either I don't yet know what to put in the search terms or what I've found doesn't seem to apply.

What do I need to be looking for or doing to make that happen? And what outputs do I need to post? And if I need to re-compile, what options do I need to select?

Much thanks.

bigrigdriver 12-04-2006 08:04 AM

The file, in SuSE at any rate, is /etc/rc.status. Here are the opening comments from that file:

Quote:

# /etc/rc.status
# Definition of boot script return messages
#
# The bootscripts should use the variables rc_done and rc_failed to
# report whether they failed or succeeded. See /etc/init.d/skeleton for
# an example how the shell functions rc_status and rc_reset are used.
#
# These functions make use of the variables rc_done and rc_failed;
# rc_done_up and rc_failed_up are the same as rc_done and rc_failed
# but contain a terminal code to move up one line before the output
# of the actual string. (This is particularly useful when the script
# starts a daemon which produces user output with a newline character)
#
# The variable rc_reset is used by the master resource control script
# /etc/init.d/rc to turn off all attributes and switch to the standard
# character set.
#
# \033 ascii ESCape
# \033[<NUM>G move to column <NUM> (linux console, xterm, not vt100)
# \033[<NUM>C move <NUM> columns forward but only upto last column
# \033[<NUM>D move <NUM> columns backward but only upto first column
# \033[<NUM>A move <NUM> rows up
# \033[<NUM>B move <NUM> rows down
# \033[1m switch on bold
# \033[31m switch on red
# \033[32m switch on green
# \033[33m switch on yellow
# \033[m switch off color/bold
# \017 exit alternate mode (xterm, vt100, linux console)
# \033[10m exit alternate mode (linux console)
# \015 carriage return (without newline)
#

polarbear20000 12-04-2006 10:15 PM

Quote:

Originally Posted by bigrigdriver
The file, in SuSE at any rate, is /etc/rc.status.

Hmmm . . . not to display my ignorance (too much so, I hope) but does Slackware use the same files as SuSE? I understand that different Linuxes might use different ways to go about the same thing, but if I should use this file or something similar, would it work? I only ask since I did not see a file or reference to this specific file in my fruitless search. Would I need to make a link to this or would the system look for it as a matter of course?

Thanks for your help - it gives me a starting point.

bigrigdriver 12-04-2006 11:19 PM

I guess the first step is to verify that you do/don't have a file called rc.status.

locate rc.status

You may have it, but in a sub-directory of /etc. Or, you may not have it.

The next text would be to search for the escape codes that determine the color output.
'# \033[31m switch on red' contains \033, so let's look for that.

find /etc -type f | xargs grep '\033'

will find every file in /etc containing that sequence. If you include the square bracket [, you will get an error message about unmatched [.

Then look through the files returned for the code sequences I provided earlier. If Slackware has any means of controling the colors, the scrpt should have those color codes, regardless of the name of the script.

Oops, forgot to mention. You may have to run find as root to be able to grep files that user doesn't have permission to view.

polarbear20000 12-06-2006 07:43 PM

No luck using any of those suggestions, although I did think that they was good.

What about "DIR_COLORS?" Isn't this what dictates directory listings, but if so, can it be used for startup in some way?


All times are GMT -5. The time now is 02:53 PM.