Edit-SFS 2.1 (squash filesystem editor)

Miscellaneous tools
Message
Author
User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

Edit-SFS 2.1 (squash filesystem editor)

#1 Post by Pizzasgood »

edit_sfs-2.1.pet

This is a simple roxapp (click-able folder that runs a script, very handy things) that allows you to edit an xxxx.sfs file like pup_xxx.sfs, or devx_xxx.sfs. It takes care of extracting and recompressing. All you need to do is supply the file, edit it, then receive the new file.

It will install to /root/my-roxapps/Edit-SFS. If you feel like modifying it, right-click, choose "look inside", and edit the AppRun file.

You can use this several different ways. Just clicking the /root/my-roxapps/Edit-SFS file will run it and let you supply a path to a .sfs file (or drag the file onto the field). Alternately, you can drag a .sfs file directly onto /root/my-roxapps/Edit-SFS itself. I also added a symlink into /usr/bin, so you can run the command edit-sfs /path/to/file.sfs (or drag-and-drop onto the binary). Finally, this package also installs a right-click action in ROX-Filer for .sfs files.


The first time you run it, you will also be asked to tell it where you want to make the working directory. This should be on a Linux partition. Depending on the size of the file you're editing, you may need several hundred megabytes free. You also have an option of having Edit-SFS set up a temporary ramdisk. That's usefull if you're using Puppy on a computer with a no Linux partitions besides your possibly too cramped pup_save.2fs file. Keep in mind however that a ramdisk requires ram, so if you don't have hundreds of megabytes of ram available, that won't work so well. (Don't forget, if your Puppy already copied pup_xxx.sfs to ram, or you're running with pfix=ram, then you are probably already using about a hundred MB or more of ram for that!)

If you ever change your mind about the location, go to /root/my-roxapps/ and right-click on the Edit-SFS icon. You'll see an entry that says "Set base dir". Use that and it will redisplay the above window.


Once it knows which file to use and where to work, it will decompress the .sfs file into a temporary directory in that location. When it finishes it will present you with a new window featuring the file's extracted content. When you are done editing, click "Build" and it will close the window, compress the data, and present you with a freshly compressed .sfs file. Place that somewhere for safe-keeping before hitting "Finished". When ready, clicking the "Finished" button will delete the working directory in the process of cleaning up after itself. It also unmounts any ramdisk it may have created. Then you're done.






This version of Edit-SFS should be much more efficient than previous versions, as it reads the sfs file from the location where it is already at rather than copying it first. It also has limited compatibility with both versions 3 and 4 of squashfs. In Puppies older than 4.3 it only supports 3 unless you go out of your way to add support for 4. But in Puppy 4.3 and newer it should be able to deal with both versions. The file it creates will be in the same format as the original, or at least close (if the original was 3.0 but you have 3.1, the final file will be 3.1). They way I implemented that isn't ideal, but it gets the job done and should be easy enough for people to deal with if they need to tack on support for even newer versions of squashfs at some point.

Unlike the previous versions, this one also shows the status as it compresses.

Also, this version doesn't care if you run multiple instances. It uses mktemp to generate unique temporary directories.


updated 2009.10.13: give output file the same permissions as the input file
Last edited by Pizzasgood on Tue 13 Oct 2009, 04:18, edited 1 time in total.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#2 Post by seaside »

Pizzasgood,

Thanks for putting together this application, especially in view of trying to cater to the lack of backward compatibility issues involved.

Choicepup43 is identifying SFS files for Choicepup43 by placing "ch4" in the title and I was wondering if there is any "general" standard naming for other sfs files created in puppy 43.

(Tried out your editor with old sfs files in a couple of pre43 puppies and everything worked very nicely - great work)

Many thanks again for your dedication and fine work across all areas of Puppydom :D

Best regards,
s

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#3 Post by Pizzasgood »

Not that I know of, but I'm not a very big part of the .sfs scene.

And you're welcome. :)
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
tazoc
Posts: 1157
Joined: Mon 11 Dec 2006, 08:07
Location: Lower Columbia Basin WA US
Contact:

Thank you

#4 Post by tazoc »

Hi Pizzasgood,
I really like your new version of Edit-SFS, especially giving the choice of ramdisk or linux partition. I will test it some more and put it in Lighthouse Pup.

I added this before line 222:

Code: Select all

chmod a+r "$TREE_BASE/$SFSFILE" # TazOC make read all for web posting
and a couple of cosmetic mods e.g., line 220:

Code: Select all

