Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: fredand44 on January 11, 2012, 08:53:53 AM

Title: How to install getFlash?
Post 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


Title: Re: How to install getFlash?
Post by: Rich on January 11, 2012, 09:21:04 AM

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:
Code: [Select]
sudo ln -s /etc/sysconfig/tcedir /opt/.tce_dir
Title: Re: How to install getFlash?
Post by: gerald_clark on January 11, 2012, 10:57:08 AM
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
Title: Re: How to install getFlash?
Post by: Rich on January 11, 2012, 03:24:24 PM
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?
Title: Re: How to install getFlash?
Post by: maro on January 11, 2012, 04:52:47 PM
... 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):
Code: [Select]
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:
Code: [Select]
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.
Title: Re: How to install getFlash?
Post by: Lee on January 11, 2012, 05:14:32 PM
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?  :)

Title: Re: How to install getFlash?
Post by: gerald_clark on January 11, 2012, 05:16:36 PM
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.
Title: Re: How to install getFlash?
Post by: Lee on January 11, 2012, 06:17:36 PM
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.
Title: Re: How to install getFlash?
Post by: Jason W on January 11, 2012, 06:28:03 PM
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.
Title: Re: How to install getFlash?
Post by: gerald_clark on January 11, 2012, 06:43:50 PM
You are right Lee.
Title: Re: How to install getFlash?
Post by: Jason W on January 11, 2012, 08:02:44 PM
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. 

Code: [Select]
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
Title: Re: How to install getFlash?
Post by: gerald_clark on January 11, 2012, 08:09:52 PM
TCEDIR=$(readlink /etc/sysconfig/tcedir) || TCEDIR=$(cat /opt/.tce_dir)
Title: Re: How to install getFlash?
Post by: Jason W on January 11, 2012, 08:19:31 PM
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.
Title: Re: How to install getFlash?
Post by: Rich on January 11, 2012, 08:23:46 PM
Hi maro
Thank you for your clear and concise explanation.
Title: Re: How to install getFlash?
Post by: fredand44 on January 12, 2012, 12:54:24 PM
Hellu amigos!

I tried the command echo "/etc/sysconfig/tcedir" > /opt/.tce_dir
...and it worked fine!

Best regards!
/Fredrik
Title: Re: How to install getFlash?
Post by: profaner on April 15, 2012, 02:43:48 PM
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
Title: Re: How to install getFlash?
Post by: fredand44 on April 16, 2012, 02:17:23 PM
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