Page 1 of 2

How to make .sfs file (compress programs and settings)

Posted: Mon 09 Jan 2006, 20:12
by bombayrockers
How to make a .sfs file ?

Presently puppy supports .sfs files to be mounted on union /usr.
Suppose I have got some PackageX running and want to make a .sfs out of it. I would copy all the necessary files for packagex to /my-docments/packagex. inside the folder packagex there would be the following folders
/bin - containing the binaries
/lib - dependencies
/share - shared data
..

if the package you have compiled installs to /usr/local then packagex folder would contain
/local/bin
/local/lib
/local/share
..

to make a .sfs out of this execute the following command in the terminal

Code: Select all

mksquashfs /root/my-documents/packagex /mnt/hda1/usr_packagex.sfs
/mnt/hda1 to be replaced by where ever you want this .sfs file to be created.

pre-1.0.7 users can use it by renaming it to usr_more.sfs
1.0.7 users can do the following
edit your rc.local to add the following lines

Code: Select all

echo  "Making more loop devices..."
mknod /dev/loop5 b: 7 5
mknod /dev/loop6 b: 7 6
mknod /dev/loop7 b: 7 7

if [ ! "`ls /mnt/home/usr_packagex.sfs 2> /dev/null`" = "" ];then
  mkdir /.usr_packagex
  echo "Mounting /mnt/home/usr_packagex.sfs file on /.usr_packagex..."
  losetup-FULL /dev/loop5 /mnt/home/usr_packagex.sfs
  mount -r -t squashfs -o noatime /dev/loop5 /.usr_packagex
  unionctl /usr --add  --after /root/.usr --mode ro /.usr_packagex
fi
if you are multiple .sfs files the increase then use the next /dev/loop that is empty i.e. the next usr*.sfs will go in /dev/loop6. If you run out of loops make new ones using mknod command as show above.

This information in valid for puppy 1.0.7 and later puppy 1.0.* versions only. union structure is going to change in puppy2

Posted: Mon 09 Jan 2006, 20:28
by Flash
bbr, this would be a good place to explain, what exactly is an sfs file good for? :?

Posted: Mon 09 Jan 2006, 21:13
by Lobster
It allows this great piece of Puppy magic:
Mega-Puppy 001

This addon allows you to use 667 MB of Software compressed in one single file.
I recommend to use it with Puppy 1.0.7, as older versions would require some tweaking (see troubleshooting further down).

KDE 3.4.1
Open Office 2.0
Java Runtime 1.5.04
Wine (Oct. 2005)
39 MB Video-Codecs for gxine and mplayer
Apache Webserver with PHP (but no MySQL)
http://www.murga.org/~puppy/viewtopic.php?p=31283#31283

Posted: Mon 09 Jan 2006, 21:13
by bombayrockers
A .sfs file is a squashfs file. Some examples of .sfs files in puppy are usr_cram.fs, usr_more.sfs for wine, openoffice, kde.

a squashfs file can also be used to make a usr_more.sfs out of your /root/.usr. Once you have installed all the software you want make a usr_more.sfs out of your /root/.usr.
Various advantages of this
1. You can use all your software on a ntfs only system when it dosent allow making a pup file.
2. more free space on pup file
3. in case of a pup file failure you wont lose all you customizations.

Posted: Mon 09 Jan 2006, 21:47
by BarryK
Thanks for the howto, bombay!

For Puppy2, the sfs files will mount on "/", but otherwise it's all as Bombay has explained.

Also, the file naming format for puppy2 is as follows:

*_200.sfs

where the "*" means any text string, the "200" is the 3 digit puppy version number. So when Puppy version 2.0.0 is released, it is compressed as 200.

Having versioning in all the .sfs files is probably a good thing.

You can have up to 4 of them, and they will load in alphabetical order, for example:

devx_200.sfs
kde_200.sfs

Order is important, as a file named myfile.txt in devx_200.sfs will hide myfile.txt in kde_200.sfs.

So, in a running puppy2:

tmpfs (ramdisk)
persistent storage (hd, flash, dvd)
pup_200.sfs (puppy himself)
devx_200.sfs
kde_200.sfs

upx

Posted: Mon 06 Feb 2006, 06:52
by guest5000
Just out of curiosity. Is it possible to use upx to better compress these files ?

Posted: Mon 06 Feb 2006, 06:58
by MU
not in usr_xxx.sfs , as it already is compressed.
UPX just makes sense in pup001 or on a harddisk.

Disadvantage:
you can not run
ldd theprogram
to check dependencies, you had to "upx -d ..." it first.

I released a small dependency-checker some days ago, that will not work with upx'ed files.
http://www.murga.org/~puppy/viewtopic.php?t=5751

Mark

how to make an .sfs file

Posted: Mon 06 Feb 2006, 15:19
by dewdrop
Hi Bombayrockers, and the other developers/programmers:

From a non-programmer/non-developer viewpoint - which fits me to a T., I think that the .sfs file is like having an adjustable sized trailer hitched to the back of a small car.

If a person knows which programs they want Puppy to have, and they know how to construct an .sfs file, ... and all the dependencies are included or accounted for .... that person could have Puppy with all kinds of variations.

