From c54ce730c79e842e3b132b453d51afcbc6b254af Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Jun 21 2007 09:29:02 +0000 Subject: - fixed modprobe udev rule - fixed 'pccardctl ident' SEGV - Resolves: rhbz#242805 --- diff --git a/pcmciautils-014-funcname.patch b/pcmciautils-014-funcname.patch new file mode 100644 index 0000000..783834f --- /dev/null +++ b/pcmciautils-014-funcname.patch @@ -0,0 +1,37 @@ +--- pcmciautils-014/src/pccardctl.c~ 2006-06-01 10:07:52.000000000 +0100 ++++ pcmciautils-014/src/pccardctl.c 2007-06-05 22:20:36.000000000 +0100 +@@ -37,6 +37,7 @@ static char *fn[] = { + "AIMS", + "SCSI" + }; ++#define NR_FNS ( sizeof(fn) / sizeof(*fn) ) + + /* crc32hash.c - derived from linux/lib/crc32.c, GNU GPL v2 */ + static unsigned int crc32(unsigned char const *p, unsigned int len) +@@ -219,7 +220,7 @@ static int pccardctl_ident(unsigned long + char *prod_id[4]; + int valid_prod_id = 0; + int i; +- unsigned int manf_id, card_id; ++ unsigned int manf_id, card_id, func_id; + + if (!pccardctl_socket_exists(socket_no)) + return -ENODEV; +@@ -249,9 +250,15 @@ static int pccardctl_ident(unsigned long + if (!pccardctl_get_one(socket_no, "card_id", &card_id)) + printf(" manfid: 0x%04x, 0x%04x\n", manf_id, card_id); + +- if (!pccardctl_get_one(socket_no, "func_id", &manf_id)) +- printf(" function: %d (%s)\n", manf_id, fn[manf_id]); ++ if (!pccardctl_get_one(socket_no, "func_id", &func_id)) { ++ char *func_name; ++ if (func_id < NR_FNS) ++ func_name = fn[func_id]; ++ else ++ func_name = "unknown"; + ++ printf(" function: 0x%x (%s), %d\n", func_id, func_name, NR_FNS); ++ } + + return 0; + } diff --git a/pcmciautils-014-newrules.patch b/pcmciautils-014-newrules.patch index 39504a5..00adcc4 100644 --- a/pcmciautils-014-newrules.patch +++ b/pcmciautils-014-newrules.patch @@ -1,5 +1,14 @@ ---- pcmciautils-014/udev/rules-base.newrules 2006-06-19 09:12:29.000000000 +0200 -+++ pcmciautils-014/udev/rules-base 2006-06-19 09:12:58.000000000 +0200 +--- pcmciautils-014/udev/rules-modprobe.newrule 2006-06-01 11:07:52.000000000 +0200 ++++ pcmciautils-014/udev/rules-modprobe 2007-06-21 11:13:14.000000000 +0200 +@@ -1,3 +1,4 @@ ++### Already done by the general modprobe rule + # modprobe $modalias loads all possibly appropriate modules +-ACTION=="add", SUBSYSTEM=="pcmcia", MODALIAS=="?*", \ +- RUN+="/sbin/modprobe $modalias" ++#ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \ ++# RUN+="/sbin/modprobe $env{MODALIAS}" +--- pcmciautils-014/udev/rules-base.newrule 2006-06-01 11:07:52.000000000 +0200 ++++ pcmciautils-014/udev/rules-base 2007-06-21 11:13:02.000000000 +0200 @@ -3,12 +3,12 @@ # are so broken that we need to read out random bytes of it # instead of the manufactor, card or product ID. Then the @@ -15,10 +24,3 @@ RUN+="/bin/sh -c 'echo 1 > /sys/$devpath/allow_func_id_match'" # PCMCIA sockets: ---- pcmciautils-014/udev/rules-modprobe.newrules 2006-06-19 09:12:38.000000000 +0200 -+++ pcmciautils-014/udev/rules-modprobe 2006-06-19 09:13:12.000000000 +0200 -@@ -1,3 +1,3 @@ - # modprobe $modalias loads all possibly appropriate modules --ACTION=="add", SUBSYSTEM=="pcmcia", MODALIAS=="?*", \ -+ACTION=="add", SUBSYSTEM=="pcmcia", ENV{MODALIAS}=="?*", \ - RUN+="/sbin/modprobe $modalias" diff --git a/pcmciautils.spec b/pcmciautils.spec index d3e33a0..2b0566a 100644 --- a/pcmciautils.spec +++ b/pcmciautils.spec @@ -2,7 +2,7 @@ Name: pcmciautils Summary: PCMCIA utilities and initialization programs License: GPL Version: 014 -Release: 7%{?dist} +Release: 9%{?dist} Group: System Environment/Base ExclusiveArch: i386 x86_64 ia64 ppc ppc64 URL: http://www.kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html @@ -18,6 +18,7 @@ Requires: udev >= 062, kernel >= 2.6.12-1.1411_FC5 BuildRequires: byacc, flex Patch1: pcmciautils-fedora.patch Patch2: pcmciautils-014-newrules.patch +Patch3: pcmciautils-014-funcname.patch %description The pcmciautils package contains utilities for initializing and @@ -27,7 +28,8 @@ debugging PCMCIA and Cardbus sockets. %setup -q # Fix build peculiarities %patch1 -p1 -%patch2 -p1 +%patch2 -p1 -b .newrule +%patch3 -p1 %build make %{?_smp_mflags} @@ -52,6 +54,13 @@ make install DESTDIR=$RPM_BUILD_ROOT %{_mandir}/man*/pccardctl* %changelog +* Thu Jun 21 2007 Harald Hoyer - 014-9 +- fixed modprobe udev rule + +* Wed Jun 6 2007 Harald Hoyer - 014-8 +- fixed 'pccardctl ident' SEGV +- Resolves: rhbz#242805 + * Mon Apr 2 2007 Harald Hoyer - 014-7 - removed Provides, because it would conflict (#234504) - Resolves: rhbz#234504