Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 17 Apr 2014, 11:27
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How I make .pets into .sfs's
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [23 Posts]   Goto page: 1, 2 Next
Author Message
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Sun 05 Apr 2009, 23:09    Post subject:  How I make .pets into .sfs's
Subject description: and how to make them ChoicePup compatible
 

Recently I put together ChoicePup4.1.2 which is designed to use .sfs files instead of .pet files for adding programs to Puppy.

Squash files, .sfs, are compressed files, like zip files, that may contain systems of files and folders. Puppy412 runs from pup_412.sfs which contains almost the entire puppy OS. Puppy can also mount and use additional .sfs files on a temporary need to use basis.

This is how I make additional .sfs files. I will do two examples, one easy and one more involved. Firstly, I will do fbreader-0.10.7-i486.pet Second I will do MPlayer from the ibiblio pet repository.

You will need an ext2 or ext3 partition. Don't Panic!!! If you don't know how to backup your harddrive, create and format a new partition then you shouldn't. (Kids, don't try this at home) You can get a usbflashdrive, insert it in your computer. Open System->Gparted, select the flashdrive (sdb1 for example), right click on /dev/sdb1, choose format to -> ext3. Click the Apply button on the toolbar and you now have an ext3 work area. (I should mention that everything on sdb1 will be deleted during this process, don't lose your Swiss bank account password).

The reason for the ext3 partition is you will be working with symlinks, handy little devices for redirecting puppy to files it doesn't know how to find. They only work on Linux partitions. You can place a symlink on a Linux partition that points to a file on a non-linux partition but not vice versa.
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Sun 05 Apr 2009, 23:18    Post subject:  

Simple Example:
1)Place fbreader-0.10.7-i486.pet in your ext3 work area.

2)Right click on it and rename to fbreader-0.10.7-i486.tgz. Left click on it and use xarchive to extract. This will give you a new folder called /fbreader-0.10.7-i486. Look inside, no icons, no pinstall.sh, just /usr and pet.specs, should be easy. Within this folder go to /usr/share/applications/FBReader.desktop, right click and Open as Text. We see that the exec file is FBReader, if no path is specified the Exec file will be in either /usr/bin, /usr/sbin, or /usr/local/bin (or maybe /bin or /sbin, unlikely). We look in /usr/bin and there it is. The Icon=FBReader.png. Searching around we see it in /usr/share/pixmaps. Everything looks good.

3)One nice optional touch is to put FBReader on the right-click OpenWith menu. That way you can right click on an ebook and open it up. To do that go back into your /fbreader-0.10.7-i486 folder. Right click->New->Directory. Create /root and then click on it with the middle button. Now create /.config/rox.sourceforge.net/OpenWith. In the other ROX window go back to /usr/bin. Drag FBReader to the OpenWith folder and chooce "Link (relative)". Now FBReader is on the OpenWith menu.

4)Let's build the .sfs! Use the up arrow go get back to your work area where you can see the /fbreader-0.10.7-i486 folder. Right click anywhere in the work area and choose Window->Terminal Here. Once the terminal opens type "dir2sfs fbreader-0.10.7-i486". You will now have a file called fbreader-0.10.7-i486_412.sfs and a -md5.txt file.
If you're using ChoicePup, right click on the file and choose OpenWith->load_sfs. If not then place this file in /mnt/home, open System->bootmanager and tell it to load the file at bootup then reboot.

When you go to the Document menu you will see "E-book reader". Click and it will open. Find an ebook and start reading.
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Sun 05 Apr 2009, 23:27    Post subject:  

More Involved Example:
1)Download mplayer-1.0rc2-071007-1.pet to your ext3 work area. While there you might as well download mplayer_codecs_full-20071007.pet and mplayerplug-in-3.45.pet. Full codecs sounds good and we definitely want the browser plugin. Size is not such a big deal when we can choose how many packages to load at a time.

2)At this point I usually backup (copy to slightly different name) my pup_save.2fs (pup_save-412Q.sfs->pup_save-412Q2.sfs)file and install the .pet. Pet Package Manager will tell me what dependencies (files) are missing, write these down. It will even offer to download and install them most of the time. (You will download these files and include them in your .sfs). After installing the .pet and dependencies make sure the program runs in Puppy. Try it out on a media file and in your browser. If it does, reboot and choose your backup pup_save, this will get rid of any changes the installed .pets have caused. You can delete the first pup_save.

There's at least one other way to check for dependencies but I won't go into that here.

