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 28 Aug 2014, 07:10
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
TS3.03ce - USB device manager
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [23 Posts]   Goto page: Previous 1, 2
Author Message
2byte

Joined: 09 Oct 2006
Posts: 357

PostPosted: Sun 21 Oct 2007, 19:53    Post subject:  

Thanks for the input everyone. Very informative.

Re-coding now. Smile
Vern
Back to top
View user's profile Send private message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Mon 22 Oct 2007, 15:40    Post subject: Cheers Vern  

Thanks for testing everyone. Ive finally found my usb drive so I will join in on the next run. Im looking forward to your updated code.
_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
2byte

Joined: 09 Oct 2006
Posts: 357

PostPosted: Sat 27 Oct 2007, 00:17    Post subject:  

Sorry folks. This project for Talking Stick is dead. I've been trying to build this in puppy 3.01 and am beating my head against a wall. And unless someone can explain this to me I can only conclude that the gtk version included with 3.01 is junk. Bear with me, I'd like to explain my reasons for dumping the project.

Take a look at this function. It's called from the mount/unmount dialog when the mount button is clicked. It's a little butchered from my efforts to track down the segmentation faults, but what the heck.
Code:

gboolean mount_from_tree_list(gchar* listname, gchar* retstr){
   GSList *Lnk = NULL;
   partinfo *ptinfo = NULL;
   gchar **oneline = NULL;
   gchar **output = NULL;
   char txt[25];
   char txt2[25];
   
   Lnk = ptlist;
   while(Lnk != NULL) {
      ptinfo = Lnk->data;
      if (ptinfo){
         if (strcmp((char *)ptinfo->mntpoint, "void")){
            if (!strcmp(listname, ptinfo->desc)){
g_debug("Before Mounting ptinfo->name = %s",ptinfo->name);
g_debug("Before Mounting mountflag = %d",ptinfo->mountflag);
g_debug("Before Mounting mount point = %s",ptinfo->mntpoint);
               oneline = g_strsplit ((gchar*)ptinfo->name, "/", -1);
               g_snprintf(txt,sizeof(txt), "mkdir /mnt/%s ", oneline[2]);
               g_snprintf(txt2, sizeof(txt2), "/mnt/%s ", oneline[2]);
               g_spawn_command_line_sync((gchar*)txt, (gchar **)&output,
                                    NULL, NULL, NULL);
               g_free ((gchar*)output);
               g_snprintf(txt, 50, "%s %s %s %s", "mount -t",
                       (char*)ptinfo->fmt,
                       (char*)ptinfo->name,
                       (char*)txt2);
               g_spawn_command_line_sync((gchar*)txt, (gchar **)&output,
                                    NULL, NULL, NULL);
               g_free ((gchar*)output);
               ptinfo->mountflag = TRUE;
               g_stpcpy(ptinfo->mntpoint,txt2);
               g_strfreev (oneline);
               g_stpcpy(retstr,txt2);
g_debug("After Mounting ptinfo->name = %s",(gchar*)ptinfo->name);
g_debug("After Mounting mountflag = %d",ptinfo->mountflag);
g_debug("After Mounting mount point = %s",ptinfo->mntpoint);
               return TRUE;
            }
         }
      }
      Lnk = Lnk->next;
   }
   return FALSE;
}

Here is the output from compile to Ctrl-c with a couple of comments spliced in. The 'dialog is open' lines represent a global flag that is set to true and should remain true until this dialog is destroyed. FYI each 'DEBUG: dialog is open =' line represents one scan at 2 second intervals. Nothing else in the code sets it to false but notice that it gets reset after one routine is called from a timer callback. The value should have remained 1 all the way through this output. That's just one thing. Notice what happens to ptinfo->name! Where the heck does EEK// come from? On a different run it was changed to 'DR boot loader'! This is the kind of crap I'm constantly running into.
Code:

