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 Fri 25 Jul 2014, 19:04
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Merge Utility for SFS
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [10 Posts]  
Author Message
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Fri 04 Feb 2011, 03:29    Post subject:  Merge Utility for SFS
Subject description: combine SFS packages
 

Merge SFS files

(usage with script named "merge")

USAGE: merge [ one.sfs two.sfs...]

Output: merge.sfs

Code:

#!/bin/sh -a

[ "$1" == "" -o "$1" == "-h" ] && echo "USAGE: merge [ one.sfs two.sfs...]" && exit

 
MERGE="/tmp/merge"
  mkdir "$MERGE"

FILES="/tmp/files"
  mkdir "$FILES"

 NUM="$#"

i=0
for  ((i=0;i<$NUM;i++)); do
   
   mount "$1" "$FILES" -o loop,ro
   cp -rp ${FILES}/* "$MERGE"
   umount "$FILES"
   sleep 1
shift
done
    mksquashfs "$MERGE"  merge.sfs

## cleanup;
rm -r "$MERGE"
rm -r "$FILES"

Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Fri 04 Feb 2011, 04:24    Post subject:  

Brilliant Smile
After the merge you could run the program again?

So we could easily create
Graphic SFS
or Browser SFS
bundles?

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Fri 04 Feb 2011, 04:43    Post subject:  

If I understand you, output is just another SFS that could be merged with something else. The output name defaults as "merge.sfs" You can merge several at once, however.. (Note: set MERGE & FILES dir to wherever you have enough space).
Back to top
View user's profile Send private message 
reckrhodes

Joined: 30 May 2007
Posts: 116

PostPosted: Fri 04 Feb 2011, 12:24    Post subject:    

Yepeey! This is what Linux for. The freedom to choose.

I have merge.sfs and createsfs. Thanks jpeps and mohan34u. Very Happy
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Fri 04 Feb 2011, 18:13    Post subject:  

reckrhodes wrote:
Yepeey! This is what Linux for. The freedom to choose.

I have merge.sfs and createsfs. Thanks jpeps and mohan34u. Very Happy

Cool! Now add Shinobars sfs-on-the-fly and Desktop-restore and you're set to go!! Very Happy
http://murga-linux.com/puppy/viewtopic.php?t=64354
http://murga-linux.com/puppy/viewtopic.php?t=64464
Back to top
View user's profile Send private message 
Q5sys


Joined: 11 Dec 2008
Posts: 1047

PostPosted: Fri 04 Feb 2011, 18:27    Post subject:  

nice little script. If you want to merge a ton of SFS files, there is another easy way to do it. Install the 'Edit SFS' script and then take all the SFS files you want, pop them open, drag'n'drop the files into one window and then build that window. Bingo... a dozen SFS files built into one. Smile
Now if only someone could create a GUI program, where you can just drag and drop however many SFS files you want and have it merge them all.. heh
Perhaps in V2 of your work? Razz

_________________



My PC is for sale
Back to top
View user's profile Send private message 
jemimah


Joined: 26 Aug 2009
Posts: 4309
Location: Tampa, FL

PostPosted: Fri 04 Feb 2011, 20:46    Post subject:  

Q5sys wrote:
nice little script. If you want to merge a ton of SFS files, there is another easy way to do it. Install the 'Edit SFS' script and then take all the SFS files you want, pop them open, drag'n'drop the files into one window and then build that window. Bingo... a dozen SFS files built into one. Smile
Now if only someone could create a GUI program, where you can just drag and drop however many SFS files you want and have it merge them all.. heh
Perhaps in V2 of your work? Razz


There is a gui Ecube and I wrote Fluppy. It's a roxapp based on edit-sfs.

(It needs xpupsay for the dialog).
xpupsay-1.2.1-i486.pet
Description 
pet

 Download 
Filename  xpupsay-1.2.1-i486.pet 
Filesize  86.74 KB 
Downloaded  457 Time(s) 
Combine-SFS-01.pet
Description 
pet

 Download 
Filename  Combine-SFS-01.pet 
Filesize  8.96 KB 
Downloaded  622 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Fri 04 Feb 2011, 22:51    Post subject:  

jemimah...think it needs some work. Files shouldn't HAVE to be in /mnt/home to include. Dragging onto the icon should list them, not just open up the program. Shouldn't need a few gigs to merge a few SFS's; also It's failing to even combine 2 little test SFSs.
Code:

ERROR - unsquashfs failed to expand /initrd/mnt/dev_save/myfiles.sfs
It returned the following error message:


This should be something SIMPLE that works. I like the pooches for the wireless, but gets old for simple utilities.

Doesn't seem to work as cli.
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sat 05 Feb 2011, 01:27    Post subject:  

Q5sys wrote:

Now if only someone could create a GUI program, where you can just drag and drop however many SFS files you want and have it merge them all.. heh
Perhaps in V2 of your work? Razz


Hi Q5sys,

The nice thing about scripts is that you can incorporate them anyway you like. For your request, all you need is to have items dragged to an icon listed to a file. Then simply run the list as arguments to the script above. Very simple, and fun to try for yourself.

BTW/ I don't know why you'd want to open SFS's and drag files, etc. A script does that for you.
Back to top
View user's profile Send private message 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Sat 05 Feb 2011, 16:04    Post subject:  

Here's a simple icon click version.
USAGE: Drag sfs files to desktop icon. Click on icon to create merge.sfs in /mnt/home

Desktop Icon: merge-icon; Place on desktop

Code:

#/bin/sh

### Desktop Icon for rox-merge
## USAGE: Drag SFS files to icon; click on icon to create merge.sfs
##          Click to create merge.sfs in /mnt/home
 

if [ "$1" == "" ]; then
 
  if [ -f /tmp/list ]; then
      rox-merge 
     
yaf-splash -font "8x16" -outline 0 -margin 4  -fg black -text "merge.sfs in /mnt/home"
  fi
exit
fi
 
echo $@ >>/tmp/list 


rox-merge script (name "rox-merge" and place in PATH)
note: you can edit MERGE and FILES directories for more space or
to change output directory from /mnt/home (if not using pupsave, etc).


Code:

#!/bin/sh
 

 if [ -f /tmp/list ]; then

  MERGE="/tmp/merge"
   mkdir "$MERGE"

  FILES="/tmp/files"
     mkdir "$FILES"

   while read line; do 
   
        mount "$line" "$FILES" -o loop,ro
        cp -rp ${FILES}/* "$MERGE"
        umount "$FILES"
        sleep 1
    done </tmp/list

mksquashfs "$MERGE"  /mnt/home/merge.sfs

## cleanup
   rm -r "$MERGE"
   rm -r "$FILES"
   rm /tmp/list
fi
rox-merge.pet
Description  Desktop Icon: /usr/local/bin/merge-icon
pet

 Download 
Filename  rox-merge.pet 
Filesize  792 Bytes 
Downloaded  416 Time(s) 
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [10 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0928s ][ Queries: 13 (0.0259s) ][ GZIP on ]