WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to install getFlash?  (Read 7038 times)

Offline fredand44

  • Newbie
  • *
  • Posts: 21
How to install getFlash?
« 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

What do you think guys?

Best regards
Fredrik



Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11628
Re: How to install getFlash?
« Reply #1 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

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to install getFlash?
« Reply #2 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

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11628
Re: How to install getFlash?
« Reply #3 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?

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: How to install getFlash?
« Reply #4 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.
« Last Edit: January 11, 2012, 04:56:06 PM by maro »

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: How to install getFlash?
« Reply #5 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?  :)

32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to install getFlash?
« Reply #6 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.

Offline Lee

  • Hero Member
  • *****
  • Posts: 645
    • My Core wiki user page
Re: How to install getFlash?
« Reply #7 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.
32 bit core4.7.7, Xprogs, Xorg-7.6, wbar, jwm  |  - Testing -
PPR, data persistence through filetool.sh          |  32 bit core 8.0 alpha 1
USB Flash drive, one partition, ext2, grub4dos  | Otherwise similar

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: How to install getFlash?
« Reply #8 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.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to install getFlash?
« Reply #9 on: January 11, 2012, 06:43:50 PM »
You are right Lee.

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: How to install getFlash?
« Reply #10 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

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to install getFlash?
« Reply #11 on: January 11, 2012, 08:09:52 PM »
TCEDIR=$(readlink /etc/sysconfig/tcedir) || TCEDIR=$(cat /opt/.tce_dir)
« Last Edit: January 11, 2012, 08:11:42 PM by gerald_clark »

Offline Jason W

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 9730
Re: How to install getFlash?
« Reply #12 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.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11628
Re: How to install getFlash?
« Reply #13 on: January 11, 2012, 08:23:46 PM »
Hi maro
Thank you for your clear and concise explanation.

Offline fredand44

  • Newbie
  • *
  • Posts: 21
Re: How to install getFlash?
« Reply #14 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