Forum Topic - Passing parameters to fs-dos via automount: (4 Items)
   
Passing parameters to fs-dos via automount  
Hi All,

The docs on io-blk indicate that you can specify options to pass to the file system driver.  i.e.

automount=dev[:mountpoint[:fstype[:options]]]

But when I try this, it acts like it will only take one option, it seems that commas used to separate multiple options 
to fs-*  are used as delimiters for higher level parsing.

For example:

automount=+usbhd0t12:/USB:dos:gid=90,uid=100

gid is used, but uid is ignored and an error occurs when starting devb-whatever

Even using a automount=@filename produces the same results.

In looking at blk.c, I found where it parses this automount file, and it looks like commas are treated like you have a 
new automount specification.

Bottom line, how is one to specify multiple parameters to the filesystem driver with automount?  The docs clearly 
indicate this is possible (using the plural form of 'option'), but I'm stumped as to know how....

Thanks
Kevin
 
Re: Passing parameters to fs-dos via automount  
Hi, Kevin.

John Garvey and I have exchanged some emails about this, and he says you can specify only one option. I wondered about 
using something other than a comma to separate the options, but John says this isn't possible because of the way the 
command line gets parsed and processed.

One possibility is for us to modify the @filename form. It currently lets you separate mount entries with newlines or 
commas. If we were to change that to newlines only, you could then use commas to separate the options.

What do you think of this?

Steve Reid (stever@qnx.com)
Technical Editor
QNX Software Systems 


Re: Passing parameters to fs-dos via automount  
Kevin Stallard wrote:
> But when I try this, it acts like it will only take one option, it seems that commas used to separate multiple options
 to fs-*  are used as delimiters for higher level parsing.

Yes, sadly the getsubopt() parsing has already read ahead and tokenised
at the comma.  You could provide your multiple options as generic 'dos'
defaults, eg "blk automount=+usbhd0t12:/USB:dos dos gid=90,uid=100", if
it is acceptable to apply them to all the dos automounts.

Steve will arrange to adjust the docs to refer to 'option' singular.

The other route is to remove the comma parsing from the @file case
(which is there solely for symmetry with the command-line behaviour)
and switch the file to being one-entry-per-line.  As you mentioned
source, remove the strchr(cp1, ',') bit from ParseAutomountFile().
We will consider doing this also (weighing compatability issues).
RE: Passing parameters to fs-dos via automount  
Thanks Steve & John for taking a look at this.

>The other route is to remove the comma parsing from the @file case
>(which is there solely for symmetry with the command-line behaviour)
>and switch the file to being one-entry-per-line.  As you mentioned
>source, remove the strchr(cp1, ',') bit from ParseAutomountFile().
>We will consider doing this also (weighing compatability issues).

Steve mentioned this as well, and actually, I didn't see the part about
commas being separators for new entries and so initially thought that
newlines were the only delimiter.  I said to myself "ah ha!" and
subsequently refused to read the rest of the line....

So...yes, I think it would be great if newlines were the only delimiter.  I
think it makes sense that you could only use a newline to specify a new
entry.  However, I see the problems that it could cause as well with folks
that have used commas and who's systems will subsequently break if they
upgrade.

Thanks again for considering this.

Kevin




-----Original Message-----
From: John Garvey [mailto:community-noreply@qnx.com] 
Sent: November 25, 2009 09:56
To: general-filesystems
Subject: Re: Passing parameters to fs-dos via automount

Kevin Stallard wrote:
> But when I try this, it acts like it will only take one option, it seems
that commas used to separate multiple options to fs-*  are used as
delimiters for higher level parsing.

Yes, sadly the getsubopt() parsing has already read ahead and tokenised
at the comma.  You could provide your multiple options as generic 'dos'
defaults, eg "blk automount=+usbhd0t12:/USB:dos dos gid=90,uid=100", if
it is acceptable to apply them to all the dos automounts.

Steve will arrange to adjust the docs to refer to 'option' singular.

The other route is to remove the comma parsing from the @file case
(which is there solely for symmetry with the command-line behaviour)
and switch the file to being one-entry-per-line.  As you mentioned
source, remove the strchr(cp1, ',') bit from ParseAutomountFile().
We will consider doing this also (weighing compatability issues).



_______________________________________________

General
http://community.qnx.com/sf/go/post42578