You are not logged in.

#1 2008-02-15 20:51:48

xchllataa
Member
Registered: 2008-01-24
Posts: 12

boot messages without color

Hello

I have a small problem with colors during booting.
From the message

INIT: version 2.86 booting

till

INIT: entering runlevel: 3

there are no colors for messages (all text is gray).

If I commented out the following text in /etc/rc.d/functions

# disable colors on broken terminals
#TERM_COLORS="$(tput colors 2>/dev/null)"
#if [ -n "${TERM_COLORS}" ]; then
#    case "${TERM_COLORS}" in
#        *[!0-9]*)
#            USECOLOR=""
#            ;;
#        *)
#            [ "${TERM_COLORS}" -lt 8 ] && USECOLOR=""
#            ;;
#    esac
#else
#    USECOLOR=""
#fi
#unset TERM_COLORS

then everything works fine. But it does not seem to be a correct solution smile

How can I resolve this problem properly?

Offline

#2 2008-02-15 21:04:55

PJ
Member
From: Sweden
Registered: 2005-10-11
Posts: 602

Re: boot messages without color

By reading your post I am not sure wheter or not you want colors. If you don't want colors then you could use this solution:

/etc/rc.conf

USECOLOR="no"

Offline

#3 2008-02-16 07:35:23

xchllataa
Member
Registered: 2008-01-24
Posts: 12

Re: boot messages without color

I want colors and USECOLOR="yes" is in my /etc/rc.conf. The problem is that all boot messages before the line "INIT: entering runlevel: 3" are printed without colors.

Offline

#4 2008-02-16 10:40:48

judfilm
Member
Registered: 2004-02-12
Posts: 229

Re: boot messages without color

I have noticed this problem too, do you think it is bug report worthy?

Offline

#5 2008-02-16 14:09:24

xchllataa
Member
Registered: 2008-01-24
Posts: 12

Re: boot messages without color

Unfortunaly I cannot describe how to reproduce this problem sad

Offline

#6 2008-02-16 14:31:56

eerok
Member
From: Canada
Registered: 2005-03-20
Posts: 171

Re: boot messages without color

This seems pretty trivial to me.  I actually like the way the boot stages look different.  When the colors come back up I know that my filesystem is good to go.  That's just me, though.


noobus in perpetuus

Offline

#7 2008-02-16 14:32:55

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: boot messages without color

Aren't those just kernel messages? Add "quiet" to your kernel line in grub/lilo to get rid of those.

Offline

#8 2008-02-16 14:51:23

xchllataa
Member
Registered: 2008-01-24
Posts: 12

Re: boot messages without color

No, they are not kernel messages.

Offline

#9 2008-06-27 16:16:27

Demon
Member
From: Republic of Srpska, BA
Registered: 2008-03-02
Posts: 246

Re: boot messages without color

Hi!

You just need to change last USECOLOR="" to USECOLOR="yes". So that the part of the functions file will look like this:

# disable colors on broken terminals
TERM_COLORS="$(/bin/tput colors 2>/dev/null)"
if [ $? = 3 ]; then
    TERM_COLORS=8
elif [ -n "${TERM_COLORS}" ]; then
    case "${TERM_COLORS}" in
        *[!0-9]*)
            USECOLOR=""
            ;;
        *)
            [ "${TERM_COLORS}" -lt 8 ] && USECOLOR=""
            ;;
    esac
else
    USECOLOR="yes"
fi
unset TERM_COLORS

Offline

#10 2008-08-20 17:10:38

Mulac
Member
Registered: 2008-02-03
Posts: 29

Re: boot messages without color

Is it possible to change the color pattern there ?

edit: better yet, is it correct place to change (in rc.d/functions):

# colors:
if [ "$USECOLOR" = "YES" -o "$USECOLOR" = "yes" ]; then
    C_MAIN="\033[1;37;40m"      # main text
    C_OTHER="\033[1;34;40m"     # prefix & brackets
    C_SEPARATOR="\033[1;30;40m" # separator

    C_BUSY="\033[0;36;40m"      # busy
    C_FAIL="\033[1;31;40m"      # failed
    C_DONE="\033[1;37;40m"      # completed
    C_BKGD="\033[1;35;40m"      # backgrounded

    C_H1="\033[1;37;40m"        # highlight text 1
    C_H2="\033[1;36;40m"        # highlight text 2

    C_CLEAR="\033[1;0m"
fi

edit 2: checked, that's the way (in case someone would need this)

Last edited by Mulac (2008-08-20 18:14:10)

Offline

#11 2008-12-23 12:35:01

minus
Member
Registered: 2007-12-20
Posts: 21

Re: boot messages without color

Hello,
I had the same problem and I found out that it was a problem because at the beginning of the boot process my / filesystem was readonly. My dirty fix is replacing TERM_COLORS="$(/bin/tput colors 2>/dev/null)" in /etc/rc.d/functions with TERM_COLORS="$(/bin/tput colors)". The problem was that with readonly filesystem no error output can be transmitted to /dev/null.

Flo

Offline

Board footer

Powered by FluxBB