WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] EXIT: Could not find tce directory.  (Read 6418 times)

Offline sihorton

  • Jr. Member
  • **
  • Posts: 58
[Solved] EXIT: Could not find tce directory.
« on: January 26, 2013, 05:03:41 PM »
I have successfully built the latest release of nodejs on tinycore, now I am making my first attempt at making an extension from it. I am starting very simply with a nodejs-doc package that just contains the man page. I am trying to follow the guide at https://code.google.com/p/tcztools/:

tcz-pack nodejs-doc seems to go well but then it stops with

EXIT: Could not find tce directory.

I thought my layout might be wrong or something so I checked out the code pointed to as an example: http://code.google.com/p/tcztools/source/browse/#hg%2Ftcz-projects. I then cd to the tcz-projects directory and ran

tcz-pack -q ciopfs

same error

EXIT: Could not find tce directory, I looked in the source code of tcz-pack and this is the line giving the error:

#update Size in .info file
size="$(du -h $tmp/$name.tcz | cut -f1)"
[ "$size" ] || die "Could not get the size of $name.tcz"
must sed -i "s/^Size:.*$/Size:\t\t$size/" $name.tcz.info

#copy it to local tce dir for testing with tce-load -i
read tcedir < /opt/.tce_dir || die "Could not find tce directory."

I have a /opt/.tce_dir and I even tried creating a directory called tcedir in the folder but that did not fix the problem. What is this script trying to do and where is it looking for the tce directory and how can I fix the problem so I can build the extension?

/sihorton
« Last Edit: February 02, 2013, 02:19:54 PM by sihorton »

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11542
Re: EXIT: Could not find tce directory.
« Reply #1 on: January 26, 2013, 05:23:19 PM »
Hi sihorton
As someone recently reminded me, /opt/.tce_dir no longer exists, see:
http://forum.tinycorelinux.net/index.php/topic,14673.msg83387.html#msg83387
/opt/.tce_dir was a text file that contained the path to the tce directory. It was replace with  /etc/sysconfig/tcedir/optional
which is a link to the optional directory under tce.
« Last Edit: January 26, 2013, 08:27:05 PM by Rich »

Offline sihorton

  • Jr. Member
  • **
  • Posts: 58
Re: EXIT: Could not find tce directory.
« Reply #2 on: January 26, 2013, 07:50:39 PM »
Thanks Rich,

then just for now I can create that text file so the extension can be packaged, I guess it would not be too tricky to update the pack script in the future.

Thanks for your help

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11542
Re: EXIT: Could not find tce directory.
« Reply #3 on: January 26, 2013, 09:00:25 PM »
Hi sihorton
I think you can replace
Code: [Select]
read tcedir < /opt/.tce_dir || die "Could not find tce directory."with
Code: [Select]
tcedir=$(readlink /etc/sysconfig/tcedir) || tcedir=$(cat /opt/.tce_dir) || die "Could not find tce directory."[This should make it compatible with older as well as current versions of Tinycore. Info found here:
http://forum.tinycorelinux.net/index.php/topic,12331.msg66473.html#msg66473

Offline sihorton

  • Jr. Member
  • **
  • Posts: 58
Re: EXIT: Could not find tce directory.
« Reply #4 on: January 27, 2013, 05:04:45 AM »
Got it working! Managed to load the extension, now I will move onto the harder parts!

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11542
Re: EXIT: Could not find tce directory.
« Reply #5 on: January 27, 2013, 09:18:18 AM »
Hi sihorton
If you think what you did may help others down the road, you might want to share some details of what you did.

Offline sihorton

  • Jr. Member
  • **
  • Posts: 58
Re: EXIT: Could not find tce directory.
« Reply #6 on: January 27, 2013, 10:30:28 AM »
As a temporary fix I did the following:

created a text file at /opt/.tce_dir
which for my system had the contents:

/mnt/sda1/tce

change that string to be the path to your tce directory (it will save the extension there so you can test it). I then made that file executable

chmod +e /opt/.tce_dir

then tcz-pack succeeded!

/sihorton

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: EXIT: Could not find tce directory.
« Reply #7 on: January 28, 2013, 03:05:30 PM »
AFAIK, there is no +e option for chmod - besides from wondering what effect making a config file with a path executable could have.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline sihorton

  • Jr. Member
  • **
  • Posts: 58
Re: EXIT: Could not find tce directory.
« Reply #8 on: January 28, 2013, 03:07:06 PM »
ah of course :-)

chmod +x /opt/.tce_dir

sorry some keyboard challenges there!

Offline sihorton

  • Jr. Member
  • **
  • Posts: 58
Re: EXIT: Could not find tce directory.
« Reply #9 on: January 28, 2013, 03:10:30 PM »
The tcztools linked to from the wiki page about submitting extensions gave the error mentioned in the forum post. The reason for this is that it uses a depreciated way of finding the tce directory. By creating the text file with the path to the tce directory in the way tinycore used to do things enabled the tce-pack program (part of tcztools) to get around the error.

After that the rest of the functionality worked and I was able to submit the extension to tinycore.

/Simon

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: EXIT: Could not find tce directory.
« Reply #10 on: January 28, 2013, 03:19:21 PM »
Oh, seems my phrasing might have been a bit ambiguous...
I didn't mean to question the method - with only exception of questioning the need to make that file executable.
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline sihorton

  • Jr. Member
  • **
  • Posts: 58
Re: EXIT: Could not find tce directory.
« Reply #11 on: January 28, 2013, 03:30:39 PM »
Yes I don't understand why the file had to be executable, it is not a script it is just a text file. I was experimenting before the original post to the forum and tried many different ways to fix the problem. After I got it working Rich suggested that I share the end solution, so I installed a fresh version of tinycore to a new virtual machine and went through the steps to fix it, but it did not work I still got an error message. Then when I compared the working version to the none-working one I saw the original file was executable, I therefore made the .tce_dir executable and then tce-pack worked.

Unfortunately the reason why is kind of a mystery to me at the moment and I freely admit I am playing around with stuff I don't fully understand, but that is how I can learn new things. As this method of finding the tce directory is depreciated I did not investigate further but would be interested if a wise person can explain what the tool is doing - I am still quite basic in my understanding of bash scripts and why the fix worked!

/Simon