Edit-SFS 2.1 (squash filesystem editor)
- Pizzasgood
- Posts: 6183
- Joined: Wed 04 May 2005, 20:28
- Location: Knoxville, TN, USA
Edit-SFS 2.1 (squash filesystem editor)
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
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]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
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
Best regards,
s
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
Best regards,
s
- Pizzasgood
- Posts: 6183
- Joined: Wed 04 May 2005, 20:28
- Location: Knoxville, TN, USA
Thank you
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: and a couple of cosmetic mods e.g., line 220:Thanks again,
TazOC
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
Code: Select all
rxvt -bg GoldenRod2 -geometry 80x4 -e "${TREE_BASE}/script"
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]
- Pizzasgood
- Posts: 6183
- Joined: Wed 04 May 2005, 20:28
- Location: Knoxville, TN, USA
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.
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]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
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?
If so, or you know what im talking about, could you point me in the right direction?
- Pizzasgood
- Posts: 6183
- Joined: Wed 04 May 2005, 20:28
- Location: Knoxville, TN, USA
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:
That will create /tmp/work.sfs, containing everything that was inside /tmp/work/.
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
[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]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
pizzasgood,
thanks for the info, another question for you however
You said:
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.
thanks for the info, another question for you however
You said:
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 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.
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.
- Pizzasgood
- Posts: 6183
- Joined: Wed 04 May 2005, 20:28
- Location: Knoxville, TN, USA
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:
You unmount it when done with the umount command (not a typo, there is no 'n' in umount):
The following command mounts a 200 megabyte ramdisk on /mnt/data:
Code: Select all
mount -t tmpfs -o size=200m tmpfs /mnt/data
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]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
sweet, I can work with that then. Thanks! and good luck with finals, hahaPizzasgood 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:You unmount it when done with the umount command (not a typo, there is no 'n' in umount):Code: Select all
mount -t tmpfs -o size=200m tmpfs /mnt/data
Code: Select all
umount /mnt/data
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...
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...
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!
Puppy since 2.15CE...
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 2289 times
- Pizzasgood
- Posts: 6183
- Joined: Wed 04 May 2005, 20:28
- Location: Knoxville, TN, USA
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]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
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...
Whatever it takes to D/L is, after you reboot to Puppy, rename it to *.pet first to install it in Puppy..
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...
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...
I am Lead Dog of the
Puppy Linux Users Group on Facebook
Join us!
Puppy since 2.15CE...