Author |
Message |
HairyWill

Joined: 26 May 2006 Posts: 2946 Location: Southampton, UK
|
Posted: Thu 21 Jun 2007, 20:16 Post subject:
|
|
willhunt wrote: | rox has to be closed so umount won't find the loop busy and I don't know how to turn off the window from a script  |
Now I know the answer. Barry put a solution to this in his modifications to Sunburnts's filemnt. The answer is ...... Code: | rox -D path-to-directory |
_________________ Will
contribute: community website, screenshots, puplets, wiki, rss
|
Back to top
|
|
 |
willhunt

Joined: 05 Oct 2005 Posts: 495
|
Posted: Thu 21 Jun 2007, 22:15 Post subject:
|
|
thankyou very much I just got it and have not had time to read it
I'm still working on the loop part
_________________ 176 Icewm Themes
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet
|
Back to top
|
|
 |
willhunt

Joined: 05 Oct 2005 Posts: 495
|
Posted: Fri 22 Jun 2007, 02:55 Post subject:
|
|
Upddated the pet file please try it beem it should work for you now
I hope..maybe
_________________ 176 Icewm Themes
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet
|
Back to top
|
|
 |
Béèm

Joined: 21 Nov 2006 Posts: 11775 Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win
|
Posted: Fri 22 Jun 2007, 04:20 Post subject:
|
|
Thank you, downloaded and instaled.
I have now 3 additions in the file menu, gmount, make virtual drive and vdisktool.
Can they all three be used independently?
I still try to figure out how it works.
But I got a problem already.
When vdisktools has been overlayed by another program, it's window isn't refreshed an the window can't even be closed. Kill is the only solution. See pic:
Description |
|
Filesize |
9.45 KB |
Viewed |
709 Time(s) |

|
_________________ Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
|
Back to top
|
|
 |
willhunt

Joined: 05 Oct 2005 Posts: 495
|
Posted: Fri 22 Jun 2007, 20:39 Post subject:
|
|
Beem first use make a virtual disk to create one.
you may create it any where you like but once created it must go into the
/mnt/home folder it is called /mnt/home/new_save.2fs for vdisk 1 and
/mnt/home/new_save1.2fs for vdisk2 both must reside in mnt/home now all the
buttons should work fine for you.
Now you can click the check mark icon before you mount your "vdisk" and it
will be check for errors and repaired to accomplish this the Force option is
used so it is VERY importent they are not mounted when this is done!
Click the green disk icon to mount your vdrive mount point is /mnt/vdisk1 or
/mnt/vdisk2 you can now click the folder icon and a rox window will open
(you must close this before the disk will unmount) if the file is new you
should just see /lost+found dir. The green sfs button squashes your
new_save.2fs to new_save.sfs. Hammer makes new vdisk.
An example of using it with gmount
use gmount to mount your fav sfs copy copy all the files to your vdisk umount
your sfs click the magnifying glass to see how much room you got left take
your fav pet package convert pet2tgz nameof.pet then just untar them to
/mnt/vdisk1 when it all looks right to you just hit the SFS button rename
your new_save.sfs file to *_2xx.sfs Shazam! your new custom sfs file loads
at boot
remember you can only use 4 loops outta the box I read where wdef posted you
can make more nodes but I personally do not know about it.
Code: | mknod /dev/loop7 b: 7 7 |
I'm working on several "goodies" like error checking, the encryption button
and automagically finding files on mounted partitions but i'm still having
trouble with find
find ./ -name '*.?fs' -fprint /tmp/foundfslist.$$
works any know how to make xdialog use it in the menubox?
_________________ 176 Icewm Themes
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet
|
Back to top
|
|
 |
Béèm

