Tiny Core Linux
Tiny Core Base => TCB Tips & Tricks => Topic started by: chang5811 on December 24, 2013, 06:06:26 PM
-
I created a cusmtized tcz. However, I could NOT remove or midifed it at all. The process created a subdirectory under the persistent /tmp/tcloop and my tcz under /tmp/builtin/optional. I tried to remove the tcz by "tce-audit delete". The system said that "can't open the tce.db: no such file". I removed manually that tcz and the link files and edit the tcz line out of the /tmp/builtin/onboot.lst. But when I rebooted, everything is back to original. How can I modify the tcz? I tried to modify a file under the customized tcz. Since it is stored under the persistent tcloop, I could not do anything by user (tc) or by root
-
/tmp/tcloop is NOT persistent. It is the directory where the tcz files are loop mounted.
What EXACTLY are you trying to edit?
-
I tried to edit one of files in mycusomtized tcz. I followed the example from one of the tiny core cook book to create the customized.tcz. I noticed that the process automatically moved all my files to the tcpool subdir and my original files of destination became links point to the new subdir under the tcpool. Even the file (the real file) still has tc/staff ownership, but I can not edit the file by tc user, neither I could not edit the link file which has root/root. So I tried to remove all files, including the links and anything related to my original package (tcz). But every time I removed the tcz package under the tce/optional and removed the tcz file name under the onboot.lst, they both return when I reboot. If I tried to remove the subdir of tcpool, the system won't allow.
-
Extensions are read-only. You cannot modify files in them.
-
I realized that later. So In general how can I modify the files within the extension? and why could I remove the extension and the onboot.lst that covers the extension and anything related to that while the system was on? So that I can rebuild the extension.
-
You can load the extension to RAM with the copy2fs toggle, then the files will be editable. I don't understand your second part?
-
I think the intention here is to modify an extension, then have the changes reflected on next reboot. I'm sure with some reading of the wiki or the new book the OP will gain an understanding of how tinycore functions quickly.
Anyhow, the only location where it is possible to modify an extension is /tce/optional (assuming this is not a read only media). You would first install the extension squashfs-tools-4.x.tcz using Apps, tce-load -wil squashfs-tools-4.x.tcz, or better still tce-ab search
Next enter the extension store directory on writable media (eg: Hard Drive) /mnt/sd(?)/tce/optional
note: you must be in the parent directory of the extension or extracted directory.
extract the archive at the command line using
unsquashfs -d extension_name extension_name.tcz
make changes as needed, then repackage or create using
mksquashfs extension_name/ extension_name.tcz
If set to load on reboot via onboot.lst and modified correctly then on next reboot the new/modified extension should load with expected changes. Be cautious not to change file permissions of required files
-
to curaga:
here were my original script to generate myapp.tcz
I have my python applications under the /home/tc/myapp/mytest.py
$ sudo su
$ cd /tmp
$ mkdir apptest
$ cd apptest
$ mkdir -p home/tc
$ mv /home/tc/myapp /tmp/apptest/home/tc
$ cd /tmp
$ mksquashfs apptest myapp.tcz
$ cd /tmp
$ mv -v myapp.tcz /mnt/sda1/tce/optional
# Adding myapp.tcz to onboot.lst.
# I noticed that mksquashfs generated original mytest.py as a link file under the /home/tc/myapp/
# start mytest.py at bootup as a background proc
$ sudo -s
$ echo "python /home/tc/myapp/mytest.py start" > /opt/bootloca.sh
Then I wanted to edit mytest.py, but I could not delete/edit mytest.py under the tcpool/ and the link file by tc or root, either I could not remove the /tmp/tcpool/myapp, changed onboot.lst (myapp/tcz added back when reboot)..
I will try coreplayer2's commands to today. Thanks all
-
Tried Coreplayer2's advices, it works. thanks. Then tried mksquashfs again, it worked.
I need to set up a proper subdir to host myapp.
my confusion was why the mksquashfs produced myapp under tcloop and why the myapp will load back there even I removed myapp subdir if the tcpool is non-persistent?
-
mksquashfs just makes the squashfs file you told it to make.
It doesn not make it under tcloop unless you give it a destination under tcloop.
I have no idea what "tcpool" is unless it is a typo for tcloop.
Once you boot Core and an app is mounted, removing the subdirectory from /tmp/tcloop will not make it go away.
Core provides no method for "uninstalling" an installed application. ( where "installed" is defined as "loop mounted" not "copied to tce/optional".
-
After few trial of mksquashfs, I think I understood what tiny core was doing. As long as I removed the tcz filename of onboot.lst and reboot, that the original filepath of the tcz would be disappeared from the tcloop. As tcloop wiki said, it is a subdir for all tcz listed in onboot.lst to mount at boot, therefore I could not remove it (it is running). I am from other linux platform, /tmp is a temp place, why tiny core mount tcz there? can I specify my tcz mount other dir? instead the tcloop.
sorry tcpool was a typo.
Thank again for advices.
-
It needs to mount applications into a non-persistent directory..
/tmp is in the RAM fs and the applications are mounted there temporarily ( for this boot session ).
Other directories such as /opt and /home are not guaranteed to be non persistent, and therefore not suitable for application mount points.
No, you cannot change it. Why would you need to?