WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: delete subdir of tcloop TinyCore 4.7  (Read 9167 times)

Offline chang5811

  • Newbie
  • *
  • Posts: 12
delete subdir of tcloop TinyCore 4.7
« 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

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: delete subdir of tcloop TinyCore 4.7
« Reply #1 on: December 24, 2013, 11:30:11 PM »
/tmp/tcloop is NOT persistent. It is the directory where the tcz files are loop mounted.
What EXACTLY are you trying to edit?

Offline chang5811

  • Newbie
  • *
  • Posts: 12
Re: delete subdir of tcloop TinyCore 4.7
« Reply #2 on: December 30, 2013, 11:24:45 AM »
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.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: delete subdir of tcloop TinyCore 4.7
« Reply #3 on: December 30, 2013, 12:24:29 PM »
Extensions are read-only. You cannot modify files in them.
The only barriers that can stop you are the ones you create yourself.

Offline chang5811

  • Newbie
  • *
  • Posts: 12
Re: delete subdir of tcloop TinyCore 4.7
« Reply #4 on: December 30, 2013, 12:49:43 PM »
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.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: delete subdir of tcloop TinyCore 4.7
« Reply #5 on: December 30, 2013, 01:03:52 PM »
You can load the extension to RAM with the copy2fs toggle, then the files will be editable. I don't understand your second part?
The only barriers that can stop you are the ones you create yourself.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: delete subdir of tcloop TinyCore 4.7
« Reply #6 on: December 30, 2013, 05:28:30 PM »
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

 
« Last Edit: December 30, 2013, 05:48:33 PM by coreplayer2 »

Offline chang5811

  • Newbie
  • *
  • Posts: 12
Re: delete subdir of tcloop TinyCore 4.7
« Reply #7 on: December 31, 2013, 11:43:02 AM »
to curaga:
here were my original script to generate myapp.tcz
Quote
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
« Last Edit: December 31, 2013, 12:18:19 PM by chang5811 »

Offline chang5811

  • Newbie
  • *
  • Posts: 12
Re: delete subdir of tcloop TinyCore 4.7
« Reply #8 on: December 31, 2013, 01:09:20 PM »
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?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: delete subdir of tcloop TinyCore 4.7
« Reply #9 on: December 31, 2013, 02:02:04 PM »
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".
« Last Edit: December 31, 2013, 02:03:45 PM by gerald_clark »

Offline chang5811

  • Newbie
  • *
  • Posts: 12
Re: delete subdir of tcloop TinyCore 4.7
« Reply #10 on: December 31, 2013, 02:23:21 PM »
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.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: delete subdir of tcloop TinyCore 4.7
« Reply #11 on: December 31, 2013, 02:32:02 PM »
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?