Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 21 Aug 2014, 16:22
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
DriveMan drive manager and AutoDrive auto. mounter.
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 4 [56 Posts]   Goto page: 1, 2, 3, 4 Next
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Wed 14 Apr 2010, 16:20    Post subject:  DriveMan drive manager and AutoDrive auto. mounter.
Subject description: Replacement for HotPup.
 

I`ve integrated DriveMan and AutoDrive, but they can still be used separately.
DriveMan pix is shown below with the Settings GUI, AutoDrive has no GUI.

A Menu item is added for DriveMan: Menu > Filesystem > DriveMan
Maybe there should be a Settings GUI option to add a desktop icon also?
Click a device in DriveMan`s list and a popup menu gives a list of action choices.
Actions: Rox Filer, Mount-Unmount, Boot Mount Set-Unset, Settings, Exit DM, Exit Menu.
Settings GUI is easy to understand. DriveMan`s device list is never any taller than needed.

AutoDrive mounts and unmounts all removable devices automatically.
Auto. mounting takes 7 to 9 seconds, unmounting takes a second or so.
It refreshes DriveMan`s device list on device insert and remove events. ( option maybe? )
It can mount the device only, or also show the device in a Rox Filer window.
It adds the device to Rox Filer`s Bookmarks menu and Firefox`s SaveAs menu.

Below is a pix with instructions showing how to set HotPup`s Event Manager so it`s disabled.
The download box has instructions for extracting DriveMan in: /root/My-Applications.

### Beta software: Make a gzipped backup of your Save file just to be sure...

### Beta-7 version.
driveman_b-7.zip
Description  Move the zip file into: /root/My-Applications and extract it.
zip

 Download 
Filename  driveman_b-7.zip 
Filesize  11.67 KB 
Downloaded  407 Time(s) 
000_DriveMan+Settings_b-6.png
 Description   DriveMan and Settings GUI.
 Filesize   51.11 KB
 Viewed   1101 Time(s)

000_DriveMan+Settings_b-6.png

000_HotPup-Setting.png
 Description   Run HotPup event manager: Menu > System > Puppy Event Manager
The pix shows the only checkbox that should be "on" in all the tabpanels.
 Filesize   27.56 KB
 Viewed   1099 Time(s)

000_HotPup-Setting.png


Last edited by sunburnt on Sat 17 Apr 2010, 19:14; edited 3 times in total
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Wed 14 Apr 2010, 22:29    Post subject:  

Hey sunburnt

I ll be testing again and giving feedback


thanks for the PM

Joe

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3364
Location: Oregon

PostPosted: Wed 14 Apr 2010, 22:56    Post subject:  

I ran your new v6 version and upon clicking settings, the first time, The configuration GUI showed. So I tried the increase button.
The number stayed at 8. I then clicked exit and again, a blank settings file. But this time, when I deleted the settings file and tried to start again by exiting driveman and restarting it, it failed to run the settings GUI.
So I do not know what to tell you.
But consistently wiping out the settings file is not good.

Tried on Puppy 431 and Puppy 432.

Do you have any support files installed on your version of Puppy?
What version do you have it working consistently on?
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Thu 15 Apr 2010, 00:17    Post subject:  

Sorry about that 8-bit, I had it working and I hadn`t looked at it for so long I didn`t notice.
The entrybox on line 22 of the file: driveman.set.gtk3 is filled from the settings file.
But the settings file is not reread again to show the change, the DriveMan GUI`s list changed
and got bigger and smaller, but the Settings GUI was not updated with the change. ( ooops )
I`ve made the entrybox read the settings file separately to get the max. drive list height value.

