Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 110511 - pcmciautils udev rules are only executed with modular yenta_socket
Summary: pcmciautils udev rules are only executed with modular yenta_socket
Status: RESOLVED LATER
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High enhancement
Assignee: Mobile Herd (OBSOLETE)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-25 22:01 UTC by Peter Gordon (RETIRED)
Modified: 2005-11-25 12:29 UTC (History)
3 users (show)

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


Attachments
PCMCIA startup script for sys-apps/pcmciautils (pcmcia,395 bytes, text/plain)
2005-10-25 22:02 UTC, Peter Gordon (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Gordon (RETIRED) gentoo-dev 2005-10-25 22:01:27 UTC
With the new hotplug system in Linux 2.6.13 and beyond, pcmcia-cs is being
deprecated, and the IOCTL support in the kernel has also been marked as such.

However, it was cardmgr that was powering up and activating the socket with a
resource database at startup time. sys-app/pcmciautils (which is intended to
replace pcmcia-cs with this new kernel support) has a tool called
pcmcia-socket-startup which does this.  For example, my PCMCIA Prism2 wireless
card does not work until I run this tool. 

Attached please find a simple script I hacked up to do enable this. I request
that this be added to pcmciautils so that people without static sockets can add
it to their default runlevel as needed to enable their PCMCIA socket(s). It
should be trivial to add this script to the files/ subdirectory of pcmciautils
in the portage tree and add a line such as `newinitd ${FILESDIR}/pcmcia-init.d
pcmcia` to the src_install function of the pcmciautils ebuild.

Thanks.

Reproducible: Always
Steps to Reproduce:
1. emerge pcmciautils gentoo-sources
2. Configure kernel with PCMCIA support


Actual Results:  
The PCMCIA card is not enabled until pcmcia-socket-startup is run.



peter@tuxhugger(pts/0) $ emerge --info
Portage 2.0.53_rc6 (default-linux/x86/2005.1, gcc-3.4.4, glibc-2.3.5-r2,
2.6.13-gentoo-r4 i686)
=================================================================
System uname: 2.6.13-gentoo-r4 i686 Intel(R) Pentium(R) 4 CPU 2.40GHz
Gentoo Base System version 1.12.0_pre9
ccache version 2.4 [enabled]
dev-lang/python:     2.3.5, 2.4.2
sys-apps/sandbox:    1.2.13
sys-devel/autoconf:  2.13, 2.59-r7
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r1
sys-devel/binutils:  2.16.1
sys-devel/libtool:   1.5.20
virtual/os-headers:  2.6.11-r2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/splash /etc/terminfo /etc/texmf/web2c
/etc/env.d"
CXXFLAGS="-O2 -march=pentium4 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="ftp://mirror.datapipe.net/gentoo ftp://distfiles.gentoo.org
ftp://distro.ibiblio.org/pub/linux/distributions/gentoo"
LANG="en_US.utf8"
LC_ALL="en_US.utf8"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.us.gentoo.org/gentoo-portage"
USE="x86 X a52 aac aalib acpi aim alsa apache2 ares artworkextra audiofile
bash-completion bcmath berkdb bidi bzip2 cairo calendar cdparanoia cdr cjk cli
crypt cscope ctype cups curl curlwrappers dba dbus dlloader dvd dvdr dvdread dvi
dynagraph edl eds encode erandom esd exif fbcon flac font-server fontconfig fpx
ftp gcj gd gdbm geometry ggi gif glitz gnome gnutls gphoto2 gpm graphviz gs
gstreamer gtk gtk2 gtkhtml hal howl iconv icq idn imlib iodbc ipv6 irc ithreads
jabber javascript jbig jpeg justify lcms ldap libcaca libclamav libg++ libgda lj
logrotate lzo mad matroska md5sum mhash mikmod mmap mmx mono mozdevelop mozilla
moznocompose moznoirc moznomail mozsvg mp3 mpeg mpm-worker nautilus ncurses
nethack network nls nptl nptlonly nsplugin numeric oav objc odbc ogg oggvorbis
openal opengl openntpd pam pam_console parse-clocks pcmcia pcntl pcre pear perl
pg-hier pg-intdatetime pic plotutils png posix postgres pwdb python readline
recode rle rss rtc samba sdk sdl session sharedext silc simplexml skey slang slp
sockets speex spell spl sqlite sse sse2 ssl svg sysvipc t1lib tcpd tetex theora
threads tidy tiff tokenizer truetype truetype-fonts type1-fonts udev unicode
urandom usb utf8 vim-with-x vorbis wddx wmf xml xml2 xmlrpc xosd xpm xprint
xscreensaver xsl xv xvid yahoo zip zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Peter Gordon (RETIRED) gentoo-dev 2005-10-25 22:02:27 UTC
Created attachment 71465 [details]
PCMCIA startup script for sys-apps/pcmciautils
Comment 2 Henrik Brix Andersen 2005-10-26 03:02:10 UTC
Dominik, any comments on this? I don't see anything about pcmcia-socket-startup
in your HOWTO...

For the udev enabled version of pcmciautils, I see the following line in
/etc/udev/rules.d/60-pcmcia.rules:

SUBSYSTEM="pcmcia_socket"       RUN+="/sbin/pcmcia-socket-startup"

This should take care of running pcmcia-socket-startup.
Comment 3 Peter Gordon (RETIRED) gentoo-dev 2005-10-26 19:36:41 UTC
Well that's odd then, because I have that too but udev never runs it. :|

This is in my /etc/udev/rules.d/60-pcmcia.rules:

# PCMCIA sockets:
#
# modprobe the pcmcia bus module so that 16-bit PCMCIA devices work
SUBSYSTEM="pcmcia_socket"       RUN+="/sbin/modprobe pcmcia"

# if this is a PCMCIA socket which needs a resource database,
# pcmcia-socket-startup sets it up
SUBSYSTEM="pcmcia_socket"       RUN+="/sbin/pcmcia-socket-startup"

I have my entire kernel built statically (no modules). Would the `/sbin/modprobe
pcmcia` command failing due to that be the cause of /sbin/pcmcia-socket-startup
never being run? 
Comment 4 Henrik Brix Andersen 2005-10-27 13:55:37 UTC
Could you please try enabling udev debug (set udev_log="debug" in
/etc/udev/udev.conf), reboot, and capture the relevant portion of your system
log (the part where the pcmcia stuff gets initialized by udev)?

Comment 5 Peter Gordon (RETIRED) gentoo-dev 2005-10-27 16:21:44 UTC
Ah. I will try that when I get home in a few hours. Thanks. :-)
Comment 6 Peter Gordon (RETIRED) gentoo-dev 2005-10-27 20:20:14 UTC
Well, nothing about pcmcia came up in my udev log with that option set. However,
I found a post to Red Hat's fedora-devel-list[1] which suggested building the
pcmcia support as modules. I did this and rebooted. Upon loading the
yenta-socket kernel module, pcmcia-socket-startup ran, loaded the orinoco_cs
module for my Prism2 wireless ethernet card, and the net.eth2 initscript made
dhclient grab DHCP information from my router. 