rxvt -bg GoldenRod2 -geometry 80x4 -e "${TREE_BASE}/script"
Thanks again,
TazOC
[url=http://www.lhpup.org/][b][size=100]lhpup.org[/size][/b] [img]http://www.lhpup.org/gallery/images/favicon.png[/img][/url] [url=http://www.lhpup.org/release-lhp.htm#602]Lighthouse 64 6.02[/url]

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#5 Post by Pizzasgood »

I didn't realize the file it creates had funny permissions. I just uploaded version 2.1, which attempts to give it the permissions of the original .sfs file.

Thanks for pointing that out.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
Q5sys
Posts: 1105
Joined: Thu 11 Dec 2008, 19:49
Contact:

#6 Post by Q5sys »

I dont know if it was something you made or someone else made but I cant seem to find it now... But have you created an SFS creation utility that works similar to this? Makes a directory in /tmp/ which you drop in whatever you want and then it saves it into an SFS?
If so, or you know what im talking about, could you point me in the right direction?

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#7 Post by Pizzasgood »

It wasn't me. I believe something like that was created, but I don't remember the name.

Anyway, it's pretty simple to do by hand. You create a directory, let's say /tmp/work. You put stuff into it. Then when you are ready to build it, you run a command like this:

Code: Select all

mksquashfs /tmp/work /tmp/work.sfs
That will create /tmp/work.sfs, containing everything that was inside /tmp/work/.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
Q5sys
Posts: 1105
Joined: Thu 11 Dec 2008, 19:49
Contact:

#8 Post by Q5sys »

pizzasgood,
thanks for the info, another question for you however
You said:
You also have an option of having Edit-SFS set up a temporary ramdisk. That's usefull if you're using Puppy on a computer with a no Linux partitions besides your possibly too cramped pup_save.2fs file. Keep in mind however that a ramdisk requires ram, so if you don't have hundreds of megabytes of ram available, that won't work so well.
This is exactly what I have been trying to figure out how to accomplish on my own. Have you, or could you, create a tiny app just for creating ramdisks. Basically you already have the process done. I'm just looking for a small app that I can run that gives me the option to create a ramdisk of X size (Im prompted for the size), I click ok. And its made, and in the same way, there is another button or window that pops up that when I close, the ramdisk is deleted.
You're edit sfs already accomplishes this task, and so what I have been doing is opening a sfs file and then deleting it out of the temp disk and then putting what i need in there and then eventually deleting it and thus creating a empty sfs file. But could you be kind enough to create a dedicated app just for creating and then purging a ramdisk... since you've already accomplished it.

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#9 Post by Pizzasgood »

Sorry, but it's the end of the semester, so I'm too busy to do much of anything besides breath.

The following command mounts a 200 megabyte ramdisk on /mnt/data:

Code: Select all

mount -t tmpfs -o size=200m tmpfs /mnt/data
You unmount it when done with the umount command (not a typo, there is no 'n' in umount):

Code: Select all

umount /mnt/data
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
Q5sys
Posts: 1105
Joined: Thu 11 Dec 2008, 19:49
Contact:

#10 Post by Q5sys »

Pizzasgood wrote:Sorry, but it's the end of the semester, so I'm too busy to do much of anything besides breath.

The following command mounts a 200 megabyte ramdisk on /mnt/data:

Code: Select all

mount -t tmpfs -o size=200m tmpfs /mnt/data
You unmount it when done with the umount command (not a typo, there is no 'n' in umount):

Code: Select all

umount /mnt/data
sweet, I can work with that then. Thanks! and good luck with finals, haha :)

User avatar
jim3630
Posts: 791
Joined: Mon 14 Feb 2011, 02:21
Location: Northern Nevada

#11 Post by jim3630 »

hi, link in first post is dead.

anyone have a copy of edit_sfs.2.1? thanks

User avatar
rcrsn51
Posts: 13096
Joined: Tue 05 Sep 2006, 13:50
Location: Stratford, Ontario

#12 Post by rcrsn51 »

You can do this manually.

1. unsquashfs old.sfs
2. modify the folder squashfs-root
3. mksquashfs squashfs-root new.sfs

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#13 Post by puppyluvr »

:D Hello,
Q5sys,
You probably were thinking oe DevTools, which will unpack/rebuild an ISO/SFS/Initrd for you..
Pizzasgood,
Thanks for the ramdisk script, quite useful...
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...

User avatar
Geoffrey
Posts: 2355
Joined: Sun 30 May 2010, 08:42
Location: Queensland

#14 Post by Geoffrey »

jim3630 wrote:hi, link in first post is dead.

anyone have a copy of edit_sfs.2.1? thanks
Attachments
edit_sfs-2.1.pet
(7.93 KiB) Downloaded 2280 times

User avatar
jim3630
Posts: 791
Joined: Mon 14 Feb 2011, 02:21
Location: Northern Nevada

#15 Post by jim3630 »

Geoffrey wrote:
jim3630 wrote:hi, link in first post is dead.

anyone have a copy of edit_sfs.2.1? thanks
Geoffrey, thanks so much.

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#16 Post by Pizzasgood »

Yeah, my website randomly disappeared for some reason. Been distracted the last couple days and didn't notice until tonight. Just sent in a support ticket to find out wtf happened.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
chrome307
Posts: 708
Joined: Thu 15 Jan 2009, 11:00

#17 Post by chrome307 »

Hi there

Is the pet file still available?

I have checked the link in the 1st post and on the wikki and it gives me a file:

editsfs-2.1.man (?) 8kb

should this not be a *.pet file?

Thanks in advance!

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#18 Post by puppyluvr »

Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...

User avatar
chrome307
Posts: 708
Joined: Thu 15 Jan 2009, 11:00

#19 Post by chrome307 »

Hi there, thanks for letting me know, but I still appear to have the same problem :oops:

Image

User avatar
puppyluvr
Posts: 3470
Joined: Sun 06 Jan 2008, 23:14
Location: Chickasha Oklahoma
Contact:

#20 Post by puppyluvr »

:D Hello,
LOL, the screen shot helped a lot..
You are using Windows to D/L it, and Windoze dont see no .pet files..
I believe that whatever Winblows calls it, D/L it, and reboot to Puppy, it should show up as a .pet..
But really, I recommend D/Ling it in Puppy...
If it wont D/L try renaming it .zip first... :wink:
Whatever it takes to D/L is, after you reboot to Puppy, rename it to *.pet first to install it in Puppy..
Close the Windows, and open your eyes, to a whole new world
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!

Puppy since 2.15CE...

Post Reply