I believe that I have found an error in '~/.profile'. The lines at the very end read
TERMTYPE=`/bb/tty`
[ ${TERMTYPE:5:3} == "tty" ] && (
[ -f /etc/sysconfig/text ] ||
[ -e /tmp/.X11-unix/X0 ] ||
[ -f /usr/bin/Xorg ] ||
[ -f /usr/local/bin/Xvesa ] &&
startx
)
As far as I understand, ''startx'' should only be called if
- '~/.profile' is called from a TTY
- '/etc/sysconfig/text' does not exist
- '/tmp/.X11-unix/X0' does not (yet) exist as an empty file
- either '/usr/bin/Xorg' or /usr/local/bin/Xves' do exist
Maybe I am wrong in the details here but nevertheless my test shows that a graphical desktop is started even if '/etc/sysconfig/text' does exist (created through specifying the boot-option "text"). This clearly is not the expected behavior if "text" should boot into text-only mode.
As far as I understand, the following could work (notice the moved opening parenthesis):
TERMTYPE=`/bb/tty`
[ ${TERMTYPE:5:3} == "tty" ] &&
[ -f /etc/sysconfig/text ] ||
[ -e /tmp/.X11-unix/X0 ] ||
( [ -f /usr/bin/Xorg ] ||
[ -f /usr/local/bin/Xvesa ] &&
startx
)
Again, I am not sure if I am right here so maybe somebody will have to correct me. (For instance, in the course of trying to understand the logic I found out that logical operators in the shell do not have any algebraic precedence but are evaluated left to right.
)