I`ll wait for any other "bugs" to pop up so I can swat all of them down for the next beta.

I`m using dpup482, I`ll change to a new one after awhile. ( Your problem "worked" for me! )

Last edited by sunburnt on Thu 15 Apr 2010, 16:39; edited 1 time in total
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3364
Location: Oregon

PostPosted: Thu 15 Apr 2010, 00:31    Post subject:  

From the experience I have had, as long as the settings file does not get overwritten or written with blank variables, the program works.
But with no error checking of a zero content settings file, driveman.set.gtk3 crashes as it cannot get it's variables from an empty file.
The weird part is that if I am in the settings GUI and click increase a few times and then check the settings file each time, sometimes the setHT gets written and and sometimes I come up with an empty settings file.
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3364
Location: Oregon

PostPosted: Thu 15 Apr 2010, 00:58    Post subject:  

I am now over on Dpup484.
Found another problem.
Even though the settings file shows False on everything, driveman.set.gtk3 comes up with two boxes checked.
That should not happen.
As to the empty settings file, it does not happen in dpup484.
So I see what you mean about it working in dpup.

But the big question is to why it fails in Puppy 431 and 432.
So far, as far as I can see, until the problems get ironed out, it looks like a dup484 only utility.
But the forcing of an autorun of driveman on startup and the automount is not good.

If it fails for me in the checkboxes being already checked, it should for you too.
And the refresh of the settings should reflect in the settings GUI.

And, YES I did have the foresight to back up the save file for dpup484.

My Puppy 431 uses xterm and my Puppy 432 uses rxvt.
I am not sure what terminal dpup484 uses.
That could make a big difference.

Edit: dpup484 uses mrxvt-full as it's terminal and that is a binary file.
I assume that that is where the problem lies between your program working on dpup and not puppy versions with xterm or rxvt.

So it may not be your program's fault on the problems but the terminal program used to run the bash scripts.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Thu 15 Apr 2010, 02:15    Post subject:  

driveman.set.gtk3 reads the settings file and it`s variable values set the checkboxes.
It`s very hard to imagine a checkbox showing anything other than it`s variable value.

I can`t reproduce your problem of the settings file getting "hosed", so I can`t diagnose it.
Refresh the settings file you`re looking at after the Settings GUI runs, it`s rewritten then.
When the Settings GUI is run the "real world" conditions are written to the Settings file.
Settings don`t just show blindly... If you kill AutoDrive with rxvt, it`ll show it`s stopped.
The only 3 Settings that`re not rewritten are: auto. mount, filer, and drive list max. height.
This is so they will remain the same for the next bootup, set them and they stay that way.

We`ll wait for big_bass to report back.
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Thu 15 Apr 2010, 22:51    Post subject:  

Hey Terry (sunburnt)

everything worked for me Cool

*I disabled HotPup`s Event Manager

I am on a 412 base but modified


-------------------------------------------------------------------------------
debugging info
I noticed only one error during debugging only
a grep error which takes place just after you select mount -unmount
--------------------------------------------------------------------------------
TIP:

8-bit should test puppy pfix=ram
just to verify if its a version error that needs addressing or not

if it works on a clean puppy pfix=ram then it works for that version


a personal request:

remove any code that reads puppylinux files
such as PUPSTATE as an example only

I hacked the slitaz mount box 3.3 and it only looks for ROX
which could be edited for any manager

making it linux friendly too so I could try it on slackware
and others out there in the open source community


Joe

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though

Last edited by big_bass on Sat 17 Apr 2010, 14:05; edited 1 time in total
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Fri 16 Apr 2010, 00:16    Post subject:  

Thanks big_bass; It`s good to know that it works on slightly older Puppies.
When you say it worked, I assume you are over looking 8-bit`s error... Fixed.