[1] https://www.redhat.com/archives/fedora-devel-list/2005-August/msg00437.html

However, running pcmcia-socket-startup more than once appears to not cause any
problems.

Therefore, I think it would still be a good idea for those, like me, who prefer
building the kernel statically, to have a startup script for this; unless
something can be done to make udev always run this, even if
/sys/class/pcmcia_socket/ is not empty at boot time.

Thanks.
Comment 7 Henrik Brix Andersen 2005-10-31 07:13:06 UTC
Any ideas on this one?
Comment 8 Peter Gordon (RETIRED) gentoo-dev 2005-11-07 16:52:51 UTC
Erm. Not to be rude or such, but...any updates on the matter?
Comment 9 Dominik Brodowski 2005-11-15 08:20:35 UTC
If there is need to set up the resource database, and pcmcia-startup-socket
needs to be run, it can either be done automagically once a PCMCIA socket is
detected. That's what either the udev or the hotplug scripts do. However, they
do not work as expected if the device driver (yenta_socket) is built into the
kernel. Then, we need a startup script -- either the attached version, or, for
udev and kernel 2.6.15 onwards, one which does
     for i in /sys/class/pcmcia_socket/*/uevent; do echo 1 > $i; done

But if you use the very easy new coldplug script (don't know whether it is
integrated yet into gentoo), which only does

     for i in /sys/block/*/*/uevent; do echo 1 > $i; done
     for i in /sys/class/*/*/uevent; do echo 1 > $i; done
     for i in /sys/bus/*/devices/*/uevent; do echo 1 > $i; done

(see commit a7fd67062efc5b0fc9a61368c607fa92d1d57f9e to the Linux kernel)
it should already be done. Doing it twice shouldn't do any harm, though.
Comment 10 Henrik Brix Andersen 2005-11-25 05:54:39 UTC
This will be fixed properly once 2.6.15 goes stable and we have the new coldplug
functionality in place.

The work-around until that is to either compile yenta_socket modular - or run
pcmcia-socket-startup from /etc/conf.d/local.start.
Comment 11 Peter Gordon (RETIRED) gentoo-dev 2005-11-25 12:29:02 UTC
Excellent. Thank you, Hendrik. :-)