3)Right click on each of the .pets and rename them to .tgz (mplayer-1.0rc2-071007-1.pet -> mplayer-1.0rc2-071007-1.tgz). Left click on each .tgz, xarchive will open up and you can extract the contents. This will give you a folder with the same name as the .pet.

4)Open the mplayer-1.0rc2-071007-1 folder. You will see four things, /etc, /usr, mplayer.xpm, and pinstall.sh. /etc and /usr are folders containing the mplayer program. mplayer.xpm is the menu icon for mplayer. pinstall.sh contains instructions for installing the .pet into puppy.

5)We will deal with mplayer.xpm first. This icon will automatically be placed in /usr/local/lib/X11/mini-icons/ when the .pet is installed, but not when a .sfs is loaded! That, however is where it needs to go. So, you must create /usr/lib/X11/mini-icons. Start by clicking /usr with your middle mouse button. This will open it and leave the mplayer folder open too. Right click in /usr and ->New->Directory. Create /local. Click on /local and create /lib, etc. Once you have created /mini-icons you can drag mplayer.xpm from the mplayer folder to /mini-icons and choose Move. Now its in the right place.

6)Now lets deal with pinstall.sh. Open it as text. The important line here is "echo '#!/bin/sh' > ./usr/local/bin/defaultmediaplayer". It wants to rewrite defaultmediaplayer! Not a good idea if we want to try out different mediaplayers from .sfs files. Lets just delete pinstall.sh and we'll deal with this another way. What we will do is rewrite /usr/local/bin/defaultmediaplayer ourselves. I'll cover this in the adapting for ChoicePup section but you could do the same in any version of puppy. (There isn't always a pinstall.sh. Often they build symlinks to the main exec file "ln". We'll talk about that below.)

7)Next we need to figure out which file actually runs mplayer. To do this we will go to /usr/share/applications/mplayer.desktop. Right click on it and Open as Text. Looking at the Exec line we see that mplayershell is the file we want, but where is it? If no path is specified then the exec file should be in /usr/bin, /usr/sbin, or /usr/local/bin. Looking in /usr/bin there it is, /usr/bin/mplayershell.

I want to link this to the RightClick->OpenWith menu. So, we need to create more folders. Use the green up arrow to go back up to the main mplayer folder where you can see /etc and /usr. Create /root and then click on it with the middle button. Now create /.config/rox.sourceforge.net/OpenWith. In the other folder (/etc,/usr,/root) go back to /usr/bin. Drag mplayershell to the OpenWith folder and chooce "Link (relative)". After this you can rename the link to "mplayer" if you want. Now mplayer is on the OpenWith menu.

8)Now its time to deal with the two other .pets, codecs and plugin. Use the up arrow to get back to your ext3 workspace where you can see all three folders, mplayer, codecs and plugin. Middle click on mplayer. Middle click on codecs. No pinstall.sh just /usr. Drag /usr for codecs to mplayer and choose "Copy". Puppy will ask if you want to merge. Hold down the enter key until everything is copied. Close the codecs window.

Middle click on plug-in. Drag /etc to mplayer. Repeat the copying process. Drag /usr to mplayer. Repeat the copying process.

9)Dealing with defaultmediaplayer. In Choicepup I have set defaultmediaplayer to look for a file called "media". I'll talk about that more below but right now we have to create one more symlink. Create /usr/local/bin. Go back up to mplayer. Middle click on /usr. In one window go to /usr/local/bin. In the other go to /usr/bin. Drag /usr/bin/mplayershell to /usr/local/bin and choose "Link (relative)". Rename this link to "media". Now defaultmediaplayer will find it and run it.

10)Create the .sfs. Go back to the ext3 work area. Close any other folders. Right click on a blank space in the work area and choose "Window->Terminal Here". In this terminal type "dir2sfs mplayer-1.0rc2-071007-1". When you hit "Enter" a new .sfs file, mplayer-1.0rc2-071007-1_412.sfs (or _411.sfs, etc. I've been taking this out since mine are renamed to include the ch- prefix), will be created along with a md5.txt file. This is your new .sfs package. Try it out. If it works, congratulations. If not delete and try to figure out what went wrong. Usually at this stage I see things I forgot to include or little bugs. The original folders are still there to work with so its easy to go back and make changes.
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Sun 05 Apr 2009, 23:29    Post subject:  

Adapting to ChoicePup

1)Default files
I have rewritten several of the "default" files in /usr/local/bin.
as mentioned above for defaultmediaplayer. It looks for a file called "media" provided by a symlink to gxineshell, vlc, xine, or now mplayershell.
Code:
#!/bin/sh
  if [ -L /usr/local/bin/media ]; then
     exec /usr/local/bin/media "$@"
  else
    Xdialog --wrap --title "Program Not Loaded" --msgbox "Hi, You have not loaded a MediaPlayer yet. Try gxine-0.5.9choice.sfs, vlc-0.8.6choice.sfs or xine-ui-0.99.5choice.sfs. This box will remain until you press the ENTER key.\n" 10 60
  fi

