Tiny Core Linux

dCore Import Debian Packages to Mountable SCE extensions => dCore X86 => Topic started by: sm8ps on December 17, 2015, 07:34:44 AM

Title: Error in .profile?
Post by: sm8ps on December 17, 2015, 07:34:44 AM
I believe that I have found an error in '~/.profile'. The lines at the very end read
Code: [Select]
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
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):
Code: [Select]
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.  :o)
Title: Re: Error in .profile?
Post by: Jason W on December 17, 2015, 02:02:11 PM
You are right.  Tested it, works like a charm!

Thanks, I will upload a new release candidate today.
Title: Re: Error in .profile?
Post by: Jason W on December 17, 2015, 04:20:33 PM
Fixed in the latest release candidate.
Title: Re: Error in .profile?
Post by: sm8ps on December 17, 2015, 05:36:24 PM
Proud happy noob me!  ;D
Gonna test it soon but almost certainly only after the holidays.
Early season's greetings to everybody involved in this nifty project!
sm