Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: fredand44 on January 11, 2012, 08:53:53 AM
-
Hello Guys!
I recently installed CorePlus and so far I'm amazed by it.
But I got a problem when I try to install getFlash for the browser.
I get this error that I miss a file or directory, see image (sorry for that it is blurry):
http://fredand44.webs.com/DSC01494.JPG (http://fredand44.webs.com/DSC01494.JPG)
What do you think guys?
Best regards
Fredrik
-
This may be because /opt/.tce_dir was changed to /etc/sysconfig/tcedir and some of the scripts
still need to be updated. Until Jason W has a chance to look at it, you could try creating a link to it:
sudo ln -s /etc/sysconfig/tcedir /opt/.tce_dir
-
I don't think a link will work, as one is a link and the other is a data file.
Instead:
echo "/etc/sysconfig/tcedir" > /opt/.tce_dir
-
H gerald_clark
If I ln -s file.txt xyz and then enter cat xyz I get the contents of file.txt.
If I cp xyz file2.txt I wind up with a second file identical to file.txt. What am I missing here?
-
... What am I missing here?
AFAIK you are missing the point that in the past the location of the TCE directory was stored in '/opt/.tce_dir' (as a text string):
tc@box:~$ version
tinycore_4.1
tc@box:~$ ls -l /opt/.tce_dir
-rw-rw-r-- 1 tc staff 9 Jan 11 21:45 /opt/.tce_dir
tc@box:~$ cat /opt/.tce_dir
/tmp/tce
tc@box:~$
That meant that all scripts or programs had to read the contents of said file and then use this information.
Since Core 4.2 this has now changed insofar that there is no text file any more but a symbolic link (i.e. '/etc/sysconfig/tcedir'), which points to the TCE directory:
tc@box:~$ version
4.2
tc@box:~$ ls -l /etc/sysconfig/tcedir
lrwxrwxrwx 1 root root 8 Jan 8 16:56 /etc/sysconfig/tcedir -> /tmp/tce/
tc@box:~$ readlink /etc/sysconfig/tcedir
/tmp/tce
tc@box:~$
Therefore where in the past something like TCE=$( cat /opt/.tce_dir ) could be use to read the value into a variable from now on this would need to be changed to TCE=$( readlink /etc/sysconfig/tcedir )
I guess for scripts to be compatible with both scenarios something like:
[ -f /opt/.tce_dir ] && TCE=$( cat /opt/.tce_dir ) || TCE=$( readlink /etc/sysconfig/tcedir )
might be a way forward.
-
I had thought the idea was more to just use /etc/sysconfig/tcedir and not worry about where it points to.
On the other hand, the first thing I did (with a whole -bunch- of scripts that I've written) was to "worry about where it points to". And since I had no idea that there was a readlink command, I ended up cobbling together a homebrew function that does the same basic thing only -much- uglier. Where do you learn this sh*t? :)
-
That would be backwards. You don't check first for what should not be there.
You could
readlink /etc/sysconfig/tcedir > /opt/.tce_dir
and make sure opt/.tce_dir is in .filetool.lst and not in .xfiletool.lst.
Do a backup.
Now old broken scripts will still work.
-
Yabbut if the tce directory moves (if it is on a USB stick that is sdb on one system and sdc on another) the scripts break again. Maybe better to keep /opt/.tce_dir out of the backup and do the readlink /etc/sysconfig/tcedir > /opt/.tce_dir in /opt/bootsync.sh.
-
getFlash10 no longer has the right source url as it was changed upstream, so it is broken in that way anyway and since I did not see a url for the archived flash10 I have not tended to getFlash10.tcz. I only have time to maintain so many scripts or extensions, so I have to retire or pass on the old versions.
I will leave getFlash10 up for a week or so to see if anyone wants to maintain it, if not it needs to be pulled.
-
You are right Lee.
-
Workarounds are ok and perhaps needed in the meantime, but it will help to reply in the thread of the offending script if it exists in the programming and scripting section or open a new thread of the need to update to support both /opt/.tce_dir as well as /etc/sysconfig/tcedir. Basically something like below is what needs to be placed in the scripts to identify the TCE directory to make them compatible across past and present releases.
if readlink /etc/sysconfig/tcedir >/dev/null; then
TCEDIR="$(readlink /etc/sysconfig/tcedir)/optional"
elif [ -f /opt/.tce_dir ]; then
TCEDIR="`cat /opt/.tce_dir`/optional"
fi
-
TCEDIR=$(readlink /etc/sysconfig/tcedir) || TCEDIR=$(cat /opt/.tce_dir)
-
Even smaller and more efficient, smaller and efficient is good. :) So lets mark the scripts that need updating so as to work across all (4.x) versions.
-
Hi maro
Thank you for your clear and concise explanation.
-
Hellu amigos!
I tried the command echo "/etc/sysconfig/tcedir" > /opt/.tce_dir
...and it worked fine!
Best regards!
/Fredrik
-
hello there :)
sorry for my stupid question...
but I'm looking for Linux distro for my "media center" - HDDless computer with TV as a monitor.
the question is:
I've got the same error, echo don't work
what scripts should I edit or what to d to make flash work on TC
-
Hello!
I just tried the:
echo "/etc/sysconfig/tcedir" > /opt/.tce_dir
Correct me if I'm wrong but if it does not work, perhaps you need to edit /opt/.tce_dir manually with vi.
Best regards
Fredrik