WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Behind the extension operations  (Read 907 times)

Offline vmcs

  • Newbie
  • *
  • Posts: 3
Behind the extension operations
« on: November 24, 2023, 04:17:02 PM »
Hello,

I would like to understand what happenning exactly behind each operation - like OnBoot, OnDemand, Download+Load, Download Only...

For example, Download Only (tce-load -w app_name.tcz) - the extention's file will be downloaded and stored in /tce/optional. Right? Thet's all?

To load (start?) this downloaded extention (tce-load -wo app_name.tcz) - the extention will be moved to /tce/ondemand? Or the extention stay in /tce/optional, but some launching script will be created in /tce/ondemand? Extention will not be added to Onboot.lst file.

Is the extention will be mounted (loop) on this stage? For why? How it's work?

Download+Load : the same, but by one action (tce-load -wil app_name.tcz), extention will neither be added to /tce/ondemand nor to Onboot.lst file. Right?

OnDemande (tce-load -wo app_name.tcz): Downloaded to /tce/optional, added to /tce/ondemand, but not to Onboot.lst file. Right?

OnBoot (tce-load -wo app_name.tcz): Downloaded to /tce/optional, added to /tce/ondemand and to Onboot.lst file. Right?

What's difference between the extention's operations "load", "mount" and "run"?

Could somebody explain this or give a link to a good article (I did't found the explanaition in the documentation)?

Thank you!

Offline CentralWare

  • Administrator
  • Hero Member
  • *****
  • Posts: 1652
Re: Behind the extension operations
« Reply #1 on: November 24, 2023, 04:47:44 PM »
From the CLI (command line interface) type in tce-load by itself for a general description of the different switches.
"Most" apps will do the same; the safest method to find out details and switches is to type in the app name followed by --help
ie: tce-load --help  (There are a few odd-balls out there which use just "-h" instead of "--help")

tce-load -wi filename.tcz is the most common, it downloads the file, places it into tce/optional,
   loads the file into memory right now...  and adds it to tce/onboot.lst so that it'll load every time you boot
   the computer.

-w will just download the file into tce/optional - nothing more happens.
-wil will do the same as -wi EXCEPT it will not add it to tce/onboot.lst (it loads into memory NOW, but not when you reboot.)
-wic will do the same as -wi but ONLY for this session; it's gone when you reboot.

-wo will download the file, it then creates an On Demand script.  The file is NOT loaded into memory until called upon;
   useful for programs you don't use very often but want to have available.

If you have an extension already in tce/optional and you want it to load right now,
tce-load -i filename.tcz will load it into memory from your tce/optional directory.

When referring to the -w download switch, tce-load will download the file you requested and all of its dependency extensions.

When a filename.tcz is "loaded":
  • The TCZ file is first mounted in /tmp/tcloop
  • The contents from /tmp/tcloop/filename are then merged into the file system

For example; let's use the Midnight Commander (mc) extension:
Code: [Select]
tce-load -wi mc.tcz
  • The -w portion of the switch tells us to download mc.tcz and all of its dependencies to tce/optional
  • The -wi switch combined tells us to download it, then add it to tce/onboot.lst and finally, load it into memory

For On-Demand:
Code: [Select]
tce-load -wo mc.tcz
  • If you used -wo instead, it would download into tce/optional, NOT be added to onboot.lst and only get loaded into RAM when you called "mc" from the command line.

Hope this helps!

« Last Edit: November 24, 2023, 05:21:28 PM by CentralWare »
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline vmcs

  • Newbie
  • *
  • Posts: 3
Re: Behind the extension operations
« Reply #2 on: November 24, 2023, 11:19:19 PM »
Thank you for explaination!

However, I don't undestend why for loading the TCZ file must be mounted in /tmp/tcloop ? And the contents from /tmp/tcloop/filename are then merge into the file system ?
What give this mecanisme of mount? Why do not launch the application directly like in most unix systems?

Also, does the tce-load check md5 signature ? If yes - when? During download or during loading?

How to correctly delete extention from CLI? With concerned dependeces?

Offline CentralWare

  • Administrator
  • Hero Member
  • *****
  • Posts: 1652
Re: Behind the extension operations
« Reply #3 on: November 25, 2023, 01:10:56 AM »
@vmcs:
  • MD5 is checked at download
  • There are a number of tce-* utilities written you may wish to look into that help manage the extensions in /usr/bin
    ls /usr/bin/tce*
...as for WHY TCZ files are mounted...  and ...like in most unix systems...
TinyCore is intentionally not like most larger, bloated unix-like systems.
  • The TCZ files are "Squashed" (squasfs) which allows us to open and load files from a tcz file faster than extracting.
  • You GET what you CHOOSE to put into your system, not what the distribution insists comes with it.  Additionally, what goes in...  is easy to get rid of completely.
  • You get a CLEAN operating system every time you reboot.
        (This is great for virus prevention down to creating kiosks where others use the system - simply reboot and the system is brand new again!)
  • Because you choose what goes into the system, in most cases we're able to operate on much leaner equipment and resources.
  • With all of the methods used to make TinyCore...  well...  Tiny, it also makes for a much more organized and faster system overall as the entire operating system is technically running from RAM instead of a much slower hard drive, or a much, MUCH slower USB device.  In fact, if you tweak the way you do things, you can REMOVE the USB/HDD after booting and the system will be no wiser and still completely functional.  Let's see "most unix systems" do that! :)
TinyCore Linux is a foundation - it's a starting place...  it's an (almost) blank sheet of paper where you envision what you want to turn it into and more times than not, we already have the building blocks to do just that.  It won't wash your dishes for you or make children miraculously behave, but from a computing stand-point, it's a wonderful place to start when you want something more specific than what "most unix systems" come with by default.  For some people, TinyCorePlus is just enough "desktop" to satisfy their needs; especially when browsing the Internet, doing banking online, etc. as there's no trace every time you reboot (unless you want it to do otherwise) so there are no viruses, no ransomware, no tracking cookies, etc.

For one client of mine, we have a Kiosk set up so his customers can type in their own information (contact, address, phone, etc.), pay their bill when the job is complete, browse through the entire product catalog thus allowing them to spend their time picking and choosing what they want before spending employee time actually putting the order together.  When they're finished, they click on "I'm Done!" which removes any trace they were there, so the next customer gets a perfectly clean computing experience and most importantly, they can't break anything!  Well, other than the screen, itself!  This process saves 13 hours every week (on average) of wasted employee time while customers are scrolling on their phones, asking questions such as "how many shades of green does that come in?" and rambling on about topics entirely unrelated to why they're there.  If the average employee made $15/hour, that's a yearly savings of roughly $10,000 that otherwise is total waste and non-productive.

Why is TinyCore different?  Because it can be and we like it this way! :)
Why aren't the others more like TinyCore?  They just like their way better than ours; in the end, there's no "wrong."
Which is best for you?  Which ever way suits your purpose or makes you happy!
« Last Edit: November 25, 2023, 01:13:54 AM by CentralWare »
Over 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11230
Re: Behind the extension operations
« Reply #4 on: November 25, 2023, 05:54:00 AM »
Hi CentralWare
... the entire operating system is technically running from RAM instead of a much slower hard drive, or a much, MUCH slower USB device. ...
There's a little more to it than that.