Default Browser looks for "mozstart" provided by a symlink to firefox, seamonkey or opera.
Code:
!/bin/sh
  if [ -L /usr/local/bin/mozstart ]; then
    exec /usr/local/bin/mozstart "$@"
  else
    exec netsurf "www.google.ca"
  fi


Defaultpaint looks for "paint"
Defaultdraw looks for "draw"
Defaultpdfviewer looks for "pdfview"
Defaulttexteditor looks for "editor
Defaultwordprocessor looks for "writer"
Defaultspreadsheet looks for "spreadsheet"

If you provide the appropriately named symlink to the exec file in your .sfs package ChoicePup will find it and use it.

2)Menu Entries
There are several good .pets and .sfs's out there that do not have entries on the puppy menu. Their creators left them to be run from command line (or didn't convert them over from some other distro). I want ChoicePup to be easy for noobs so I would like everything there on the menu.

Let's take FlashGames from ch-games.sfs as an example, this is just a webpage that I put together with links to internet sites, but it had no entry on the "Fun" menu. So I opened the bubbles-1.0.2a.pet from the pet2 repository (which is also in ch-games.sfs) and copied /usr/share/applications/Bubbles.desktop to FlashGAmes.desktop. I then changed all mention of "Bubbles" to "Flashgames", changed the Exec=bubbles.tcl to Exec=flash_games (the exec file I created), changed Icon=ballorange16.xpm to Icon-mini-happy.xpm (I just looked for something appropriate in /usr/local/lib/X11/mini-icons), saved and placed it in /ch-games/usr/share/applications created ch-games.sfs and when I loaded ch-games.sfs there it was on the "Fun" menu.
Code:
[Desktop Entry]
Encoding=UTF-8
Name=FlashGames
Icon=mini-happy.xpm
Comment=FlashGames
Exec=flash_games
Terminal=false
Type=Application
Categories=Game
GenericName=FlashGames
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Sun 05 Apr 2009, 23:39    Post subject:  

I hope this is clear enough. If you have questions, comments, editorial suggestions or anything else you would like to say then please post a reply and I will try to answer.

Give it a try (maybe start with something simple). If you make a good .sfs package be sure and post a message here. I'm looking for new ones to add to the ChoicePup collection.

Cheers, J
Back to top
View user's profile Send private message 
magerlab

Joined: 08 Jul 2007
Posts: 731

PostPosted: Mon 06 Apr 2009, 23:23    Post subject:  

i'd like to point that it's better to open a terminal window and run
pet2tgz xxx*.pet than just rename a pet to tgz. there are errors sometimes when you just rename pet into tgz. also do nor forget to remove pet.specs file.

when creating sfs you can also use an asterisk for long file names

i made some sfs myself before ( for mplayer, qt4, dynamic skype etc) they all work fine

_________________
skype: desafimager
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Tue 07 Apr 2009, 00:03    Post subject:  

magerlab,
I have seen the pet2tgz command but never used it. Renaming has always worked for me. I'll try it. Also I forgot about mentioning to remove pet.specs.

Just tried typing dir2sfs ink* instead of dir2sfs inkscape-0.45.1. Worked great. Nice tip, I always make mistakes typing out long file names. This will save a lot of typing and retyping.

Have you got any .sfs's you think would go well with ChoicePup? If you upload them, maybe to http://ifile.it, I'd like to see them.

Thanks, J
Back to top
View user's profile Send private message 
reckrhodes

Joined: 30 May 2007
Posts: 116

PostPosted: Tue 07 Apr 2009, 01:21    Post subject:  

hi jrb

Maybe this bashguide_420.sfs will be of useful. I converted this from pet to sfs using Puppy Linux 4.2 using the createsfs script.

http://ifile.it/yzvie29/bashguide_420.sfs
useful-scripts.pet
Description  This one has so many useful scripts you can make use of.
pet

 Download 
Filename  useful-scripts.pet 
Filesize  66.63 KB 
Downloaded  455 Time(s) 
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Tue 07 Apr 2009, 10:37    Post subject:  