Joined: 21 Nov 2006 Posts: 11775 Location: Brussels IBM Thinkpad R40, 256MB, 20GB, WiFi ipw2100. Frugal Lin'N'Win
|
Posted: Sat 23 Jun 2007, 14:36 Post subject:
|
|
I am still puzzled after your last explanation, willhunt, but I start to understand a little better.
I still don't understand if the newly created programs Make Virtual disk, Gmount and Vdisktool can or should be executed separately or if gmount and Make Virtual Disk are kinda sub-programs called Vdisktool.
So I did a more in depth test and following ias my comment.
Quote: | When executng Make Virtual Drive
/usr/local/vdisktool/mkpupsave: line 340: syntax error: unexpected end of file
Wen executing gmount
Selection of a 2fs can be made, not sfs
Push ok when selected one
But where is the 2fs mounted?
When executing vdisktool
The hammer does nothing
the green disk makes a /mnt/vdX directory
the red disk deletes the /mnt/vdX directory.
The sfs button creates a new_save.sfs or new_save1.sfs
The check icon gives
Code: | e2fsck: No such file or directory while trying to open /mnt/home/new_save.2fs
/mnt/home/new_save.2fs:
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device> | altho new_save.sfs or new_save1.sfs exists
The folder icon opens ROX at vd1/vd2, but what is the use? |
As for the freezing of vdisktool I mentioned I know now how it did happen. I had opened help and the child windows ended up beneath all other windows. I didn't realize and tried to work with the main windows again, but it didn't respond due to the open child window.
_________________ Time savers:
Find packages in a snap and install using Puppy Package Manager (Menu).
Consult Wikka
Use peppyy's puppysearch
|
Back to top
|
|
 |
willhunt

Joined: 05 Oct 2005 Posts: 495
|
Posted: Tue 26 Jun 2007, 00:21 Post subject:
reworked |
|
beem I uploaded the new version and I think I have solved the problems you where having I hope thinking now gonna do it with wbxscript
Code: |
#!/usr/bin/wxbasicscript
include "/usr/lib/wxbasicscript/basefunctions.inc"
//##################################
//# display my mountable files as a menue
//#
//##################################
shell( "find / -name '*.?fs' -fprint /tmp/foundfslist.txt" )
//## need to refine statement to only get 2fs,3fs,sfs,iso
myfiles = readfiletolist( "/tmp/foundfslist.txt" )
removefile( "/tmp/foundfslist.txt" )
dialog = " --title 'MENU BOX' --menu 'these are your mountable files: ' 0 0 10"
counter = 1
for i = 0 to count( myfiles ) -1
if left( myfiles[i] , 1 ) = "/" then
dialog &= " '" & myfiles[i] & "' '" & counter & "'"
counter += 1
end if
next
// display the menue
result , choice = xdialog ( dialog )
print choice
|
This may take a day or two the last time I used basic it was 8k
rom basic at least with geany I still have line numbers
this code was a demo snippet from MU's orginal post
http://www.murga-linux.com/puppy/viewtopic.php?t=2182
_________________ 176 Icewm Themes
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet
Last edited by willhunt on Thu 28 Jun 2007, 21:06; edited 1 time in total
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 5087 Location: Arizona, U.S.A.
|
Posted: Tue 26 Jun 2007, 04:43 Post subject:
|
|
Perhaps the script should check if there are vdisks & if they're mounted.
If a vdisk's not mounted, only then would a [Check & Repair] button be enabled.
Same for any other controls, disable them if they shouldn't be used.
Xdialog won't take input to variables within the control.
If you want a ListBox filled from your find command try GTKdialog.
Code: | #!/usr/bin/ash
export vdisk_GUI='
<wtitle>vDisk Tool</wtitle>
<frame List of vDisks >
<hbox>
<list>
<variable>VDISKS</variable>
<input>cat /tmp/Vdisks.txt</input>
</list>
<vbox>
<button>
<label>Mount Vdisk</label>
<variable>mntVDISK</variable>
<action>./vDisk Mnt $VDISKS</action>
</button>
<button>
<label>Check Vdisk</label>
<variable>chkVDISK</variable>
<visible>cat /tmp/visVdisk.txt</visible>
<action>./vDisk Chk $VDISKS</action>
</button>
</vbox>
</hbox>
</frame>
'
gtkdialog3 --program=vdisk_GUI
|
Put the output from the find command in to the file: /tmp/vDisks.txt
Code: | find ./ -name '*.?fs' -fprint /tmp/foundfslist.$$ > /tmp/vDisks.txt |
The buttons call a script file & it's functions in the current dir. called: ./vDisk
and pass the ListBox's vdisk selection to the function being called.
Note the <visible> tag in the [Check Vdisk] button's code.
If you want more info just ask... It's pretty simple.
I've written a library to simplify the creation of GTKdialog code.
A Visual Integrated Development Environment (VIDE) could be made for it.
|
Back to top
|
|
 |
willhunt