I looked at the btnMNT code and there`s 4 greps at the beginning. I don`t see any bugs.
Could you tell me what you did to detect it? I tried using set -x and it showed nothing.
Here`s the only lines with grep:
Code:
   drvInfo=$(<$drvINFO)
   ROW=`echo "$drvInfo" |grep $1`
   COL=`echo "$ROW" |cut -d '|' -f 2`
   if [ -z "`mount |grep $1`" ];then                     ## mount drive
      if [ "`echo $1 |grep sr`" ];then
         if [ "`probepart |grep $1 |cut  -d '|' -f 2`" = 'none' ];then   # empty CD-DVD, error

PUPSTATE is the only Puppy file, and probepart is the only Puppy utility that I use.
I use to write most of my apps. so they were generic. You`re right, I`ll change DriveMan.
I have 4 script function libraries I wrote, and one of them has a function like probepart.
1 does filesystems ( probepart ), 1 for file types, 1 for manipulating lists, and 1 for gtkdialog.
I`d prefer to write my apps. with library support ( easier ), but nobody else seems interested.
If I`m the only one using the libraries then they become unused code on peoples PCs. Confused
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3364
Location: Oregon

PostPosted: Fri 16 Apr 2010, 01:41    Post subject:  

Tests with pfix=ram

Puppy 4.2.1
Driveman works with no crash and no trash of settings file.
But when choosing settings from the popup, the settings GUI comes up with "Run Driveman at boot" and "Run Autodrive at boot" checked even though it is the first time the settings popup has been used and before it was called, the settings file showed all as "false".

Puppy 4.3.2 Official
settings file blanks as soon as the popup settings is used and the Settings GUI crashes with no variables from an empty settings file.

Puppy 4.3.4 CE? (technasaurous)
same as Puppy 4.3.2 Official

Puppy 4.3.1 SCSI
Same as Puppy 4.3.2 Official

Now you know as much as I do at the present time.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Fri 16 Apr 2010, 04:28    Post subject:  

Thanks 8-bit; There seems to be a lot of variance in the way Puppy versions run scripts, huh?
Makes you think that it`s pointless to bother to write anything except for yourself.

big_bass; I eliminated the need for probepart from DriveMan, but eliminating PUPSTATE...
Finding the system drive in all the different ways Linux can be setup and run is daunting.
Puppy frugal`s Save device is the system drive and / is in ram, a full install it`s the / partition.
I could have the DriveMan Startup file detect what partitions are mounted, but prone to errors.
It`s only used to put the "B" in the drive list and stop attempts to unmount it. Errors otherwise...

Any suggestions on how to detect the main system partition? The one that can`t be unmounted.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Fri 16 Apr 2010, 04:58    Post subject:  

I think I found a simple way... Just do "df" and get the top partiton listed.
It has to be the first one mounted, right? It`s probably not fool proof, but it works...
And the concept behind it is fairly sound, for most system setup`s it should work.

A thought, I looked at TinyCore, did "df" and all that`s mounted is 2 tmpfs.
So like Puppy / in in ram, but in TinyCore there was no system drive ( first boot like Puppy? ).
So my code`s good I think.
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Fri 16 Apr 2010, 12:45    Post subject:  

Hey Terry (sunburnt)


edit line 74 add double quotes on grep "$DEV" in two places
Code:
   
   devMNT=`echo "$MNT" |grep "$DEV"` ; BOOT=`echo "$drvBOOT"| grep "$DEV"`



that removed the error warning


suggestions
### run driveman at boot up should be by default off


Quote:
I assume you are over looking 8-bit`s error... Fixed.

--------------------------------------------
while running the code I had hda4 showing "M"

#this is strange should be unmounted ????
/dev/loop2 on /mnt/dev/hda4 type ext3 (rw,errors=continue,data=ordered)
/dev/loop3 on /mnt/hda4 type ext3 (rw,errors=continue,data=ordered)' ']'

so I did this
#
Code:
df

Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda2 6499008 1276680 4892196 21% /initrd/mnt/dev_save
/dev/loop1 1015496 533757 481739 53% /initrd/pup_ro1
tmpfs 1141168 1172 1139996 0% /initrd/pup_rw
/dev/loop0 81024 81024 0 100% /initrd/pup_ro2
unionfs 1141168 1172 1139996 0% /
/dev/loop2 521780 42944 452332 9% /mnt/dev/hda4
/dev/loop3 521780 42944 452332 9% /mnt/hda4



#### hmmm somethings fishy here lets unmount hda4 from the loop
Code:
umount /dev/loop2
 umount /dev/loop3


now it was looking good

# df
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda2 6499008 1276680 4892196 21% /initrd/mnt/dev_save
/dev/loop1 1015496 533757 481739 53% /initrd/pup_ro1
tmpfs 1141168 1172 1139996 0% /initrd/pup_rw
/dev/loop0 81024 81024 0 100% /initrd/pup_ro2
unionfs 1141168 1172 1139996 0% /
#



I have a routine I wrote in Xdialog that filters out the loop and swap

Quote:
Any suggestions on how to detect the main system partition? The one that can`t be unmounted.