The root file system is always in RAM.
The contents of  /home  and/or  /opt  can optionally reside on a drive.
Extensions reside in a  tce  directory on a drive.

Mount Mode (this is the default):
Extensions get mounted to make their contents accessible under  /tmp/tcloop.
The contents get linked to the root file system (i.e. /usr/local/bin/ProgramName).
When you run  ProgramName , it is found in  /usr/local/bin/  like any other Linux.
That link leads back to the mount point and  ProgramName  gets read from the drive.
A diagram can be found here:
http://distro.ibiblio.org/tinycorelinux/architecture.html

Copy Mode (touch Path/To/tce/copy2fs.flg):
Your  tce  directory contains a  copy2fs.flg  file when you boot.
Extensions get mounted under  /mnt/test/  (see  copyInstall()  in  /usr/bin/tce-load).
The contents get copied to the root file system.
Extensions get unmounted prior to processing the next extension.
A diagram can be found here:
http://distro.ibiblio.org/tinycorelinux/arch_copymode.html

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11230
Re: Behind the extension operations
« Reply #5 on: November 25, 2023, 07:22:54 AM »
Hi vmcs
... How to correctly delete extention from CLI? With concerned dependeces?
Try this:
Code: [Select]
tce-audit builddb
tce-audit delete ExtensionName
Found here:
https://forum.tinycorelinux.net/index.php/topic,10751.msg56770.html#msg56770

When you shut down or reboot it will get removed.
Don't hit the power switch or reset button.
Do it properly:
Code: [Select]
exitcheck.sh shutdownor:
Code: [Select]
exitcheck.sh reboot
If you just want to disable an extension (and its dependencies) you
can remove it from the  onboot.lst  file in your  tce  directory.
The next time you boot it won't load.

Offline Leee

  • Jr. Member
  • **
  • Posts: 84
Re: Behind the extension operations
« Reply #6 on: November 25, 2023, 11:13:27 AM »
...
However, I don't undestend why for loading the TCZ file must be mounted in /tmp/tcloop ? And the contents from /tmp/tcloop/filename are then merge into the file system ?
What give this mecanisme of mount? Why do not launch the application directly like in most unix systems?
...
In CentralWare's description
Quote
  • The TCZ file is first mounted in /tmp/tcloop
  • The contents from /tmp/tcloop/filename are then merged into the file system
"merged" means symbolically linked (symlinked) rather than copied.  With this mechanism, the .tcz file remains mounted and only a few bytes are taken up in the RAM-resident root file system for each file included in the extension.  As a bonus the fact that the mounted .tcz file is a read-only file system means that the files within the extension are resistant to corruption.
There -is- an option to load (copy) an extension's files into the RAM resident filesystem, in which case the above benefits would not apply but one would then be able to, for instance, umount the media on which the .tcz file resides.
core 14.0 x86_64

Offline vmcs

  • Newbie
  • *
  • Posts: 3
Re: Behind the extension operations
« Reply #7 on: November 26, 2023, 12:08:45 PM »
Thanks to all for your help and the explanations!
I understood the philosophy of TCL, as well as the mechanism of extensions on low-level.

WBR,
vmcs

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 674
Re: Behind the extension operations
« Reply #8 on: November 27, 2023, 04:52:26 AM »
As new to TCL, you should start also read the good book.

http://tinycorelinux.net/corebook.pdf

As another resources you should also visit the wiki.

https://wiki.tinycorelinux.net/doku.php?id=welcome