Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: vmcs on November 24, 2023, 07:17:02 PM

Title: Behind the extension operations
Post by: vmcs on November 24, 2023, 07: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!
Title: Re: Behind the extension operations
Post by: CentralWare on November 24, 2023, 07: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":

For example; let's use the Midnight Commander (mc) extension:
Code: [Select]
tce-load -wi mc.tcz
For On-Demand:
Code: [Select]
tce-load -wo mc.tcz
Hope this helps!

Title: Re: Behind the extension operations
Post by: vmcs on November 25, 2023, 02:19:19 AM
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?
Title: Re: Behind the extension operations
Post by: CentralWare on November 25, 2023, 04:10:56 AM
@vmcs:
...as for WHY TCZ files are mounted...  and ...like in most unix systems...
TinyCore is intentionally not like most larger, bloated unix-like systems.
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!
Title: Re: Behind the extension operations
Post by: Rich on November 25, 2023, 08: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
Title: Re: Behind the extension operations
Post by: Rich on November 25, 2023, 10: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.
Title: Re: Behind the extension operations
Post by: Leee on November 25, 2023, 02:13:27 PM
...
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.
Title: Re: Behind the extension operations
Post by: vmcs on November 26, 2023, 03: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
Title: Re: Behind the extension operations
Post by: patrikg on November 27, 2023, 07:52:26 AM
As new to TCL, you should start also read the good book.

http://tinycorelinux.net/corebook.pdf (http://tinycorelinux.net/corebook.pdf)

As another resources you should also visit the wiki.

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