Joined: 05 Oct 2005 Posts: 495
|
Posted: Thu 28 Jun 2007, 20:48 Post subject:
|
|
Quote: |
A Visual Integrated Development Environment (VIDE) could be made for it.
|
is that like gimp only for gtkdialog? Sign me up!
I was thinking about error checking and came up with this one to replace
/usr/local/vdisktool/turn what do you think be Brutal
I used the code from mkimgfile to create the disks
The find line I came up with sorta works I just don't want to have to do it five
times as I know very little about programing or scripting that just seems
Wrong but when I use the line *.?fs I get all kinda results from my
windows part when mounted the object of gmount is to find all mountable
files on all mounted partitions and allow the new user to mount them and
inform them if its read only
Yes I would like very much to learn more about xdialog gtkdialog and the gins thing
turning the buttons on and off are cool
if you google "xdialog forum" puppy comes up the most times and they don't even
give puppy a link whatsup with that
Code: |
#!/bin/sh
status="$1"
spacechk=`/mnt/home`
DF=`df |grep $spacechk|awk '{print $4}'`
if [ "$status" == "mnt1" ];then
if [ -d /mnt/vdisk1 ];then
echo ERROR:mntpnt exsits>MP1
else
echo Mounted>MP1
exit 0;
fi
fi
if [ "$status" == "off1" ];then
if [ -d /mnt/vdisk1 ];then
echo ERROR>MP1
else
echo not mounted>MP1
exit 0;
fi
fi
if [ "$status" == "make1" ];then
if [ -f /mnt/home/vdisk1.2fs ];then
echo ERROR:Disk Present>MP1
exit 3 ;
else
echo Creating Disk>MP1
fi
fi
if [ $DF -le $2 ] ;then
echo To Large!>MP1 # tell user Failed
exit 3
fi
if [ -f /mnt/home/vdisk1.2fs ] ;then # is the file already there
echo File Exists>MP1 ; # tell user Failed
exit 3 ;
fi
dd if=/dev/zero of=mnt/home/vdisk1.2fs bs=1k count=$2 & # make new image file
mkfsext2 -F -b 1024 /mnt/home/vdisk1.2fs $2 # make ext2 FS
if [ $? -gt 0 ] ;then
echo ERROR:mkfsext2>MP1 ; # tell user mkfs Failed
exit 1 ;
fi
fsck -Cpt $3 /mnt/home/vdisk1.2fs # check FS
echo Disk Ready>MP1 # tell user it's done
if [ $? -gt 0 ] ;then
echo ERROR:fsck>MP1 ;
exit 1 ;
fi
exit 0;
if [ "$status" == "repair1" ];then
if [ -d /mnt/vdisk1 ];then
echo Unmount First>MP1
else
echo Repairing Disk>MP1
e2fsck -f -p /mnt/home/vdisk1.2fs
exit 0;
fi
fi
|
_________________ 176 Icewm Themes
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 5087 Location: Arizona, U.S.A.
|
Posted: Thu 28 Jun 2007, 21:48 Post subject:
|
|
Thinking in terms of what the GUI should display:
A ListBox for HD partitions & maybe USB drives.
A button: [Make a Vdisk].
And maybe a ComboBox to select the Vdisk's Size?
And maybe a second button: [Delete Vdisk].
A third button: [Encrypt Vdisk].
A second list box for all Vdisks found on HDs & USBs.
A button: [Mount Vdisk].
A second button: [Unmount Vdisk].
And a [Cancel] button.
Could be 2 Tab Panels for a very small sized GUI.
|
Back to top
|
|
 |
willhunt

Joined: 05 Oct 2005 Posts: 495
|
Posted: Thu 28 Jun 2007, 22:18 Post subject:
|
|
Tabs now there's something I would reallylike to learn to do!
and it would make it smaller gui need more buttons add
another tab
_________________ 176 Icewm Themes
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 5087 Location: Arizona, U.S.A.
|
Posted: Fri 29 Jun 2007, 06:12 Post subject:
|
|
I assume that your interested? Say so if you want a starter GUI.
Then you can just look at it & it'll be pretty obvious how to mod. it.
You'll have to mod. your script to work with the GUI. Easy to do...
The GUI buttons call the script's functions to do whatever's needed.
|
Back to top
|
|
 |
willhunt

Joined: 05 Oct 2005 Posts: 495
|
Posted: Fri 29 Jun 2007, 15:24 Post subject:
|
|
Quote: |
assume that your interested? Say so if you want a starter GUI.
|
SO
that sounds very do able I would like that yes please[/b]
_________________ 176 Icewm Themes
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet
|
Back to top
|
|
 |