reckrhodes,
This bashguide is excellent! Did you make the original .pet? It appears to have been set up with making an .sfs in mind. The .desktop has path to icon and executable. With your permission I shall certainly add it to http://puppylinux.asia/members/choicepup/sfs.

I have to caution ChoicePup users about the useful-scripts.pet. It indeed has some very useful scripts which it places in /root/my-applications/bin. It also has load_sfs and unload_sfs which are built into ChoicePup. I have modified the ChoicePup load_sfs slightly, its in /usr/local/bin. Could create problems having two different versions installed. Similarly, the unload_sfs in useful-scripts is an updated version of the one I used. I want to try it out because currently larger .sfs's, like OpenOffice, just don't want to unload, even if it says "success". If you install this .pet then I recommend, for ChoicePup, deleteing these two from /root/my-applications/bin.

Thanks so much reckrhodes. I'll get that bash-guide updloaded later today. J
Back to top
View user's profile Send private message 
reckrhodes

Joined: 30 May 2007
Posts: 116

PostPosted: Fri 10 Apr 2009, 10:01    Post subject:  

Hi jrb.

Here is the ldconfig.pet. This will solve the problem of unloading big sfs file using the unload_sfs script. Good luck with your Choicepup puplet.
ldconfig.pet
Description  This will save ldconfig to /sbin. Needed for the unload_sfs script.
pet

 Download 
Filename  ldconfig.pet 
Filesize  404.48 KB 
Downloaded  595 Time(s) 
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Fri 10 Apr 2009, 12:43    Post subject:  

That did the trick! Very Happy
I was about to reply that I already had ldconfig in /sbin but then I took a look inside your pet and saw initrdinit, mkinitrd and sin. (Must be the last one that makes it work Laughing ) So I thought I better try it out. Sure enough, OpenOffice now loads and unloads, K-Office the same.

Thanks again reckrhodes, this is ChoicePup's first patch.

As for ChoicePup I put it together for myself and when it worked I thought I better share. I'm hoping this approach might catch on, maybe even with official versions of Puppy. I'm glad to see that Leon's 24 sfs initrd.gz has been incorporated into Puppy4.2. That's a start.
Back to top
View user's profile Send private message 
esmourguit


Joined: 17 Nov 2006
Posts: 1288
Location: Sur l'ile aux oiseaux.

PostPosted: Mon 13 Apr 2009, 12:14    Post subject:  

Bonjour,
@ jrb,
I tried to build a french localization file. I made the sfs file but when i tried to load it i had that answer : Failed! Could not union ch-french_412.sfs.
What's wrong?,
Cordialement Wink

_________________
Toutou Linux - Pets francisés
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Mon 13 Apr 2009, 13:11    Post subject:  

Hi esmourguit,
A number of questions:
Which puppy412 are you running? Standard, ChoicePup, something else?
How many other .sfs packages do you have loaded?
Have you gotten this message with any other .sfs package?
When you left click on your package does it open in ROX so you can see the contents?

Awaiting your reply, J
Back to top
View user's profile Send private message 
esmourguit


Joined: 17 Nov 2006
Posts: 1288
Location: Sur l'ile aux oiseaux.

PostPosted: Tue 14 Apr 2009, 03:48    Post subject:  

Bonjour,
@ jrb,
Thanks for your reply.
I was running Choicepup, none .sfs package loaded . So no message.
Just build the french one (Choicepup running) and tried to load it.
And yes, when i left clic on it, i can see the content in Rox windows, (see choicepup.png).
Cordialement Wink
choicepup.png
 Description   
 Filesize   226.28 KB
 Viewed   2432 Time(s)

choicepup.png


_________________
Toutou Linux - Pets francisés
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Tue 14 Apr 2009, 11:40    Post subject:  

esmourguit,
First I would try loading one of the other ch-.sfs packages to make sure load_sfs was working properly.
Then I would try rebooting and reloading ch-french_412.sfs.
Then I would reboot pfix=ram and try reloading.
Then I would copy ch-french_412.sfs to /mnt/home and try using bootmanager to load it at startup.
Then I would try building the .sfs package again.
Then I would try making a seperate .sfs package from each folder, /etc, /root, /sbin, /usr, and see if any or all of them loaded. If one of them refused then I would take a very careful look at its contents.

If none of the above worked I would upload the file, perhaps to http://www.myfreefilehosting.com/ (you don't have to put in email addresses), and let other puppy users, such as jrb, puzzle over it. Confused
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [23 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0979s ][ Queries: 12 (0.0040s) ][ GZIP on ]