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

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
bombayrockers
Posts: 427
Joined: Sat 24 Sep 2005, 16:47
Location: Mumbai, India
Contact:

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

#1 Post 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

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#2 Post by Flash »

bbr, this would be a good place to explain, what exactly is an sfs file good for? :?

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

#3 Post 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
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
bombayrockers
Posts: 427
Joined: Sat 24 Sep 2005, 16:47
Location: Mumbai, India
Contact:

#4 Post 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.

User avatar
BarryK
Puppy Master
Posts: 9392
Joined: Mon 09 May 2005, 09:23
Location: Perth, Western Australia
Contact:

#5 Post 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

guest5000

upx

#6 Post by guest5000 »

Just out of curiosity. Is it possible to use upx to better compress these files ?

User avatar
MU
Posts: 13649
Joined: Wed 24 Aug 2005, 16:52
Location: Karlsruhe, Germany
Contact:

#7 Post 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

User avatar
dewdrop
Posts: 298
Joined: Tue 30 Aug 2005, 01:54
Location: Texas USA

how to make an .sfs file

#8 Post 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

costal martignier
Posts: 198
Joined: Sat 28 Jan 2006, 15:55

#9 Post 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

sccat
Posts: 160
Joined: Mon 22 Aug 2005, 04:22

#10 Post by sccat »

Very interesting.

User avatar
Lobster
Official Crustacean
Posts: 15522
Joined: Wed 04 May 2005, 06:06
Location: Paradox Realm
Contact:

turned into .sfs modules

#11 Post 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)
Puppy Raspup 8.2Final 8)
Puppy Links Page http://www.smokey01.com/bruceb/puppy.html :D

User avatar
bombayrockers
Posts: 427
Joined: Sat 24 Sep 2005, 16:47
Location: Mumbai, India
Contact:

#12 Post 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.

raffy
Posts: 4798
Joined: Wed 25 May 2005, 12:20
Location: Manila

Thanks and question

#13 Post 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" :?:

User avatar
bombayrockers
Posts: 427
Joined: Sat 24 Sep 2005, 16:47
Location: Mumbai, India
Contact:

#14 Post by bombayrockers »

raffy,
is /usr/local/wwwroot/htdocs a part of any usr_more.sfs ? or it is installed on /root/.usr

raffy
Posts: 4798
Joined: Wed 25 May 2005, 12:20
Location: Manila

An ISO remastered with Alienx's script

#15 Post 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.
Last edited by raffy on Sat 22 Apr 2006, 02:30, edited 1 time in total.

TPittman
Posts: 5
Joined: Fri 21 Apr 2006, 06:31

How to make .sfs file

#16 Post 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

User avatar
BlackAdder
Posts: 385
Joined: Sun 22 May 2005, 23:29

#17 Post 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.

User avatar
BlackAdder
Posts: 385
Joined: Sun 22 May 2005, 23:29

Deleted

#18 Post by BlackAdder »

Double post.

raffy
Posts: 4798
Joined: Wed 25 May 2005, 12:20
Location: Manila

Hi

#19 Post by raffy »

Hi, Tom, you are very much welcome in Puppy. Mu has announced a graphical installer of sfs files in "Additional Software".

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#20 Post 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.

Post Reply