sunburnt

Joined: 08 Jun 2005 Posts: 5087 Location: Arizona, U.S.A.
|
Posted: Fri 29 Jun 2007, 15:39 Post subject:
|
|
Here's a starter GUI, as I said you'll have to make the Vdisk file with your
Bash functions in it that do the work for the buttons.
Look at the Vdisk.gtk file to see how the functions in the Vdisk file are called.
A skeleton for the Vdisk file is shown below to get you started.
Code: | #!/bin/sh
setup() {
# write code here to make file: "/tmp/found.vdisk" that lists all Vdisks found.
}
mnt() {
..........
}
unmnt() {
..........
}
check() {
..........
}
del() {
..........
}
enc() {
FILE=`Xdialog --title " Pick Path & type in File Name" --fselect /mnt 0 0`
###### Make encrypted Vdisk: $FILE here.
}
######### More buttons & the Size ComboBox code here.
if [ -z "$1" ];then
./Vdisk.gtk
else
$1 $2 $3 $4 $5
fi
|
There's a little bit to this method of making GUIs, but it's not hard to do.
I've left the Bash code file above: "Vdisk" incomplete for you to learn by doing.
Just copy the Bash code you already have into the proper functions.
It's not as pretty as the other GUI pix posted. Ask any Qs you have... Terry
Description |
This is the GTK file that shows the GUI below.
|

Download |
Filename |
Vdisk.gtk.gz |
Filesize |
551 Bytes |
Downloaded |
372 Time(s) |
Description |
The second Tab Panel isn't needed unless there's more controls. |
Filesize |
15.41 KB |
Viewed |
591 Time(s) |

|
|
Back to top
|
|
 |
willhunt

