Tiny Core Linux
Tiny Core Extensions => TCE Talk => Topic started by: sihorton 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
-
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.
-
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
-
Hi sihorton
I think you can replace
read tcedir < /opt/.tce_dir || die "Could not find tce directory."
with
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
-
Got it working! Managed to load the extension, now I will move onto the harder parts!
-
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.
-
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
-
AFAIK, there is no +e option for chmod - besides from wondering what effect making a config file with a path executable could have.
-
ah of course :-)
chmod +x /opt/.tce_dir
sorry some keyboard challenges there!
-
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
-
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.
-
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