# ./compile-usbmount
# ./usbmount
** (usbmount:1856): DEBUG: dialog is open = 0
** (usbmount:1856): DEBUG: ADDING ptinfo->name = /dev/sda1
- The dialog is opened here
** (usbmount:1856): DEBUG: dialog is open = 1
** (usbmount:1856): DEBUG: dialog is open = 0
** (usbmount:1856): DEBUG: dialog is open = 0
** (usbmount:1856): DEBUG: dialog is open = 0
- The mount button is clicked
** (usbmount:1856): DEBUG: Before Mounting ptinfo->name = /dev/sda1
** (usbmount:1856): DEBUG: Before Mounting mountflag = 0
** (usbmount:1856): DEBUG: Before Mounting mount point =
mkdir: cannot create directory '/mnt/sda1': File exists
** (usbmount:1856): DEBUG: After Mounting ptinfo->name = EEK//
** (usbmount:1856): DEBUG: After Mounting mountflag = 1
** (usbmount:1856): DEBUG: After Mounting mount point = /mnt/sda1
** (usbmount:1856): DEBUG: dialog is open = 0
- The unmount button is clicked and the device is unmounted
** (usbmount:1856): DEBUG: dialog is open = 0
- The mount button is clicked again
** (usbmount:1856): DEBUG: Before Mounting ptinfo->name = /dev/sda1
** (usbmount:1856): DEBUG: Before Mounting mountflag = 0
** (usbmount:1856): DEBUG: Before Mounting mount point =
mkdir: cannot create directory '/mnt/sda1': File exists
** (usbmount:1856): DEBUG: After Mounting ptinfo->name = EEK//
** (usbmount:1856): DEBUG: After Mounting mountflag = 1
** (usbmount:1856): DEBUG: After Mounting mount point = /mnt/sda1
** (usbmount:1856): DEBUG: dialog is open = 0
** (usbmount:1856): DEBUG: dialog is open = 0
- The dialog is still open at this point.
- Ctrl-c.

I think I'll continue this under puppy 2.14. Maybe it can be salvaged for the future.

Vern
Back to top
View user's profile Send private message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Wed 31 Oct 2007, 18:28    Post subject: GTK  

Hi 2byte

If the GTK version that is used in puppy 3.xx is broken, then we can fix it!!! If its causing problems for this then it is likely that it will cause problems in the future too. Let us know how you get on with it in puppy 2.14 (which has a different gtk version). You might want to look up this problem on the GTK forums too as it sounds quite specialist. Hope you can get the project started again.

_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
cb88


Joined: 28 Jan 2007
Posts: 1169
Location: USA

PostPosted: Sat 24 Nov 2007, 23:55    Post subject:  

any progress beig made here?

gtk upgrade needed? I think that is an option since even the kernel will be rebuilt...and eco seems to have alluded to upgrading gtk above

issue resolved?

_________________
Taking Puppy Linux to the limit of perfection. meanwhile try "puppy pfix=duct_tape" kernel parem eater.
X86: Sager NP6110 3630QM 16GB ram, Tyan Thunder 2 2x 300Mhz
Sun: SS2 , LX , SS5 , SS10 , SS20 ,Ultra 1, Ultra 10 , T2000
Mac: Platinum Plus, SE/30
Back to top
View user's profile Send private message Visit poster's website 
2byte

Joined: 09 Oct 2006
Posts: 357

PostPosted: Sun 25 Nov 2007, 13:16    Post subject:  

Quote:
any progress beig made here?

No, been working on other things for TS3.03.

I have given it a lot of thought and I believe my mistake was using GTK for the linked list and script executions instead of using C. GTK seems to be fine for the gui. I will start from scratch and try to get it done and tested before the release date.

Pdrive is very good too, although it's still beyond the ken of ordinary win refugees. I know because my wife and daughter try this stuff out for me. You should see the look on their faces when presented with all of that drive info! What's this? What do I do now? Is it ok to ignore this and close it? Laughing

2byte
Back to top
View user's profile Send private message 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Thu 29 Nov 2007, 22:19    Post subject:  

2 Byte,

Glad to see you have regained your enthusiasm for this project. and Im also glad that you have some people you can test your work on for this. Believe me I know exactly the "look" you are talkiing about! Very Happy

_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
ecomoney


Joined: 25 Nov 2005
Posts: 2183
Location: Lincolnshire, England

PostPosted: Mon 11 Feb 2008, 10:58    Post subject: Device Manager  

With the change of the project base to 2.14r, an already functioning usb device manager is already included!!! hurrah! It also picks up all of the disks and cd's.
_________________
Puppy Linux's Mission

Sorry, my server is down atm!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Display posts from previous:   Sort by:   
Page 2 of 2 [23 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
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.0811s ][ Queries: 12 (0.0052s) ][ GZIP on ]