FS#8843 - [initscripts-2007.11-2] no colors in rc.sysinit when /usr is on a separate partition

Attached to Project: Arch Linux
Opened by Roman Kyrylych (Romashka) - Wednesday, 05 December 2007, 15:27 GMT
Last edited by Roman Kyrylych (Romashka) - Thursday, 28 February 2008, 10:28 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Aaron Griffin (phrakture)
Thomas Bächler (brain0)
Roman Kyrylych (Romashka)
Architecture All
Severity Low
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

When /usr is on a separate partition user will see no colors until a first output of rc.multi (first daemon starts)
This is because `tput colors` cannot find terminal 'linux' because /etc/rc.d/functions is sourced at the top of rc.sysinit when /usr/share/terminfo doesn't exist yet (/usr is not mounted).
When tput cannot find terminal it returns 3 as exit code while TERM_COLORS is assigned an empty string, thus -n $TERM_COLORS fails and USECOLOR is reset.

On the next sourcing of /etc/rc.d/functions (which happens in rc.multi) everything is OK because /usr is mounted.

P.S.: this one was hard to track, we've spent almost a hour on #archlinux-ua trying to catch it, including >10 reboots. :-)
This task depends upon

Closed by  Roman Kyrylych (Romashka)
Thursday, 28 February 2008, 10:28 GMT
Reason for closing:  Fixed
Comment by Roman Kyrylych (Romashka) - Wednesday, 05 December 2007, 15:39 GMT
Attaching the patch. Successfully tested and confirmed.
Thomas, please check it on some weird terminal(s) (for which that change between 2007.11-1 and 2007.11-2 was made).
Comment by Aaron Griffin (phrakture) - Wednesday, 12 December 2007, 16:30 GMT
Roman I made a minor change without testing. I don't know if it works or not, but I will test this one tonight

http://code.phraktured.net/?p=initscripts.git;a=commitdiff;h=24da9b477fa1fc813950ff3401bb4054d045eae5

For the record, a quick way to test would be to rename your terminfo directory so that tput errors.
Comment by Roman Kyrylych (Romashka) - Thursday, 13 December 2007, 10:20 GMT
Your patch is mostly like mine (it just move test -n to elif instead of separate if), so it should work.
The only difference is that your patch explicitly sets USECOLORS to "Y" which may be not what user wants.
I think it's ok without USECOLORS="Y" line.
Comment by Aaron Griffin (phrakture) - Thursday, 13 December 2007, 17:17 GMT
Fair enough - fixed

Loading...