WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Load extension without saving on disk  (Read 5511 times)

Offline bonbob

  • Jr. Member
  • **
  • Posts: 99
Load extension without saving on disk
« on: August 01, 2017, 04:01:23 AM »
Is it possible to install *.tcz directly from repository, without saving on disk?
Such possibility allow user make demo-installation. If something goes wrong with app, after reboot directory with *.tcz files stay clear, without garbage of unused or problematic demo-packages and it's dependences. As i know, tce-ab can't safely delete unusing apps.  "on the fly" installation mode make possible run TCL from devices with a lot of onboard flash-memory. I try to realize this idea and made shell-script loading and installing *.tcz from remote network storage. How about the same function in tce-ab?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: Load extension without saving on disk
« Reply #1 on: August 01, 2017, 04:48:50 AM »
As long as you do not have anything (or only extensions known to be good) set onboot, a simple reboot would fix things?

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Load extension without saving on disk
« Reply #2 on: August 01, 2017, 09:02:13 AM »
You could use PXE booting to create a diskless device so extensions are reloaded from the network each time on boot, but then you would need to set up a bootp server. It works for me.

Offline bonbob

  • Jr. Member
  • **
  • Posts: 99
Re: Load extension without saving on disk
« Reply #3 on: August 01, 2017, 12:08:53 PM »
Yep. But it's not the same. You can boot TCL with minimum extensions to get internet connection. When connection with repository will be established, other extensions will be installed directly from repo. Without copying to tce/optional. No boot server needed. Only internet connection and a few megabytes for booting core. This is the first reason of my idea. The second - demo-install mode. When content of folder tce/optional stay without any changes after installation.
« Last Edit: August 01, 2017, 12:14:52 PM by bonbob »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Load extension without saving on disk
« Reply #4 on: August 01, 2017, 02:26:16 PM »
Yes, that's how the default "cloud mode" works. If you haven't set up a tce directory, or are using just a cde directory (intended for cd like the name, but possible on writable media too), extensions are only downloaded to RAM.

However, if you plan to use it a lot that way, please set up your own mirror - would be rude to mirrors to download libreoffice several times a day, for example. :P
The only barriers that can stop you are the ones you create yourself.

Offline bonbob

  • Jr. Member
  • **
  • Posts: 99
Load extension without saving on disk
« Reply #5 on: August 02, 2017, 04:41:50 AM »
As i understand, tce-ab has no option that give user possibility to choose between "cloud mode" and permanent installation. For example i have device with only 64Mb onboard flash-memory. It enought to install base *.tcz's to use device as wrieless router, but "heavy" packets as samba and mariadb require more free space on onboard storage. As i write earlier this packets are loading by local network from remote file storage. I think Loading directly from repository by tce-ab with "cloud-mode" installation option will be more convenient.
« Last Edit: August 02, 2017, 04:47:46 AM by bonbob »

Offline bonbob

  • Jr. Member
  • **
  • Posts: 99
Re: Load extension without saving on disk
« Reply #6 on: August 02, 2017, 09:33:27 AM »
I made shell-script for myself and it work:

Code: [Select]
TEMPDIR="/tmp/tmpextdir/"
REPOURI="PATH_TO_REPOSITORY"

mkdir -p $TEMPDIR

function loadTCZ()
{
 wget -P $TEMPDIR "$REPOURI$1"
 wget -P $TEMPDIR "$REPOURI$1.md5.txt"
 wget -q -P $TEMPDIR "$REPOURI$1.dep"
 echo "$1 loaded"
 if [ -s "$TEMPDIR$1.dep" ]; then
  FILE="$TEMPDIR$1.dep"
   while read line; do
    if [ -z $line ]; then
     continue
    fi
    loadTCZ $line
   done < $FILE
  fi
}

loadTCZ $1
su tc -c "tce-load -i $TEMPDIR$1"
rm -r $TEMPDIR
« Last Edit: August 02, 2017, 09:35:22 AM by bonbob »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Load extension without saving on disk
« Reply #7 on: August 02, 2017, 09:54:03 AM »
Touch /etc/sysconfig/tcedir/copy2fs.flg and do a backup.

Offline bonbob

  • Jr. Member
  • **
  • Posts: 99
