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 13 Dec 2018, 18:22
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
How to make a single sfs file from multiple pets
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
Tman


Joined: 22 Jan 2011
Posts: 815
Location: Toronto

PostPosted: Sun 22 Jan 2012, 16:10    Post subject:  How to make a single sfs file from multiple pets
Subject description: easy-peasy
 

1) First, you will need to install 01micko's pet2sfs script.

2) Create a sfs folder inside any linux partition or...
if you are running a frugal install , you can also create the folder the linux filesystem. eg. the /root or /tmp folder.
- I must elaborate on this cause it's important. For example, I am running Puppy (frugal install) on sda1 which is a ntfs filesystem. If I create, a folder named /mnt/sda1/sfs, the permissions will get messed up because I created the sfs folder in the ntfs partition; it doesn't handle permissions the same way a linux partition does.
- to do this properly on a frugal install, what I usually do is create a /tmp/sfs folder.

3) copy all of the pets which you want to combine into the sfs folder you've created.

4) open up the terminal and change to the sfs folder you've created. For my example, I will use the /tmp/sfs folder. Enter the following code
Code:

cd /tmp/sfs
pet2sfs PackageName-1.0

Of course, "PackageName" can be any name that you choose.

5) After the sfs has been created, move it to the folder of your choice. You should then remove everything else in the /tmp/sfs folder.

6) The final step is to test your sfs to make sure it works.

The script can also convert a single pet into an sfs, but you have to name it different from the pet-name.
Done! Now that wasn't too difficult, right? Wink Enjoy.
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2621
Location: UK

PostPosted: Sun 22 Jan 2012, 16:59    Post subject:  

Also, there is this, which can create an SFS or PET of combined PET files:

"This script combines your .PETs into a single .PET or .SFS file.
You will be asked to create a .PET file first, then a .SFS file
if no .PET was created. This script takes one argument - the
directory containing the .PETs that you want to combine into
a single package."

Code:
#!/bin/sh

if [ ! $1 ];then
   echo "No dir given. Usage: `basename $0` [directory]
   
Example: `basename $0` $HOME/myfiles

Info:

This script combines your .PETs into a single .PET or .SFS file.
You will be asked to create a .PET file first, then a .SFS file
if no .PET was created. This script takes one argument - the
directory containing the .PETs that you want to combine into
a single package.

"
   exit
fi