Joined: 05 Oct 2005 Posts: 495
|
Posted: Mon 09 Jul 2007, 03:51 Post subject:
I need to find out how to size the combo box :( |
|
sunburnt been workn on what you gave me this is what I've come up with so far for vdisk there is still a long way to go but am stuck
bash is not a acronym but a verb!
Code: |
#!/bin/sh
setup() {
# write code here to make file: "/tmp/found.vdisk" that lists all Vdisks found.
# must figure out grep so only get vaild filenames
# big magic that grep sed awk stuff but real hard for this newbie :(
find / -name '*.?fs' -fprint /tmp/found.vdisk
}
mntall() {
rm -f $HOME/.config/tmp/probepar*
OUTPUT=""
###get partitions
# scsi cds and devs without partitons
#SCSIPARTS="`grep -E 'scd[0-9]|sd[a-z] ' /proc/diskstats | tr -s ' ' | cut -d' ' -f4 | tr '\n' ' '`"
SCSIPARTS="`ls -1 /sys/block | grep -E 'sd[a-z]|sr[0-9]' | tr '\n' ' '`"
# normal partitions (sorting backwards cosmetic: we're adding new items at
# the beginning
PARTS="`grep '[hs]d[a-z][0-9]' /proc/partitions | tr -s ' ' | cut -d' ' -f5 | sort -r | tr '\n' ' '`"
## Dougal: originally had here the last part (that does most of the work)
## Why did I move it? To get things in a nice order: hda1...hdb1...hdc...sda1..
###get ide drives (other than hard disks)
#SIZE=0
for DEV in `cd /proc/ide ; ls hd[a-z] | sort -r`
do
# skip devices with partitions
case "$PARTS" in *$DEV*) continue ;; esac
if [ "`cat /proc/ide/$DEV/media`" = "cdrom" ]; then
FSTYPE="iso9660"
else
FSTYPE=`/usr/lib/mut/bin/guess_fstype /dev/$DEV 2>/dev/null`
[ "$FSTYPE" = "unknown" ] && FSTYPE="none" #for compatibility with old probepart.
fi
# seem to need this
if [ $FSTYPE ! "none" ]; then
OUTPUT="/dev/$DEV /mnt/$DEV $FSTYPE defaults 00"
mkdir /mnt/$DEV
echo $OUTPUT >>/ect/fstab
mount /dev/$DEV /mnt/$DEV
fi
done
###get scsi drives
for SCSI in $SCSIPARTS
do
# skip devices with partitions
case "$PARTS" in *$SCSI*) continue ;; esac
case "$SCSI" in
sr*) # cdrom
MEDIA="cdrom"
FSTYPE=iso9660
SIZE=0
;;
sd[a-z]) #other
MEDIA="Direct-Access"
FSTYPE=`/usr/lib/mut/bin/guess_fstype /dev/$SCSI 2>/dev/null`
[ "$FSTYPE" = "unknown" ] && FSTYPE="none" #for compatibility with old probepart.
#changed here to output fstab format
if [ ! $FSTYPE == "none" ]; then
OUTPUT="/dev/$SCSI /mnt/$SCSI $FSTYPE defaults 00"
mkdir /mnt/$DEV
echo $OUTPUT >>/ect/fstab
mount /dev/$DEV /mnt/$DEV
fi
done
# now the part that's actually useful...
for DEV in $PARTS
do
FSTYPE="`/usr/lib/mut/bin/guess_fstype /dev/$DEV 2>/dev/null`"
[ "$FSTYPE" = "unknown" ] && FSTYPE="none" #for compatibility with old probepart.
# SIZE=`grep "$DEV$" /proc/partitions | tr -s ' ' | cut -f 4 -d ' '`
# [ ! "$SIZE" ] && SIZE=0
# [ "$SUNITS" = "" ] && let SIZE=SIZE*2 #512 byte blocks
# [ "$SUNITS" = "-m" ] && let SIZE=SIZE/1024 #MB units
#changed here to output fstab format
if [ ! $FSTYPE == "none" ]; then
OUTPUT="/dev/$DEV /mnt/$DEV $FSTYPE defaults 00"
mkdir /mnt/$DEV
echo $OUTPUT >>/ect/fstab
mount /dev/$DEV /mnt/$DEV
fi
done
rm -f $HOME/.config/tmp/probepar*
}
mnt() {
filext=`echo "$VDISKS" | sed "s/.*\(iso\)$/ISO/"`
if [ "$filext" == "ISO" ];then
mkdir /mnt/${FILE##/*/}
mount -r -t iso9660 -o loop "$FILE" /mnt/${FILE##/*/}
/usr/local/vdisktool/gumnt /mnt/${FILE##/*/} &
rox /mnt/${FILE##/*/}
exit 0;
fi
filext=`echo "$VDISKS" | sed "s/.*\(2fs\)$/2FS/"`
if [ "$filext" == "2FS" ];then
mkdir /mnt/${FILE##/*/}
mount -t ext2 -o loop "$FILE" /mnt/${FILE##/*/}
/usr/local/vdisktool/gumnt /mnt/${FILE##/*/} &
rox /mnt/${FILE##/*/}
exit 0;
fi
filext=`echo "$VDISKS" | sed "s/.*\(sfs\)$/SFS/"`
if [ "$filext" == "SFS" ];then
mkdir /mnt/${FILE##/*/}
mount -r -t squashfs -o loop "$FILE" /mnt/${FILE##/*/}
/usr/local/vdisktool/gumnt /mnt/${FILE##/*/} &
rox /mnt/${FILE##/*/}
exit 0;
fi
filext=`echo "$VDISKS" | sed "s/.*\(3fs\)$/3FS/"`
if [ "$filext" == "3FS" ];then
mkdir /mnt/${FILE##/*/}
mount -t ext3 -o loop "$FILE" /mnt/${FILE##/*/}
/usr/local/vdisktool/gumnt /mnt/${FILE##/*/} &
rox /mnt/${FILE##/*/}
exit 0;
fi
}
unmnt() {
unmount $VDISKS
rmdir $VDISKS
rox -D $VDISKS
}
check() {
filext=`echo "$VDISKS" | sed "s/.*\(2fs\)$/2FS/"`
if [ ! -d /mnt/$VDISKS ];then
if [ "$filext" == "2FS" ];then
e2fsck -f -p $VDISKS
else
gxmessage "Unable to check volume"
exit 0;
fi
}
del() {
..........
}
enc() {
FILE=`Xdialog --title " Pick Path & type in File Name" --fselect /mnt 0 0`
###### Make encrypted Vdisk: $FILE here.
}
######### More buttons & the Size ComboBox code here.
if [ -z "$1" ];then
./Vdisk.gtk
else
$1 $2 $3 $4 $5
fi
|
_________________ 176 Icewm Themes
vlc-0.8.6c-i586.pet
vlc-0.8.6c-i586.pet
|
Back to top
|
|
 |
|