On June 20, 2002, Jan Lentfer wrote:

JL> There is response that says "Changing scheme from xyz to
JL> zxy" but the configuration just isn't changed. Is there a
JL> different way in MDK to manage different pcmcia network
JL> setups. The cardctl scheme is so nice and easy.... why doesn't it
JL> work with MDK?

When it comes to PCMCIA network cards, Mandrake (and supposedly also
Redhat---see the note ), uses the network settings specified in
/etc/sysconfig/network and /etc/sysconfig/network-scripts/ifcfg-*.
These script does not take into account the scheme set using cardctl.

You can try to compare the configuration files in /etc/pcmcia with
configuration files accompaning the pcmcia package (these can for
instance be found in the pcmcia-cs-*/etc directory of the kernel
sources, e.g., /usr/src/linux-2.4.8/pcmcia-cs-3.1.29).  You will
notice that everything except the network-script is as provided by the
pcmcia-package.  Thus schemes actually work out of the box for all
other types of PCMCIA cards.

As for the script for network cards, it has been replaced with a
script that calls the relevant /etc/sysconfig/network-scripts/ifup
script.  And this script is actually run when you do cardctl scheme
....  But, obviousely, you see no change since the settings are
independent of schemes.

The configuration of the wireless card is BTW an interesting piece a
code under MDK.  The card configuration from the pcmcia package is
copied in twice!  First it can found in
/etc/sysconfig/network-scripts/ifup-wireless which is processed when
/etc/sysconfig/network-scripts/ifup figures out that we have wireless
card.  And shortly after the same section appears with all the
variables names prefixed by WIRELESS_.  I wonder if someone at
MandrakeSoft has a good explanation for that duplication (downwards
comtability??).

Anyways, we can use this to get schemes back, by adding the following
to /etc/sysconfig/network-scripts/ifup-wireless:

    # Implement the scheme of cardctl taken from the pcmcia package
    # The following is copy-and-paste from a couple of places in
    # pcmcia/shared and is used to obtain the settings for the card
    # with the current scheme.
    grep_stab ()
    {
        # this should be cheaper than invoking "grep"
        local CLASS DEV
        while read SOCKET CLASS DRIVER INSTANCE DEV MAJOR MINOR ; do
            if [ "$1" = "$DEV" ] ; then return 0 ; fi
        done
        return 1
    }
    
    get_info ()
    {
        if [ -d /var/lib/pcmcia ] ; then
            STAB=/var/lib/pcmcia/stab
        else
            STAB=/var/run/stab
        fi
        if [ -f /var/lib/pcmcia/scheme ] ; then
            SCHEME=`cat /var/lib/pcmcia/scheme`
        elif [ -f /var/run/pcmcia-scheme ] ; then
            SCHEME=`cat /var/run/pcmcia-scheme`
        fi  
        if [ -z "$SCHEME" ] ; then SCHEME="default" ; fi
        grep_stab $1 < $STAB || usage
    }
    WI_HWADDR=`/sbin/ifconfig $DEVICE | sed -n -e 's/.*addr \([^ ]*\) */\1/p'`
    get_info $DEVICE
    ADDRESS="$SCHEME,$SOCKET,$INSTANCE,$WI_HWADDR"
    if [ -r ./wireless.opts ] ; then
        . ./wireless.opts
    else
        . /etc/pcmcia/wireless.opts
    fi

Best

Peter
-- 
http://www.linearity.org/turtle/contact.html
``When you have had all the experiences, met all the famous people,
made some money, toured the world and got all the acclaim you still
think--is that it? Some might be satisfied--but I wasn't'' -- G. Harrison

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to