* [Fwd: Minor problem in latest Hotplug package]
@ 2004-09-23 16:01 Alexander E. Patrakov
2004-09-23 18:22 ` Greg KH
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Alexander E. Patrakov @ 2004-09-23 16:01 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 692 bytes --]
Jeremy Utley and Chris Lingard reported the following problem:
> When using the latest hotplug package, it throws up an error from
> isapnp.rc about returning from a non-source'd function. The
> return 0 in isapnp.rc should be changed to exit 0.
However, the resulting isapnp.rc is still based on the ancient isapnp.rc
from Debian and lacks proper blacklist support. I suggest you to take
that file from the latest Debian hotplug package.
There is also an alternative implementation (attached) that supports
more modules. The original isapnp.rc from Debian fails to detect even
SB16 because snd-sb16 uses MODULE_DEVICE_TABLE(pnp_card, ...), not just pnp.
--
Alexander E. Patrakov
[-- Attachment #2: hotplug-2004_09_20-isapnp-alt-1.patch --]
[-- Type: text/x-patch, Size: 6936 bytes --]
Submitted By: Alexander E. Patrakov
Date: 2004-09-23
Initial Package Version: 2004_04_01
Origin: based on hotplug-isapnp-0.2.1 by Simone Gotti
Upstream Status: will submit
Description: Replaces ISAPNP hardware detection script with a better version
diff -urN hotplug-2004_09_20.orig/etc/hotplug/isapnp.aliases hotplug-2004_09_20/etc/hotplug/isapnp.aliases
--- hotplug-2004_09_20.orig/etc/hotplug/isapnp.aliases 2004-09-21 04:48:12.000000000 +0600
+++ hotplug-2004_09_20/etc/hotplug/isapnp.aliases 1970-01-01 05:00:00.000000000 +0500
@@ -1,12 +0,0 @@
-# These aliases are used by /etc/hotplug/isapnp.rc and are needed here
-# because the modules themselves are not providing them.
-alias pnp:dPNP0400 parport_pc
-alias pnp:dPNP0401 parport_pc
-alias pnp:dPNP0510 irtty-sir
-alias pnp:dPNP0511 irtty-sir
-alias pnp:dPNP0700 floppy
-alias pnp:dPNP0800 pcspkr
-alias pnp:dPNP0B00 rtc
-alias pnp:dPNP0303 atkbd
-alias pnp:dPNP0F13 psmouse
-alias pnp:dPNPB02F analog
diff -urN hotplug-2004_09_20.orig/etc/hotplug/isapnp.rc hotplug-2004_09_20/etc/hotplug/isapnp.rc
--- hotplug-2004_09_20.orig/etc/hotplug/isapnp.rc 2004-09-21 04:46:42.000000000 +0600
+++ hotplug-2004_09_20/etc/hotplug/isapnp.rc 1970-01-01 05:00:00.000000000 +0500
@@ -1,60 +0,0 @@
-#!/bin/sh -e
-#
-# isapnp.rc synthesizes isapnp hotplug events at boot time
-# it requires a 2.6 kernel with CONFIG_ISAPNP defined
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# Copyright (C) 2004 Simone Gotti <simone.gotti@email.it>
-# Copyright (C) 2004 Marco d'Itri <md@linux.it>
-#
-
-# only 2.6 kernels are supported
-[ -d /sys/bus/pnp/devices/ ] || return 0
-
-cd /etc/hotplug
-. ./hotplug.functions
-
-isapnp_boot_events()
-{
- if [ "$(echo /sys/bus/pnp/devices/*/id)" = "/sys/bus/pnp/devices/*/id" ];
- then
- return 0
- fi
-
- cat /sys/bus/pnp/devices/*/id \
- | sed -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
- | while read MODULE; do
- # ignore blacklisted devices
- if grep -qi "^$MODULE\$" /etc/hotplug/blacklist; then
- return 0
- fi
-
- # see do_pnp_entry() in /usr/src/linux/scripts/file2alias.c
- if $MODPROBE -q pnp:d$MODULE; then
- mesg " $MODULE: loaded sucessfully"
- else
- mesg " $MODULE: can't be loaded"
- fi
- done
-}
-
-# See how we were called.
-case "$1" in
- start|restart)
- isapnp_boot_events
- ;;
- stop)
- # echo "isapnp stop -- ignored"
- ;;
- status)
- # echo "isapnp status -- ignored"
- ;;
- *)
- echo "Usage: $0 {start|stop|status|restart}"
- exit 1
-esac
-
diff -urN hotplug-2004_09_20.orig/etc/hotplug/pnp.distmap hotplug-2004_09_20/etc/hotplug/pnp.distmap
--- hotplug-2004_09_20.orig/etc/hotplug/pnp.distmap 1970-01-01 05:00:00.000000000 +0500
+++ hotplug-2004_09_20/etc/hotplug/pnp.distmap 2004-09-23 19:57:02.362763752 +0600
@@ -0,0 +1,9 @@
+# isapnp module cardvendor carddevice driver_data vendor function ...
+irtty-sir 0xffff 0xffff 0x00000000 0xd041 0x1005
+irtty-sir 0xffff 0xffff 0x00000000 0xd041 0x1105
+floppy 0xffff 0xffff 0x00000000 0xd041 0x0007
+pcspkr 0xffff 0xffff 0x00000000 0xd041 0x0008
+rtc 0xffff 0xffff 0x00000000 0xd041 0x000b
+atkbd 0xffff 0xffff 0x00000000 0xd041 0x0303
+psmouse 0xffff 0xffff 0x00000000 0xd041 0x130f
+analog 0xffff 0xffff 0x00000000 0xd041 0x2fb0
diff -urN hotplug-2004_09_20.orig/etc/hotplug/pnp.rc hotplug-2004_09_20/etc/hotplug/pnp.rc
--- hotplug-2004_09_20.orig/etc/hotplug/pnp.rc 1970-01-01 05:00:00.000000000 +0500
+++ hotplug-2004_09_20/etc/hotplug/pnp.rc 2004-09-23 19:57:02.361763904 +0600
@@ -0,0 +1,119 @@
+#!/bin/sh
+# vim: syntax=sh
+#
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# Copyright (C) 2004 Alexander E. Patrakov (patrakov@ums.usu.ru)
+# Copyright (C) 2004 Simone Gotti (simone.gotti@email.it)
+# All Rights Reserved.
+#
+# Based on scripts by Simone Gotti, from:
+# http://members.xoom.virgilio.it/motaboy/hotplug-isapnp-0.2.1.tar.bz2
+#
+
+
+PATH=/sbin:/bin:/usr/sbin:/usr/bin
+
+if [ "$(echo /sys/bus/pnp/devices/*)" = "/sys/bus/pnp/devices/*" ]
+then
+ exit 0
+fi
+
+cd /etc/hotplug
+. ./hotplug.functions
+
+MAP_CURRENT=$MODULE_DIR/modules.isapnpmap
+DRIVERS=
+
+# WARNING: od and printf are in /usr/bin
+decode_isapnp_vendor() {
+ echo -n $1 | od -A n -t d1 | ( read A B C
+ printf '%x\n' $(( ( ( $A & 0x3f ) << 2) | \
+ ( ( $B & 0x18 ) >> 3) | \
+ ( ( $B & 0x07 ) <<13) | \
+ ( ( $C & 0x1f ) << 8) )) )
+}
+
+hex_swab() {
+ echo `echo $1 | cut -b3-4``echo $1 | cut -b1-2`
+}
+
+#
+# stdin is "modules.isapnpmap" syntax
+# on return, ONE matching module was added to $DRIVERS
+#
+isapnp_map_modules ()
+{
+ local module ignored
+
+ CHECKED_ID="0x`echo $ISAPNP_ID | cut -b1-4`0x`echo $ISAPNP_ID | cut -b5-8`"
+ # comment line lists (current) isapnp_device_id field names
+ read ignored
+
+ while read module cardvendor carddevice driver_data therest
+ do
+ # comments are lines that start with "#" ...
+ # be careful, they still get parsed by bash!
+ case "$module" in
+ \#*) continue ;;
+ esac
+ : checkmatch $module
+ set $therest
+ while [ $# -gt 0 ]
+ do
+ id_temp=$2$1
+ if [ "$id_temp" = "$CHECKED_ID" ] ; then
+ DRIVERS="$module $DRIVERS"
+ : drivers $DRIVERS
+ break
+ fi
+ shift
+ shift
+ done
+ done
+}
+
+
+isapnp_boot_events ()
+{
+ cd /sys/bus/pnp/devices/
+ for ISAPNP_DEVICE in * ; do
+ ISAPNP_STRINGS=`cat $ISAPNP_DEVICE/id`
+ for ISAPNP_STRING in $ISAPNP_STRINGS ; do
+ rawcardvendor=`echo $ISAPNP_STRING | cut -b1-3`
+ rawcarddevice=`echo $ISAPNP_STRING | cut -b4-7`
+ cardvendor=`decode_isapnp_vendor $rawcardvendor`
+ carddevice=`hex_swab $rawcarddevice`
+ ISAPNP_ID=$carddevice$cardvendor
+ LABEL="ISAPNP id $ISAPNP_ID"
+ load_drivers isapnp $MAP_CURRENT "$LABEL"
+ load_drivers isapnp /etc/hotplug/pnp.distmap "$LABEL"
+ done
+ done
+ return 0
+}
+
+
+# See how we were called.
+case "$1" in
+ start)
+ isapnp_boot_events
+ ;;
+ stop)
+ # echo $"isapnp stop -- ignored"
+ ;;
+ status)
+ # echo $"isapnp status -- ignored"
+ ;;
+ restart)
+ # always invoke by absolute path, else PATH=$PATH:
+ $0 stop && $0 start
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart}"
+ exit 1
+esac
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Fwd: Minor problem in latest Hotplug package]
2004-09-23 16:01 [Fwd: Minor problem in latest Hotplug package] Alexander E. Patrakov
@ 2004-09-23 18:22 ` Greg KH
2004-09-23 19:52 ` Marco d'Itri
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2004-09-23 18:22 UTC (permalink / raw)
To: linux-hotplug
On Thu, Sep 23, 2004 at 10:01:12PM +0600, Alexander E. Patrakov wrote:
> Jeremy Utley and Chris Lingard reported the following problem:
>
> >When using the latest hotplug package, it throws up an error from
> >isapnp.rc about returning from a non-source'd function. The
> >return 0 in isapnp.rc should be changed to exit 0.
>
> However, the resulting isapnp.rc is still based on the ancient isapnp.rc
> from Debian and lacks proper blacklist support. I suggest you to take
> that file from the latest Debian hotplug package.
>
> There is also an alternative implementation (attached) that supports
> more modules. The original isapnp.rc from Debian fails to detect even
> SB16 because snd-sb16 uses MODULE_DEVICE_TABLE(pnp_card, ...), not just pnp.
Thanks, I've applied this.
It would help if the Debian people actually submitted their packages
upstream to me, or just checked them into cvs, as they do have write
access to the tree...
thanks,
greg k-h
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Fwd: Minor problem in latest Hotplug package]
2004-09-23 16:01 [Fwd: Minor problem in latest Hotplug package] Alexander E. Patrakov
2004-09-23 18:22 ` Greg KH
@ 2004-09-23 19:52 ` Marco d'Itri
2004-09-24 6:13 ` Alexander E. Patrakov
2004-09-24 8:05 ` Greg KH
3 siblings, 0 replies; 5+ messages in thread
From: Marco d'Itri @ 2004-09-23 19:52 UTC (permalink / raw)
To: linux-hotplug
On Sep 23, Greg KH <greg@kroah.com> wrote:
> Thanks, I've applied this.
This sucks, because the code is very different from the one I wrote
(which uses new style modprobe aliases instead of maps). :-/
> It would help if the Debian people actually submitted their packages
> upstream to me, or just checked them into cvs, as they do have write
> access to the tree...
As I wrote here a few times, they need to be rediffed against the latest
release and neither me or Fumitoshi UKAI had time to do this yet.
--
ciao, |
Marco | [8143 abUYRcHc.NyFU]
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Fwd: Minor problem in latest Hotplug package]
2004-09-23 16:01 [Fwd: Minor problem in latest Hotplug package] Alexander E. Patrakov
2004-09-23 18:22 ` Greg KH
2004-09-23 19:52 ` Marco d'Itri
@ 2004-09-24 6:13 ` Alexander E. Patrakov
2004-09-24 8:05 ` Greg KH
3 siblings, 0 replies; 5+ messages in thread
From: Alexander E. Patrakov @ 2004-09-24 6:13 UTC (permalink / raw)
To: linux-hotplug
Marco d'Itri wrote:
>On Sep 23, Greg KH <greg@kroah.com> wrote:
>
>
>
>>Thanks, I've applied this.
>>
>>
>This sucks, because the code is very different from the one I wrote
>(which uses new style modprobe aliases instead of maps). :-/
>
>
Greg KH made an ambigous statement. What exactly has been applied?
--
Alexander E. Patrakov
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Fwd: Minor problem in latest Hotplug package]
2004-09-23 16:01 [Fwd: Minor problem in latest Hotplug package] Alexander E. Patrakov
` (2 preceding siblings ...)
2004-09-24 6:13 ` Alexander E. Patrakov
@ 2004-09-24 8:05 ` Greg KH
3 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2004-09-24 8:05 UTC (permalink / raw)
To: linux-hotplug
On Fri, Sep 24, 2004 at 12:13:16PM +0600, Alexander E. Patrakov wrote:
> Marco d'Itri wrote:
>
> >On Sep 23, Greg KH <greg@kroah.com> wrote:
> >
> >
> >
> >>Thanks, I've applied this.
> >>
> >>
> >This sucks, because the code is very different from the one I wrote
> >(which uses new style modprobe aliases instead of maps). :-/
> >
> >
> Greg KH made an ambigous statement. What exactly has been applied?
The patch you sent. I applied it and made a new hotplug release on
kernel.org with it in it.
If Marco wants to send me some patches as he doesn't agree with your
changes, he will, hopefully, some day, do that...
thanks,
greg k-h
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-09-24 8:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-23 16:01 [Fwd: Minor problem in latest Hotplug package] Alexander E. Patrakov
2004-09-23 18:22 ` Greg KH
2004-09-23 19:52 ` Marco d'Itri
2004-09-24 6:13 ` Alexander E. Patrakov
2004-09-24 8:05 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).