Short tutorial on sfs creation

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

Short tutorial on sfs creation

#1 Post by musher0 »

(Post moved from http://murga-linux.com/puppy/viewtopic. ... 195#935195)
~~~~~~~~~

Hi kerl.

The best (long) explanation on sfs is probably here.

The only difference is that in Puppy we use the .sfs suffix for squashfs
files instead of the "squashfs" one.

Basically, the principle is this:
you create a linux directory hierarchy of the app you want to "sfs" on a
linux compatible file system, say ext2 or ext3, then you put the files in
their proper directory. When finished, you "squash" the whole dir.

Application of the above principle to Puppy:
-- compile your app as usual, with ./configure and make;

-- install it with the command

Code: Select all

make DESTDIR=/mnt/home/someapp install
instead of simply

Code: Select all

make install
This operation creates a mirror of the file hierarchy the app needs to run
properly under /mnt/home/someapp instead of meshing it with your
running Puppy right away.

Enter the /mnt/home/someapp directory. Do the usual strippping of the
execs and libs at /usr/bin and /usr/lib, plus sanity checks of the
hierarchy. Check if the docs and mans are at the right place for a Puppy,
same for whatever icons and desktop files, etc.

Once you're satisfied that everything is ok, "cd" back up to /mnt/home.
Open a terminal and issue this command:

Code: Select all

mksquashfs someapp -comp xz -allroot -noappend
It takes a minute or two, depending on the size of the app and on the
speed of your box.
Explanation of parms:
-comp xz compresses the sfs with xz algorythm
-allroot labels all files in the dir. tree as belonging to "root"
- noappend means "overwrite previous sfs of same name" if there is one;
use with caution.
(Please see bottom notes.)

Then move your newly created sfs in the same directory as your main
Puppy sfs and...

Call up the < sfs_load > utility. Follow the instructions to integrate
your new sfs to your Puppy. The idea is to push the sfs from the left
column to the right column; the sfs's in the right column are the
active ones.

That's it!

IHTH.

~~~~~~~~~
Note 1 -- Puppy has a dir2sfs script which works fine for this operation,
but I personally prefer the longer mksquashfs command I mention
because it gives me finer-grain control.

Note 2 -- If you wish to learn more about mksquashfs, type

Code: Select all

mksquashfs --help
Note 3 -- For the record, the reverse command is
< unsquashfs someapp.sfs >.
This recreates the originating directory if you've deleted it.

Note 4 -- An sfs file is normally portable to other Puppies of same glibc
(aka "C library version"). BUT... check if the other Puppies have the
same libs as the Puppy you created the sfs file on. If your app needs
some special libraries, this check is a must.
~~~~~~~~~
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

kerl
Posts: 154
Joined: Tue 16 Apr 2013, 21:15

#2 Post by kerl »

For now I just say hello, i'll watch this topic ;)

btw I've noticed a possible bug related with .sfs
I had slimjet browser installed via sfs and some way it stopped working so i went to ppm to uninstall it, as there was no menu there, i just opened gdmap and removed its big boulder cache files. Afterwards i noticed the sfs was on the boot manager menu but it was deactivated! So i know i'm a tender pup's M$ mind in an old fat dog's body. Nooby me!! Anyways isn't this a bug? I've been using Slimjet and after a few weeks some way it got deactivated on the boot manager

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#3 Post by musher0 »

kerl wrote:For now I just say hello, i'll watch this topic ;)

btw I've noticed a possible bug related with .sfs
I had slimjet browser installed via sfs and some way it stopped working
so i went to ppm to uninstall it, as there was no menu there, i just
opened gdmap and removed its big boulder cache files. Afterwards i
noticed the sfs was on the boot manager menu but it was deactivated!
(...)
Anyways isn't this a bug? I've been using Slimjet and after a few weeks
some way it got deactivated on the boot manager
Hi kerl.

sfs's never show up in the ppm. You load and unload them through
the sfs_load.
No it's not a bug, sfs's are designed that way.
Technically, sfs's are not "installed". An sfs is just a layer that is spread
over the linux system. (Best metaphor I can find ATM and like any
metaphor, it's an incomplete explanation.)

(Phew, you only removed the cache files, which are lodged in the
regular pupsave.)

If an sfs gets de-activated for some reason, call up sfs_load and finish
the de-activation. Then reboot. Then re-run sfs_load to reload your
headstrong :) sfs. The re-re-boot. Check if that helped.

Also, like any file, sfs's get corrupted in time. It's rarer on a linux file
system, but it still happens. Whatever the OS, disks are still disks. The
magnetic 0's and 1's on a disk sometimes get jumbled for a particular
file. If all else fails, erase the current copy and download a fresh copy
of your sfs.

Maybe run an "fsck" on your disks and on your pupsave file once a
month, too. It keeps them and the files on them properly aligned, i.e.
healthy.

That's all I can think of for now. Good night!
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

kerl
Posts: 154
Joined: Tue 16 Apr 2013, 21:15

#4 Post by kerl »

Thanks musher0 for the tips.
I cannot re-re-re-boot/load that .sfs because the terminator in me deleted'em all!
Maybe .pet is a tad more reliable?
Good night to you too

kerl
Posts: 154
Joined: Tue 16 Apr 2013, 21:15

#5 Post by kerl »

Please let's keep examining more practical tips :P

How would you make an sfs out of a customized software that has not been compiled by you? for example, personal settings on rox-filer, seamonkey along with addons, configured email program..
-You could make one sfs containing multiple programs, and sttings, right? for example all wine based programs in one sfs.
-What about Puppy configurations? like fonts, menus, themes..
-In the end you'd have the iso from the puppy base, a number of sfs, a number of pets.. How would you prepare a setup script to build a custom iso ready to be installed?
-The author of LazyPup seems to have designed a system without pets or sfs to configure puppy distributions

User avatar
LazY Puppy
Posts: 1934
Joined: Fri 21 Nov 2014, 18:14
Location: Germany

#6 Post by LazY Puppy »

The author of LazyPup seems to have designed a system without pets or sfs to configure puppy distributions
Yes, I'm configuring my T.O.P.L.E.S.S. LazY Puppy Systems by configuration files stored inside the boot directory / installation directory.

These configuration files containing lots of parameters to configure such T.O.P.L.E.S.S. LazY Puppy at boot up.

Though, to make configuring possible at boot up, T.O.P.L.E.S.S. is using some specialized .sfs modules that is including some of the necessary functions.

Those specialized .sfs modules (I call them the T.O.P.L.E.S.S. system sfs modules) are loaded to a top-layer (on top of the main sfs).

The only changes/additions (to read out the parameters stored in those configuration files) made on the original puppy's files are done inside its initrd.gz archive.

However, the new woof-ce puppy builder (xenial and then above) has got that many changes inside the init script (the one in initrd.gz), so they made me kicked-off from further developments.
RSH

"you only wanted to work your Puppies in German", "you are a separatist in that you want Germany to secede from Europe" (musher0) :lol:

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! :wink:

Post Reply