mkdir $1/pets
mkdir $1/files
for i in "$1/"* ; do # for each file in the given package dir
   # get filenames, and extensions, without paths
   export fullname=`basename "$i"`    # filename and extension
   export filename=${fullname%.*}    # filename, no extension
   export extension=${fullname##*.} # extension only
   tar -xzvf "$i" -C "$1/pets"
   # copy extracted contents (only the stuff inside the extracted folders) from $workdir into $basedir
   cp --preserve=all -f -v -r "$1/pets/$filename/"* "$1/files"
   # remove pet.spec files in $basedir
   rm -v "$1/files/"*"pet.specs"
done
rm -r -v $1/pets
rmdir $1/pets

REPLY="none"
# ask to create pet
[ -e `which dir2pet` ] && Xdialog --title "Pet Create" --yesno "Do you want to create new pet file of the pets you have extracted?" 0 0 && REPLY=$?
if [ "$REPLY" = 0 ];then
   petname=$(Xdialog --title "Name your pet" --stdout --inputbox "Choose a filename for your pet file" 0 0 "name-version.pet")
   mv $1/files $1/${petname%.*} # rename dir to $petname, without extension
   rxvt -e dir2pet $1/${petname%.*}
else
   # ask to make sfs file
   [ -e `which dir2pet` ] && Xdialog --title "SFS Create" --yesno "Do you want to create an sfs file of the pets you have extracted?" 0 0 && REPLY=$?
   [ "$REPLY" = 0 ] && rxvt -e dir2sfs $1/files
fi


Save the code in a shell script or blank file and make executable
that is, in the terminal:

chmod +x /path/to/the/file

Usage:

easypackage /path/to/dir/containing/petfiles/

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4844
Location: Blue Springs, MO

PostPosted: Sun 22 Jan 2012, 19:54    Post subject:  

Can someone post this on a puppy site so that we don't keep repeating:
http://www.murga-linux.com/puppy/viewtopic.php?t=53241
It contains all info for ISO, sfs and pets using GUI tools only

_________________
Check out my github repositories. I may eventually get around to updating my blogspot.
Back to top
View user's profile Send private message Visit poster's website 
Aitch


Joined: 04 Apr 2007
Posts: 6815
Location: Chatham, Kent, UK

PostPosted: Mon 23 Jan 2012, 10:05    Post subject:  

Quote:
Can someone post this on a puppy site so that we don't keep repeating:


techno
I've put a request to darkcity for a wiki page Very Happy

Aitch Smile
Back to top
View user's profile Send private message 
RedQuine

Joined: 20 Mar 2015
Posts: 6

PostPosted: Fri 20 Mar 2015, 10:42    Post subject:    

Thanks for the clear instructions, Aitch. That not only worked a treat, it was kind of fun as well. Smile

One tiny correction, though: the pet2sfs script is at http://www.smokey01.com/Tman/apps/Common-apps/
Back to top
View user's profile Send private message 
rufwoof

Joined: 24 Feb 2014
Posts: 2711

PostPosted: Fri 20 Mar 2015, 14:15    Post subject:  

Another method that I sometimes use is to rename the pet with a .tgz suffix and open (archiver) that tar file, select all and copy to a temp work folder ... repeating for each pet so that they're all mixed in together. And then run mksquashfs to create a sfs of that directory/folder tree.
Back to top
View user's profile Send private message 
LazY Puppy


Joined: 21 Nov 2014
Posts: 2007
Location: Germany

PostPosted: Fri 20 Mar 2015, 18:50    Post subject:  

Hi.

PaDS 1.0.4

Just put .pet, .deb and .txz files into a directory. Right-click the directory and choose Combine to SFS / Merge to SFS.

It can handle the i386-linux-gnu directory / symbolic link issue (like in multiarch distros like Ubuntu). Next version can handle also the x86_64-linux-gnu directory / symbolic link issue (like in multiarch 64bit distros like Ubuntu).

I think this is currently the most comfortable way to create SFS Modules from multiple .pet, .deb and .txz files.

_________________
RSH

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

No, but I gave my old drum kit away for free to a music store collecting instruments for refugees! Wink
Back to top
View user's profile Send private message 
slavvo67

Joined: 12 Oct 2012
Posts: 1574
Location: The other Mr. 305

PostPosted: Sun 22 Mar 2015, 11:45    Post subject:  

PADS works quite well!! I'm sure Technosaurus' option is good, as well.

Best,

Slavvo67
Back to top
View user's profile Send private message 
michaellowe


Joined: 17 Dec 2011
Posts: 69
Location: The Garden

PostPosted: Tue 28 Jul 2015, 07:36    Post subject: How to make a single sfs file from multiple pets  

RedQuine wrote:
Thanks for the clear instructions, Aitch. That not only worked a treat, it was kind of fun as well. Smile

One tiny correction, though: the pet2sfs script is at http://www.smokey01.com/Tman/apps/Common-apps/


Thank you I dont know how you found it but thank you!!

got so frustrated when I kept getting error 404 on the old link to 01micko's pets2sfs

Cheers

_________________
Smash forehead on keyboard to continue.....
well thats at least how some of us deal with ba$h !
Back to top
View user's profile Send private message 
mikeslr


Joined: 16 Jun 2008
Posts: 2844
Location: 500 seconds from Sol

PostPosted: Mon 09 Apr 2018, 22:51    Post subject: 01micko's pet2sfs-01micko's script  

Hi All,

Noticing that the link to the script was broken, I've attached the contents of a file located on my hard-drive which I think was a copy of it:

#!/bin/sh
#script to turn a pack of puppy pets into an sfs
#plonk this in your $PATH.. suggest /usr/sbin
#usage
#make a directory any where you like and put in a bunch of pet packages
#invoke IN THAT DIRECTORY "pet2sfs <somename>-<verionnumber>"
#OR invoke IN THAT DIRECTORY "pet2sfs <somename>-<verionnumber> <option-for-mksquashfs>"
#give it a version number
#extra parameter if you want to preserve inodes or add other options to 'mksquashfs' eg -noI
[[ $1 = "" ]]&& echo "error, you must give a name for you new sfs" && exit
[[ `echo $1|grep "-"` = "" ]]&& echo "error, you must give a version number using a dash to delimit for you new sfs" && exit
CURDIR=`pwd`
cd $CURDIR
DIR="$1"
mkdir $DIR
LIST=`ls|grep pet$`
#extract pets
for i in $LIST;do
PKGNAME=`basename $i .pet`
mv -f $i ${i}.tar.gz
tar -zxf ${i}.tar.gz 2>/dev/null
cp -rf $PKGNAME/* $DIR
rm -rf $PKGNAME
mv -f ${i}.tar.gz $i
sync
continue
done
cd $CURDIR/$DIR
rm -f pet.specs
[ -x pinstall.sh ] && rm -f pinstall.sh
[ -x puninstall.sh ] && rm -f puninstall.sh
cd $CURDIR
#make sfs
echo "now making ${DIR}.sfs" &
sleep 2
mksquashfs $DIR ${DIR}.sfs $2
sync
[[ `ls|grep ${DIR}.sfs` = "" ]]&& echo "error: something went wrong, ${DIR}.sfs didn't get created" && cd $HOME &&exit
cd $HOME
echo "${DIR}.sfs created. All done"
echo "Now try to ENJOY and IMPROVE your life!"

mikesLr
Back to top
View user's profile Send private message 
musher0

Joined: 04 Jan 2009
Posts: 13162
Location: Gatineau (Qc), Canada

PostPosted: Mon 09 Apr 2018, 23:46    Post subject:  

Hi MikesLr.

Thanks for the salvage operation.

BFN.

_________________
musher0
~~~~~~~~~~
Je suis né pour aimer et non pas pour haïr. (Sophocle) /
I was born to love and not to hate. (Sophocles)
Back to top
View user's profile Send private message 
bigpup


Joined: 11 Oct 2009
Posts: 11378
Location: S.C. USA

PostPosted: Tue 10 Apr 2018, 15:11    Post subject:  

Here is the above script code made into a script file.
Had to add .gz to the name so it would post to the forum.
Just remove the .gz from the name to turn it into the script file.

Place it in a location that is in the PATH.. listing, so it is easily accessed.
suggest /usr/sbin

Do need to follow the steps, in the first post of this topic, to use it.
pet2sfs script.gz
Description 
gz

 Download 
Filename  pet2sfs script.gz 
Filesize  1.3 KB 
Downloaded  111 Time(s) 

_________________
I have found, in trying to help people, that the things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected Shocked
Back to top
View user's profile Send private message 
version2013

Joined: 08 Sep 2013
Posts: 392
Location: Florida, USA

PostPosted: Fri 13 Apr 2018, 22:23    Post subject:  

RedQuine wrote:
[quote link]
One tiny correction, though: the pet2sfs script is at http://www.smokey01.com/Tman/apps/Common-apps/

Thank you for pointing out the file location.

mikeslr wrote:
[quote link]
Noticing that the link to the script was broken, I've attached the contents of a file located on my hard-drive which I think was a copy of it:

bigpup wrote:
[quote link]
Here is the above script code made into a script file.

Just one minor difference that I noticed.
The script you two posted, fails to contain the permissions on line 39, in the pet2sfs_01micko-0.2.pet file.
Not sure if that matters much.
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
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.0693s ][ Queries: 12 (0.0111s) ][ GZIP on ]