WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: An alternative setup for a Linux OS.  (Read 3744 times)

Offline SunBurnt

  • Full Member
  • ***
  • Posts: 102
An alternative setup for a Linux OS.
« on: August 07, 2011, 09:13:32 PM »
hiro and I were discussing this in another thread.

The idea is much like TC, but uses a Squash file in ram rather than loose files.
This makes the read-only files in ram secure and it also saves 17 MB of ram.
And it keeps writable files loose on a persistent drive rather than in a .tgz .
I think I have the directories r-w and r-o correct, but there may be errors.

###      An alternative setup for a Linux OS.

#   The read-only directories are in the Squash file.
#   Persistant read-write directories are on the HD.
#   Nonpersistant read-write directories are in RAM.

#   The Squash file is mounted at: /SQ
#   The HD partition is mounted at: /mnt/(part.)

File System in ram: Directories and links ( -> ).
=======================================
/SQ   ( Squash file in ram, mount point )
/bin ----> /SQ/bin
/dev
/etc ----> /mnt/(part.)/OS/etc
/home -> /mnt/(part.)/OS/home
/lib  ----> /SQ/lib
/mnt
 /opt ---> /SQ/opt
/proc
/root ---> /mnt/(part.)/OS/root
/sbin  --> /SQ/sbin
/sys
/tmp
/usr  ---> /SQ/usr
/var
« Last Edit: August 07, 2011, 09:40:45 PM by SunBurnt »

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: An alternative setup for a Linux OS.
« Reply #1 on: August 07, 2011, 10:03:30 PM »
You'd have to create directories and then create links only for files (like it's done for extensions currently). Else you can't load other extensions.

I don't accept security as an argument, like I already said, but I agree this would save a little bit of RAM.

Offline SunBurnt

  • Full Member
  • ***
  • Posts: 102
Re: An alternative setup for a Linux OS.
« Reply #2 on: August 07, 2011, 10:29:14 PM »
Hi hiro; When you say "load" you mean "mount" app. Squash files?
The "extention" Squash files are mounted on dirs. in /tmp. Right?
The file system I show has /tmp as a dir. in ram. This what you mean?

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: An alternative setup for a Linux OS.
« Reply #3 on: August 07, 2011, 10:39:38 PM »
With load I mean mount into /tmp/tcloop like you said + link the contained files into /
The last step is only possible if the directories are writable.

Offline SunBurnt

  • Full Member
  • ***
  • Posts: 102
Re: An alternative setup for a Linux OS.
« Reply #4 on: August 07, 2011, 11:00:44 PM »
I must not understand how the extension files work then.

I thought the extension files were used through their mount points directly,
with no attempt to merge their files with the main file system. Wrong?

Offline hiro

  • Hero Member
  • *****
  • Posts: 1229
Re: An alternative setup for a Linux OS.
« Reply #5 on: August 08, 2011, 06:12:23 AM »
Please don't refer to and fro parallel threads. This circumvents the use of that separation.

Offline robc

  • Sr. Member
  • ****
  • Posts: 447
Re: An alternative setup for a Linux OS.
« Reply #6 on: August 08, 2011, 03:19:50 PM »
I did this in a hacked version of tc that I was using a while back.  Basically I took everything in the base (and all my extensions) that was not an absolute requirement to boot and wrapped them into an extension and placed it in /tmp.  I added a line in the beginning of the tc init script to mount and link cp the extension files into /.  This did not decrease the size of the image, but it did decrease the size on the runtime memory usage.

I think the only parts that were not in the base extension were:
busybox (+ symlinks)
tty
initrd
squashfs
tc-init scripts

probably a few others
"Never give up! Never surrender!" - Commander Peter Quincy Taggart

"Make it so." - Captain Picard

Offline SunBurnt

  • Full Member
  • ***
  • Posts: 102
Re: An alternative setup for a Linux OS.
« Reply #7 on: August 08, 2011, 03:29:40 PM »
hiro; Sorry... I always felt references to other material was a benefit, I`ll watch that in the future.
I thought you might like to know... Using Squash files directly has already been done at Puppy Linux.
It works wonderfully with no links outside the Squash file needed ( not normally anyway...).

robc; I said at Puppy Linux years ago that if it`s not needed for booting it shouldn`t be in the initrd.gz file.
In regards to Tiny Core that`s not the case, the initrd.gz file is the entire file system.
Using dirs. and links does save space though... Right?
« Last Edit: August 09, 2011, 12:34:03 AM by SunBurnt »

Offline SunBurnt

  • Full Member
  • ***
  • Posts: 102
Re: An alternative setup for a Linux OS.
« Reply #8 on: August 09, 2011, 11:59:54 PM »
I had hoped that TC developers would be interested in an advanced Squash file loading setup.

Using links accesses the Squash file from outside, mirroring it`s files in the main file system.
Better to set needed paths into the Squash file in a new shell instance, and use it directly.
It`s files can be used without them having to be part of the main file system. It works fine!
No masses of links scattered throughout the main file system. Load it, use it, unload it. That`s it!

Is the TC team interested in this advanced idea for a better way to use the extension files?
I think only minor changes need to be made to the extension files and the way TC is setup.
Probably good for the next major release of TC ( 4.0 , I guess... ). Best regards... Terry