Helmut,

the ltsp-developer mailing list would be the place you'd want to send 
patches.

Jim McQuillan
[EMAIL PROTECTED]



Helmut Lichtenberg wrote:
> Hi,
> I was surprised to get no answer to my proposed patch for handling selection
> of local devices till I found, that attachments to the list seem to get 
> silently
> skipped. At least in the archives at sourceforge, it's missing. So I try it
> again inline.
> 
> BTW, is this the right place for this kind of discussion?
> 
> Helmut
> 
> Helmut Lichtenberg schrieb am 28. Aug 2008 um 14:48:10 CEST:
>> Oliver Grawert schrieb am 27. Aug 2008 um 14:44:55 CEST:
>>> ... so patches are indeed apperciated any happily accepted ;)
>> What about this:
>>
>> 1. udev must provide all devices, not only removables. Otherwise we could not
>>    select between them via lts.conf.
>>
>> 2. It seems easier for me not to allow certain devices but to deny them.
>>
>> 3. Let's restrict it for now for the two traits 'removable' and 'fixed'.
>>    Introduce a variable in lts.conf like this:
>>
>>    LOCALDEV_DENY = fixed      # possible values: [fixed|removable]
>>
>> 4. Maybe later we can enhance it for certain named devices or partitions. 
>> This
>>    needs a more complicated retrieval of udev information and decisions about
>>    the syntax in lts.conf.
>>
>> To implement this for the new ltspfs-trunk, you pointed to, there are only
>> two new functions for ltspfs_entry: is_removable() and is_denied().
>>
>> You then can decide, if the script should run start_ltspfsd and 
>> call_ltspfsmounter.
>>
>> I've put a first implementation into a shell script, where you can test it
>> easily. See attachment.
>>
>> Comments wellcome.
> 
> ==============================================================================
>> #!/bin/sh
>>
>> # just for testing:
>> DEVICENAME=sda1         # from udev
>> LOCALDEV_DENY=fixed     # from lts.conf [removable|fixed]
>>
>> is_denied()
>> {
>>     test -z "$LOCALDEV_DENY" && return 1
>>
>>     case $LOCALDEV_DENY in
>>         fixed)
>>             is_removable $1 && return 1
>>             return 0
>>             ;;
>>         removable)
>>             is_removable $1 && return 0
>>             return 1
>>             ;;
>>         *)
>>             return 1
>>             ;;
>>     esac
>> }
>>
>> is_removable()
>> {
>>     IS_REM=`udevadm info --attribute-walk -n $1 \
>>         |grep removable \
>>         |sed -e 's/.*\([0|1]\).*/\1/'`
>>     test $IS_REM = 1 && return 0   # true in sh context (is removable)
>>     return 1                       # false (is not removable)
>> }
>>
>> if is_denied $DEVICENAME ; then
>>     echo "Don't run call_ltspfsmounter on device $DEVICENAME in ltspfs_entry"
>>     # ignore this device in add_device()
>> else
>>     echo "Run call_ltspfsmounter on device $DEVICENAME in ltspfs_entry"
>>     # do the real work:
>>     # start_ltspfsd
>>     # call_ltspfsmounter add ${MOUNTPOINT}
>>
>> fi
> 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_____________________________________________________________________
Ltsp-discuss mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-discuss
For additional LTSP help,   try #ltsp channel on irc.freenode.net

Reply via email to