Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 147910 - net-wireless/ipw3945d problems with network management by linking of ipw3945 modul and service
Summary: net-wireless/ipw3945d problems with network management by linking of ipw3945 ...
Status: RESOLVED TEST-REQUEST
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Christian Heim (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: ipw3945-tracker
  Show dependency tree
 
Reported: 2006-09-17 03:52 UTC by Florian Manschwetus
Modified: 2007-01-08 21:20 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
/etc/init.d/ipw3945d (ipw3945d,694 bytes, text/plain)
2006-12-12 08:41 UTC, Jan Kundrát (RETIRED)
Details
/etc/modules.d/ipw3945-modprobe.conf (ipw3945-modprobe.conf,179 bytes, text/plain)
2006-12-12 08:42 UTC, Jan Kundrát (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Manschwetus 2006-09-17 03:52:21 UTC
I managed now the ipw3945d problem
following steps to solve
maybe ebuild could modified accordingly
to give the tips or make this configurations

1. add to conf.d/net
RC_NEED_eth1=( "ipw3945d" )

2. modify runscript of ipw3945d
i. add to start:
    ebegin "Loading ipw3945 kernel-module"
        if ! /usr/local/sbin/modulhelper ipw3945; then
                modprobe ipw3945
        fi
    eend ${?}

ii. add to stop
        ebegin "Unloading ipw3945 kernel-module"
        if /usr/local/sbin/modulhelper ipw3945; then
                modprobe -r ipw3945
        fi
        eend ${?}

3. add ipw3945d to boot (not tested but should work to make eth1 for dynamic service startup avaible)

4. modify /etc/hibernate/common.conf
for wlan suspend now it should be sufficient to add
RestartServices ipw3945d

5. create script /usr/local/sbin/modulhelper, with this code
#!/bin/bash
if [ "${1}" == "" ]; then
    echo "modulhelper"
    echo ""
    echo "This little script to check if a module is loaded or not"
    echo ""
    exit 0
fi
LOADED_MODULES=`lsmod | grep -v "^Module" | cut -d " " -f 1`
for i in ${LOADED_MODULES}; do
    if [ ${i} == ${1} ]; then
        exit 0
    fi
done
exit -1
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-09-17 04:21:31 UTC
Well, I don't exactly see what are you requesting here. Please, attach a unified diff against current ebuild or explain better what's your problem.
Comment 2 Florian Manschwetus 2006-09-17 04:32:51 UTC
i have no modified ebuild, because i don't know what can/should be done by an ebuild and what better is given as hint by einfo
this is only a description of what i have done here to get rid of the problems with ipw3945, so some one who know how the system init and all this stuff works should check it and decide what is worth to be used.
Central is that ipw3945d runscript check if module is loaded and loads it if needed and that it unloads module on service stop because without reloading module you may loose wireless functionality on eth1
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2006-09-17 04:38:07 UTC
You still didn't describe your problem. What doesn't work for you? When does this occur/how to reproduce it?
Comment 4 Florian Manschwetus 2006-09-17 06:10:42 UTC
i can't describe the core of problem because there is nothing that didn't work at all, but a lot that is very inconvenient to use. So i played around a little bit, and produced this list of little modifications which enhances the convenience a lot. The problem is, that the integration, of the completely new way of interface operation with ipw3945, is still in development, so a lot of things for convenience still have to be done.
Comment 5 Magnus Ahlberg 2006-11-01 19:13:20 UTC
I don't know if I get the problem here, but if I do, I have the same problem.
On my box, ipw3495d does not start before the net-scripts even though there is a requirement at the top of the init-file and I can't for the life of me figure out why.

Should I open a seperate bug for this or does it fit here?

Since Florian mentioned a request to be able to add RC_NEED_eth1=( "ipw3945d" ) to the config file, I'm guessing he has a similar problem, ie. net.eth1 (or whatever the wireless interface is) tries to start before ipw3945d.
Comment 6 Jan Kundrát (RETIRED) gentoo-dev 2006-12-07 11:48:10 UTC
Well, the regulatory daemon is useless without a loaded module and vice versa. It seems logical to me to have the daemon started when you load the module and stopped when you unload it. So the way ipw3945d-1.7.18 does it has its merits.

OTOH, there's "something", the ipw3945d, that is similar to an init script -- it's a "service" or "daemon" that can be started/stopped, so the initscript seems logical as well.

What I've done on my system is that I've combined those two things -- I have the initscript that starts/stops the ipw3945d and my modprobe setup starts/stops it on the module load/unload.

Another tweak I did is that I managed to get ipw3945d run as non-root. I've no idea if it can execute arbitrary code in kernel via some flaw in ipw3945 driver, but it seems better than running it as root.

I'll attach those files when I get back to the machine.
Comment 7 Jan Kundrát (RETIRED) gentoo-dev 2006-12-12 08:41:48 UTC
Created attachment 103866 [details]
/etc/init.d/ipw3945d
Comment 8 Jan Kundrát (RETIRED) gentoo-dev 2006-12-12 08:42:48 UTC
Created attachment 103867 [details]
/etc/modules.d/ipw3945-modprobe.conf
Comment 9 Jan Kundrát (RETIRED) gentoo-dev 2006-12-12 08:49:30 UTC
Using sys-fs/udev-103 and sys-apps/baselayout-1.12.6, ipw3945 gets loaded on bootup and I see a message about "device-initiated service start".

If users put ipw3945d into some runlevel, no harm would be caused as the dameon should wait for the module to load (default values in /etc/conf.d/ipw3945).

Ebuild should be patched to create the ipw3945 user.

This solution works quite well even with suspends and resumes. If it goes crazy, several modprobe/modprobe -r cycles usually put it back.
Comment 10 Christian Heim (RETIRED) gentoo-dev 2007-01-08 21:20:48 UTC
This should be fixed with 1.7.22-r4 in the tree.