Load extension without saving on disk
« Reply #8 on: August 02, 2017, 05:16:05 PM »
What file copy2fs.flg do?

I made a few improvements to my script. You can see it  here http://tinycorelinux.sytes.net/tce-cloud.txt

Also i can made repository mirror on my server for all who interested of Tiny Core Linux. If it possible.   ::)

Offline polikuo

  • Hero Member
  • *****
  • Posts: 723
Re: Load extension without saving on disk
« Reply #9 on: August 02, 2017, 11:26:13 PM »
What file copy2fs.flg do?

It enables copy mode, meaning every file is copied into the RAM rather than symbol-linked from a mounted squash file system.
Read the book for more details.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Load extension without saving on disk
« Reply #10 on: August 03, 2017, 04:08:21 AM »
It doesn't affect the download destination for new files, though.

To make a mirror, do a recursive wget from your closest mirror, then keep it up to date once per day with rsync from repo.tinycorelinux.net.
The only barriers that can stop you are the ones you create yourself.

Offline bonbob

  • Jr. Member
  • **
  • Posts: 99
Load extension without saving on disk
« Reply #11 on: August 03, 2017, 04:51:33 AM »
Few lines from CoreBook:
Quote
Selected application extensions are copied into RAM instead of
mounted. Applications can be RAM-loaded in bulk (copy2fs.flg),
selectively loaded into RAM (copy2fs.lst), or mounted.

From what sourse Application extensions are copied into RAM instead? Remotely from internet? What will happened if internet connection will be unavialable while booting core? I think that "copy mode" is not the same as "cloud install". Nearest is "cloud/internet mode", but in that case user install apps manualy, by himself. And he has no ability to choose, what extension will be installed in "mount mode" or in "cloud mode".

Nevertheless i found decision by making my personal script.

I will try to make a repository mirror later, as adviced Mr. curaga
« Last Edit: August 03, 2017, 04:53:35 AM by bonbob »

Offline polikuo

  • Hero Member
  • *****
  • Posts: 723
Re: Load extension without saving on disk
« Reply #12 on: August 03, 2017, 05:19:56 AM »
Don't reinvent the wheel.
tce-load takes cares of what you need.

Cloud mode:
Extensions are stored in /tmp/tce/optional
i.e. in the RAM

Mount mode:
Extensions are stored in /your/disk/tce/optional
tce-load first creates a loop file system at /tmp/tcloop, then symbol-links all the files in the tcz to their respected position in the system.

Copy mode:
Extensions are also stored in /your/disk/tce/optional
The contents in the tcz are copied into the RAM.

If the file tce/copy2fs.flg exists, every extension will be load in copy mode.
If only the tce/copy2fs.lst exists, only the extensions listed in that file will be load in copy mode.

From what sourse Application extensions are copied into RAM instead?

The local tce directory.
The difference between mount mode and copy mode is that, when you boot up by copy mode, no partition in your disk is mounted (except for swap).

Offline bonbob

  • Jr. Member
  • **
  • Posts: 99
Load extension without saving on disk
« Reply #13 on: August 03, 2017, 07:31:39 AM »
Oh, seems we are misunderstanding each other.

Main question is not "where extension files stored and how it will be copyied to system", but how to automaticaly load extensions from repository after TCL-core is booted and interner connection has been established?

Mount & Copy modes always needs local storage (usb stick, onboard flash-memory, HDD). This mode is not for me. I have no enough free drive space to keep all of extension files, but enough RAM.

Cloud mode losing all extensions after reboot. And it's will not appear again till user manually installed from repo with "tce-ab". I need to make it automaticaly, following by list of my extensions. And after loading from repo apply backup.

can "tce-load" do this for me?
« Last Edit: August 03, 2017, 07:35:45 AM by bonbob »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Load extension without saving on disk
« Reply #14 on: August 03, 2017, 08:44:32 AM »
I think the simple solution to this is get a USB thumb drive and store your downloaded extensions there, then you may load extension any way you choose.  USB thumb drives are cheap and readily available.  Otherwise, downloading from a repo each time you boot up threatens our relationship with the kind folks who offer repo mirrors.

You wouldn't want to jeopardize that relationship, would you??