Thus, you would end up with Puppy about 50-60 megs in size, and any number of .sfs files with all kinds of programs included.....this could be a "mini industry" inside the Puppy community.... Kind of like "Puppy Your Way". Tell one of the .sfs guru's what you want included, they would put the package together, upload it to some download site for a set amount of time, you, or whoever wants to could download it, place the file where the pup001 file is located on the hard drive, and away you go.

Is this the idea, or am I way off the mark on the usefulness of the .sfs file concept?

dewdrop

Posted: Mon 06 Feb 2006, 16:13
by costal martignier
Is this the idea, or am I way off the mark on the usefulness of the .sfs file concept?
no i think you correct with this :)
i was also faszinated about the possibilities with .sfs so i created the webenv.sfs a total webenvironment in a .sfs...

i think the only problem is (but i think this is somewhat fixed in puppy2) you can't autoload many sfs files automaticly (please the others correct me if i'm wrong) you need to mount them manually and you need some knowledge about unionfs/unionctl and mounting in general..

AFAIK in puppy2 there is a possibility to autoload "some" sfs files...

i think this .sfs stuff is really a great thing that barry has produced/invented...

regards
costal

Posted: Thu 23 Mar 2006, 08:51
by sccat
Very interesting.

turned into .sfs modules

Posted: Tue 28 Mar 2006, 04:38
by Lobster
Have put the HowTo here
http://puppylinux.org/wikka/SfsModuleCreation

Does someone have time to format it using these codes please:
http://wikkawiki.org/FormattingRules

Can puplets such as Grafpup, Hacao, Simplepup and Emptycrust be turned into .sfs modules so they will run with latest Puppy base much as megapuppy does?

If so can this process be documented - what if any is the relationship/links to .pet?

Can we add .sfs modules and info links etc to the wiki page please.

How does this change in Puppy2?

8)

Posted: Wed 29 Mar 2006, 13:00
by bombayrockers
Can puplets such as Grafpup, Hacao, Simplepup and Emptycrust be turned into .sfs modules so they will run with latest Puppy base much as megapuppy does?
packages from these puplets can be taken and turned in one compact usr_more.sfs eg usr_grafpup.sfs which can provide puppy with the same functionality as these derivatives.

I had done this for the edu puppy project (now abandoned as it was lost in hd crash), where I took tux 4 kid packages, python and SDL from grafpup and grouped them into one usr_more.sfs named usr_kids.sfs. Just set up the loop and you have the whole tux4kids suite in puppy.

Another one I am working on is the gnoe-deps module as usr_more.sfs so that gnome apps can be run in puppy wihout having to have the whole gnome environment, few examples I have got running until now are firestarter, metacity, nautilus, gnome-system-monitor.

Thanks and question

Posted: Mon 03 Apr 2006, 08:02
by raffy
Thanks, bombay, and here's hoping that you can redo your tux4kids sfs :)

Something weird is happening with my testing of /usr/local/wwwroot/htdocs. The Apache conf points to /root/.usr/local/wwwroot/htdocs as the document root, but when I open /root/.usr (the invisible folder), I could only see one or two subdirectories, none of them /local. But all the subdirectories are visible in /usr (that is, starting from the visible folder /usr).

As a result, the server gets the error "Root Directory not found" :?:

Posted: Mon 03 Apr 2006, 08:31
by bombayrockers
raffy,
is /usr/local/wwwroot/htdocs a part of any usr_more.sfs ? or it is installed on /root/.usr

An ISO remastered with Alienx's script

Posted: Tue 04 Apr 2006, 11:13
by raffy
It is a remaster using alienx's excellent script (the slow one), so there is no usr_more.sfs.

I just discovered that doing something to the /htdocs and files in it will make them visible, such as "touch" in console, otherwise they remain invisible to the Apache server. Am at a loss why this happens.

Edit: I recently read a discussion about a unionfs bug causing this to happen, that should be solved with 2.6+ version of the Linux kernel.

How to make .sfs file

Posted: Fri 21 Apr 2006, 15:37
by TPittman
From reading this thread it looks like using .sfs files is non-trivial. Are there instructions (what to type) somewhere? I'm a Mac person (unfortunately the real Mac is dead, all that's left is unix), where you just drag it onto some folder and 2-click it. I'm also a professional programmer, but everything I know about linux fits in the thin paperback _Just Enough Unix_ with lots of space left over. Once I succeed in recompiling the kernel and rebuilding the Puppy install, I'm sure I can figure everything else out.

Tom Pittman

Posted: Fri 21 Apr 2006, 23:57
by BlackAdder
Tom,
You are getting around a bit.
Try this page in the wiki for information on Virtual Drives and how they are mounted. Presumably you are interested in how to access usr_devx.sfs, just put it on the same partition as pupxxx if you are booting from CD or using the poor man's install.

Deleted

Posted: Sat 22 Apr 2006, 00:02
by BlackAdder
Double post.

Hi

Posted: Sat 22 Apr 2006, 02:39
by raffy
Hi, Tom, you are very much welcome in Puppy. Mu has announced a graphical installer of sfs files in "Additional Software".

Posted: Fri 06 Apr 2007, 07:52
by sunburnt
Raffy; Perhaps the problem is UnionFS "whiting out or not" the files, so they appear.


bombayrockers; I hear that Mono (Linux's ".net") needs Gnome's libs & gtk.
Maybe the package you've assembled would allow Mono to run on Puppy?

This'd bring Puppy the capability of running & developing M$ programming languages.