| Author |
Message |
jcoder24

Joined: 06 May 2005 Posts: 601 Location: Barbados
|
Posted: Mon 09 Feb 2009, 20:21 Post subject:
|
|
| WhoDo wrote: | | jrb wrote: | | Does anyone know where the contents of mounted .sfs files gets stored (or not)? |
/initrd/pup_roX where X is the assignment number for each sfs file mounted. |
Actually, "load_sfs" as you call it creates a sub-director in /mnt and mounts the sfs there. Eg load_sfs opera10.sfs will create /mnt/opera10 and mount/load the file there.
Since the script does not facilitate removal, the new folders remain after rebooting (provided you didn't boot with pfix=ram). We can create the folders as hidden folder instead.
~~~
If were are going to putting this in an official release, we should clean up the code. ie remove some of the logger and echo statements and some of the comments. I'll see what I can do in the next few days.
If you don't mind can you document your changes in the script and add the date of change? Also update the "#last mod" date.
|
|
Back to top
|
|
 |
jrb

Joined: 11 Dec 2007 Posts: 972 Location: Smithers, BC, Canada
|
Posted: Tue 10 Feb 2009, 00:21 Post subject:
|
|
Hi jcoder,
Actually I've done very little coding. Mostly, as here, I've followed someone else's code and made changes to suit my needs. It wasn't until after I had posted that I realized I should have marked my changes. Just got excited I guess.
I've actually built two .pets from your code. One for puppy412 as posted here and one for puppy412a4 which is posted in the bug fix thread. When I realized the first one wouldn't work on the ROX right-clicks I rebuilt it. I also packaged the second one with ldconfig. I'm not sure its necessary but felt it wouldn't hurt.
As for removing comments I think you should definitely keep "A module with this name is already loaded!" and "Failed". The "sfs is located on a cdrom" seems unnecessary as it seems to mount and run modules from cd really well.
This code works really well. I'm totally impressed. I think it will become a major feature of puppy.
Here are my (minor) changes for both .pets starting at line 120. Do you want me to repost the .pets with the documentation?
Load_sfs
| Code: | mount -o remount,append:/mnt/$sfs_module=ro /
status=$?
if [ $status -eq 0 ]; then
#fixmenus & restartwm added by jrb 6feb09
fixmenus
restartwm
#"Success" message removed by jrb 6feb09
else
Xdialog --title "sfs_handler" --msgbox "Failed! `basename $sfs_module` module not loaded.\n" 6 0
fi
else
umount $free_loop
losetup-FULL -d $free_loop
Xdialog --title "sfs_handler" --msgbox "Failed! Could not mount $sfs_module.\n" 6 0
fi
else
Xdialog --title "sfs_handler" --msgbox "Failed! Could not setup $free_loop for $sfs_module.\n" 6 0
fi |
load_sfs-420
| Code: | mount -o remount,append:/mnt/$sfs_module=ro /
status=$?
if [ $status -eq 0 ]; then
#ldconfig, fixmenus, restartwm added by jrb 8feb09
ldconfig
fixmenus
restartwm
#"Succes" menu deleted by jrb 8feb09
else
Xdialog --title "sfs_handler" --msgbox "Failed! `basename $sfs_module` module not loaded.\n" 6 0
fi
else
umount $free_loop
losetup-FULL -d $free_loop
Xdialog --title "sfs_handler" --msgbox "Failed! Could not mount $sfs_module.\n" 6 0
fi
else
Xdialog --title "sfs_handler" --msgbox "Failed! Could not setup $free_loop for $sfs_module.\n" 6 0
fi |
|
|
Back to top
|
|
 |
jrb

Joined: 11 Dec 2007 Posts: 972 Location: Smithers, BC, Canada
|
Posted: Wed 11 Feb 2009, 20:29 Post subject:
|
|
I have added a version of load_sfs packaged with ldconfig. This will load any lib files which your .sfs may contain. Also updated documentation in original load_sfs.pet
|
|
Back to top
|
|
 |
magerlab
Joined: 08 Jul 2007 Posts: 730
|
Posted: Mon 23 Feb 2009, 09:57 Post subject:
|
|
is it possible not to restart X after mounting sfs with that script?
_________________ skype: desafimager
www.youtube.com/sagartem -videos of my band
|
|
Back to top
|
|
 |
jrb

Joined: 11 Dec 2007 Posts: 972 Location: Smithers, BC, Canada
|
Posted: Mon 23 Feb 2009, 13:49 Post subject:
|
|
magerlab,
The short answer is yes. The long answer is I already set it up that way for puppy4.2 and just hadn't gotten around to doing it for 412. But I will post it above immediately after I finish this post.
I should mention that if you edit /root/.xinitrc and add fixmenus just before the end it will clear your menus of any remnants from previously loaded .sfs's
| Code: | #v3.95 support fbpanel tray/taskbar...
#only launch tray for w.m. without inbuilt tray...
if [ "$CURRENTWM" != "jwm" -a "$CURRENTWM" != "icewm" ];then
[ -f /usr/bin/fbpanel ] && fbpanel &
[ -f /usr/bin/lxpanel ] && lxpanel &
fi
#to refresh menus on boot - jrb 17feb09
fixmenus
#exec $CURRENTWM
#v2.11 GuestToo suggested this improvement...
which $CURRENTWM && exec $CURRENTWM
[ -x $CURRENTWM ] && exec $CURRENTWM
exec jwm
###END### |
|
|
Back to top
|
|
 |
jrb

Joined: 11 Dec 2007 Posts: 972 Location: Smithers, BC, Canada
|
Posted: Mon 23 Feb 2009, 14:17 Post subject:
|
|
| reckrhodes wrote: | | How many sfs's can I load without rebooting my computer? |
With the stock puppy I can open 4 .sfs's. If I use JB4x4's modified initrd.gz I can load 20.
You could instead add these lines to /etc/rc.d/rc.local
| Code: | mknod /dev/loop8 b: 7 8
mknod /dev/loop9 b: 7 9
mknod /dev/loop10 b: 7 10
mknod /dev/loop11 b: 7 11
mknod /dev/loop12 b: 7 12 |
which will give you 5 more and you can extend this further, not sure if there's a limit. See:WiKi » How Tos » General » SfsModuleCreation
|
|
Back to top
|
|
 |
jcoder24

Joined: 06 May 2005 Posts: 601 Location: Barbados
|
Posted: Mon 23 Feb 2009, 20:07 Post subject:
|
|
I have been working on this over the last week or so to make it more suitable for an official puppy release. Most of the changes are things that were accounted for but commented out in the code or things suggested in this thread. Apologies to jrb for duplicating some of his efforts.
Bug fixes
* fix unloading and unmounting loop devices if loading the sfs fails
* fix issue with symlinks to sfs files whose target don't exists
* fix issue where /dev/loop1n loop2n and loop3n were being excluded from selection
New features/changes
* testing for aufs before proceeding
* mounting sfs to /mnt/.sfs_file_name instead of /mnt/sfs_file_name
* provides better explanation of the 'cdrom warning'
* creating new loop devices as needed (must be supported by the kernel).
* support for post-install scripts.
* if no post install script is included in the sfs perform some default post-install actions.
Misc
* reorganised, optimised and cleaned up code.
* packaged as a dotpet with load_sfs moved to the more standard /usr/local/bin/ instead or /usr/sbin. rox openwith is included also.
* tested in puppy 4.12
TODO
* Determine if sfs file is located external storage media and warn user.
* restartwm without restarting xserver
Post-install (post-loading) scripts
The post-install scripts is a hidden file with the same name as the sfs, without extension. Eg if you have a sfs Wine-1.1.14_412.sfs your post-install file would be .Wine-1.1.14_412 and your directory structure for the sfs may look something
| Code: | Wine-1.1.14_412
|-- .Wine-1.1.14_412
|-- usr/
|-- root/
|-- etc/
|
If the post-install script is absent, load_sfs inspects the contents of the sfs and performs some post-install operations as needed. These include, making fonts, libraries and kernel modules accessible and running fixmenus. restartwm is also in the script but commented out since it also restarts xwindows.
| Description |
does not include ldconfig
|

Download |
| Filename |
load_sfs-0.8.pet |
| Filesize |
2.15 KB |
| Downloaded |
417 Time(s) |
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3843
|
Posted: Mon 23 Feb 2009, 20:44 Post subject:
|
|
I am stuck on windows right now so I can't test - sound great because I have been doing this manually after searching about 3 different forum threads ... just wondered if the install scripts support was the same as .pets (pinstall.sh)... also does unmounting run puninstall.sh?
The uninstall would probably need to be run directly from /mnt/.sfs_package_name/puninstall.sh prior to actual unmounting. Not many pet packages actually use puninstall.sh so its probably not a must have feature.
another idea ...
if [loading fails] then
NEXTLOOP = (use sed/grep to find last loop #) +1
mknod /dev/loop$NEXTLOOP b: 7 $NEXTLOOP
(RETRY MOUNTING SFS HERE)
fi
edit
I could maybe also update the dir2sfs with some stuff from dir2pet and add an Xdialog script (called pinstall.sh) that asks if you want to run the program now
_________________ Puppy Web Desktop Now with pet packages - Pet Packaging 100 & 101
|
|
Back to top
|
|
 |
magerlab
Joined: 08 Jul 2007 Posts: 730
|
Posted: Tue 24 Feb 2009, 01:37 Post subject:
|
|
i think the most wished thing is just mounting sfs with only fixmenus and restartwm not (if possible) restart X. Especially for people who are new to linux
thank you!
_________________ skype: desafimager
www.youtube.com/sagartem -videos of my band
|
|
Back to top
|
|
 |
brymway
Joined: 08 Dec 2007 Posts: 410
|
Posted: Tue 24 Feb 2009, 02:36 Post subject:
|
|
A suggestion to you who are doing this fine work on an
exciting development. Some of us simpletons don't really
follow exactly what all your script talk and the like. As you
make a new development, would it be too much to state the
results of what that new script will do, to the lay person. It's
easier to figure how to get it to work if we know what it should
do. Does that make sense? Good work! And Thanks!
_________________ http://wellminded.com/puppy/pupsearch.html
|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4006 Location: Arizona, U.S.A.
|
Posted: Sun 01 Mar 2009, 21:50 Post subject:
|
|
Adding & removing union branches worked great in Puppies up to 2.0
The older Puppies unioned on /root/usr, 2.0 up union on /
This caused problems & branch add/remove didn't work any more.
Eliminating the union all together solves the memory & cpu loading.
The SFS files just need to be made to work without the union.
|
|
Back to top
|
|
 |
vanchutr
Joined: 05 Aug 2006 Posts: 419
|
Posted: Sun 01 Mar 2009, 22:02 Post subject:
|
|
I can't load more than 5 sfs with load_sfs. How to load more?
|
|
Back to top
|
|
 |
gyro
Joined: 28 Oct 2008 Posts: 289 Location: Brisbane, Australia
|
Posted: Tue 03 Mar 2009, 14:11 Post subject:
|
|
I just downloaded load_sfs-0.8.pet and installed it into Puppy barebones 4.1.2.
(I'm trying to build a Puppy with the smallest possible pup_412.sfs and pup_save.2fs, with most applications bundled into a few large .sfs files.)
1) Please remove the "excecute" quotes from around "$self" in the "Usage" error messages. It can be quite confusing when it attempts to execute itself while attempting to produce an error message. At one stage, while I was playing around with "$self", it went into an endless loop because I had "$self" set to "$0".
2) Always failed to load the sfs.
Mounting the sfs seems to work OK.
The next mount to add it into the aufs, always fails with "union failed" message.
I also get a message from "mount" saying that the filetype should be specified. In Dmesg there is line saying "write permission for read only fs or inode /mnt/.sfsmodule".
If I add "-t aufs" to the mount command, mount complains that "/ is not mounted or bad option", and I still get the same line in Dmesg.
gyro
|
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 4006 Location: Arizona, U.S.A.
|
Posted: Tue 03 Mar 2009, 14:17 Post subject:
|
|
Hi guro; A SFS file is first mounted in the normal Linux fashion, &
then it's unioned, so: " mount -t squashfs (SFS file) (mount dir.) "
This mounts the SFS file & then use the aufs command to union it?
|
|
Back to top
|
|
 |
gyro
Joined: 28 Oct 2008 Posts: 289 Location: Brisbane, Australia
|
Posted: Wed 04 Mar 2009, 11:00 Post subject:
|
|
sunburnt,
Sorry, but I don't understand your question.
In the "load_sfs" script I downloaded, there is no "aufs command".
A "mount" command is used to mount the sfs file as a loop device. This always works.
A second "mount" command is then executed to remount "/". From the error message I get when this fails, I assume that this is supposed to "union" the mounted sfs file. This always fails.
gyro
|
|
Back to top
|
|
 |
|