Code:
blkid  | egrep '(hd|sd)' | egrep -v "/dev/loop*" | egrep -v "swap" | cut -f 1 -d ':' >/tmp/list_of_drives


since it will get mounted on /mnt (**not home**)
you'll be able to adjust it to your needs

Joe

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Fri 16 Apr 2010, 16:14    Post subject:  

Hi big_bass; That`s really odd, I`ve never had to use " " for assigning a value.
It`s only needed to preserved line feeds and to group spaced items.
The devices $DEV are only single items. I don`t use " " for assigning anywhere in the script.

The setting to boot run DriveMan is off by default, see the assignment code, line 75:
Code:
   [ "$S" ]&& echo -e "setHT=8\\ndmBOOT=false\\ndmSTICKY=false
adBOOT=false\\nadRUN=false\\nadMNT=false\\nadFILER=false" > $Settings      ### End Setup, Start GUI


How did 2 loop devices end up getting mounted on /mnt/dev/hda4 and /mnt/hda4 ??? Laughing

The egrep removes: loops, MMC partition tables, and the next gets the drive partitions:
Code:
HD=`cat /proc/partitions |sed 's/^.* //' |egrep -v '(loop|blk0$)' |grep '[0-9]$'`

And this in the drive list building loop removes swaps and extended partitions:
Code:
   [[ "$DEV" != sr* ]]&&       ###   L.s    L.x    L.x    95x   NTx      ###         # ignore swaps and ext.parts.
   [ "`disktype /dev/$DEV | egrep '(0x82|0x83|0x05|0x0F|0x42)'`" ]&& continue


I tried your code to detect the main system partition and got a long list of my 2 drive`s
partitions ( sda1,3,5,6 sdb1,5 ) and also sdc1,2,3,5,6,7,8,9,10,11,12.
Why it left out sdc4 is anybody`s guess. Anyway... It doesn`t seem to give the system drive.
Wouldn`t it be easier to write it with only one egrep statement?

I think taking the top drive in the "df" list is good for detecting the system disk,
considering all the different types of Linux distros. and all the different ways to boot them.
As said, it only puts the B on the system drive and keeps it from trying to be unmounted.

I`ve eliminated both probepart and PUPSAVE from DriveMan, I`ll test more and post later.
T. Cool
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Fri 16 Apr 2010, 22:47    Post subject:  

Code:
 sh -x /root/my-applications/driveman/driveman



Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
+ devMNT=
++ echo ''
++ grep
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.



now do the edit I posted and check the output
you'll see that the error was removed


if you want another tool to look just for the grep error
now it is overkill but shows the power of strace


Code:
strace -e open,read,write /root/my-applications/driveman/driveman   | grep [OPTION]



open("/etc/rc.d/PUPSTATE", O_RDONLY|O_LARGEFILE) = 3
read(3, "PUPMODE=13\nPDEV1=\'hda\'\nDEV1FS=\'i"..., 535) = 535
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.


Terry I like what you are doing




thanks for re doing without the need
of the pupstate




Joe

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though

Last edited by big_bass on Sat 17 Apr 2010, 14:10; edited 1 time in total
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 4 [56 Posts]   Goto page: 1, 2, 3, 4 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1076s ][ Queries: 13 (0.0073s) ][ GZIP on ]