How to make boot text colorfull

Asked by Jayanga Kaushalya

I want to make my boot text with colors. I just tried to print [ OK ] in green. I edited the lsb-base-loggin.sh as followed but it only works fine when pc is going to halt(Shutting down). But in the boot , it only colors the OK in front of apparmour. Is this a bug or somthing I am doing incorrect. I am using Ubuntu 13.04

lsb-base-logging.sh:

log_end_msg () {
        if [ -z "$1" ]; then
            return 1
        fi

        if [ "$COL" ] && [ -x "$TPUT" ]; then
            # If plymouth is running, print previously stored output
            # to avoid buffering problems (LP: #752393)
            if log_use_plymouth; then
                if [ -n "$LOG_DAEMON_MSG" ]; then
                    log_daemon_msg $LOG_DAEMON_MSG
                    LOG_DAEMON_MSG=""
                fi
            fi

            printf "\r"
            $TPUT hpa $COL
            if [ "$1" -eq 0 ]; then
                $TPUT setaf 4 # blue
                printf '[ '
                $TPUT setaf 2 # green
                printf OK
                $TPUT setaf 4 # blue
                echo ' ]'
                $TPUT op # normal
            else
                printf '['
                $TPUT setaf 1 # red
                printf fail
                $TPUT op # normal
                echo ']'
            fi
        else
            if [ "$1" -eq 0 ]; then
                echo " ...done."
            else
                echo " ...fail!"
            fi
        fi
        return $1
    }

Boot log: http://i.stack.imgur.com/2zOi6.png

Question information

Language:
English Edit question
Status:
Open
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
daniel CURTIS (anoda) said :
#1

Hi Jayanga. Please try these advices; http://ubuntuforums.org/showthread.php?t=50054 Generally, you will have to edit two files: '/boot/grub/menu.lst' and '/lib/lsb/init-functions'.

Best regards.

Revision history for this message
Jayanga Kaushalya (jkaushalya) said :
#2

Thanks for the answer, but this works only in older ubuntu versions. This method will not work in new versions with upstart. There must be some other way to color [OK]s' printed by the upstart.

Revision history for this message
daniel CURTIS (anoda) said :
#3

OK, I'm also trying to do the same thing :-) If you manage to solve this issue, please let me know. Best regards.

Can you help with this problem?

Provide an answer of your own, or ask Jayanga Kaushalya for more information if necessary.

To post a message you must log in.