Author |
Message |
jpeps
Joined: 31 May 2008 Posts: 3217
|
Posted: 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
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15238 Location: Paradox Realm
|
Posted: Fri 04 Feb 2011, 04:24 Post subject:
|
|
Brilliant
After the merge you could run the program again?
So we could easily create
Graphic SFS
or Browser SFS
bundles?
_________________ YinYana AI Buddhism
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 3217
|
Posted: 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
|
|
 |
reckrhodes
Joined: 30 May 2007 Posts: 116
|
Posted: 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.
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 3217
|
Posted: 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.  |
Cool! Now add Shinobars sfs-on-the-fly and Desktop-restore and you're set to go!!
http://murga-linux.com/puppy/viewtopic.php?t=64354
http://murga-linux.com/puppy/viewtopic.php?t=64464
|
Back to top
|
|
 |
Q5sys

Joined: 11 Dec 2008 Posts: 1126
|
Posted: 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.
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?
|
Back to top
|
|
 |
jemimah

Joined: 26 Aug 2009 Posts: 4309 Location: Tampa, FL
|
Posted: 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.
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?  |
There is a gui Ecube and I wrote Fluppy. It's a roxapp based on edit-sfs.
(It needs xpupsay for the dialog).
Description |
|

Download |
Filename |
xpupsay-1.2.1-i486.pet |
Filesize |
86.74 KB |
Downloaded |
643 Time(s) |
Description |
|

Download |
Filename |
Combine-SFS-01.pet |
Filesize |
8.96 KB |
Downloaded |
960 Time(s) |
|
Back to top
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 3217
|
Posted: 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
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 3217
|
Posted: 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?  |
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
|
|
 |
jpeps
Joined: 31 May 2008 Posts: 3217
|
Posted: 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
|
Description |
Desktop Icon: /usr/local/bin/merge-icon
|

Download |
Filename |
rox-merge.pet |
Filesize |
792 Bytes |
Downloaded |
581 Time(s) |
|
Back to top
|
|
 |
|