From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alexander E. Patrakov" Date: Fri, 14 May 2004 13:31:35 +0000 Subject: Bogus dependencies Message-Id: <40A4CA37.40801@ums.usu.ru> MIME-Version: 1 Content-Type: multipart/mixed; boundary="=_ums.usu.ru-19045-1084541432-0001-2" List-Id: To: linux-hotplug@vger.kernel.org This is a MIME-formatted message. If you see this text it means that your E-mail software does not support MIME-formatted messages. --=_ums.usu.ru-19045-1084541432-0001-2 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit > In hotplug-2004_04_01, usb.rc line 77, we see: > > LISTER=`which usbmodules` > > In previous versions, they used `type -p usbmodules`, but that's a > bashism and therefore should not be used in scripts starting with #!/bin/sh > > So this is an argument for inclusion of the "which" program into LFS. > The statement above is only partially correct. Let's study the scripts more thoroughly: [patrakov in ~/hotplug-2004_04_01]$ grep -rn \`which . ./etc/hotplug/hotplug.functions:84: 2.2*|2.3*|2.4*) LISTER=`which ${TYPE}modules` ;; ./etc/hotplug/pci.rc:46: LISTER=`which pcimodules` ./etc/hotplug/usb.rc:77: LISTER=`which usbmodules` The first occurence is not of any interest to us, because we don't support such old kernels. The second one is relevant to 2.4 code path only and we can't hit it. The third one is, however, hit, and that's what I originally reported. But let's see if the usbmodules command is actually used. The answer is "no"! Details: The hotplug package, as one can see from the hotplug.functions file, does not use listers with 2.6 kernels. Therefore, the result of such testing is relevant to 2.4 code path, and the test itself can be moved there, see the attached patch. Summary: the dependencies of hotplug upon "usbmodules" and "which" with 2.6 kernels are bogus and can be patched out without loss of functionality. -- Alexander E. Patrakov --=_ums.usu.ru-19045-1084541432-0001-2 Content-Type: text/x-patch; name="hotplug-2004_04_01-bogus-deps-1.patch"; charset=iso-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="hotplug-2004_04_01-bogus-deps-1.patch" Submitted By: Alexander E. Patrakov Date: 2004-05-13 Initial Package Version: 2004_04_01 Upstream Status: will send a copy to linux-hotplug-devel@lists.sourceforge.net Origin: Alexander E. Patrakov Description: Removes bogus dependency upon "which" and "usbmodules" programs in 2.6 code path --- hotplug-2004_04_01/etc/hotplug/usb.rc.old 2004-05-13 20:42:25.596236912 +0600 +++ hotplug-2004_04_01/etc/hotplug/usb.rc 2004-05-13 20:43:09.296593448 +0600 @@ -73,12 +73,6 @@ # # synthesize hotplug events if we can - # we need (non-bash) programs to parse descriptors. - LISTER=`which usbmodules` - if [ "$LISTER" = "" -o ! -f /proc/bus/usb/devices ]; then - echo $"** can't synthesize root hub events" - return - fi # make sure the usb agent will run ACTION=add @@ -113,6 +107,12 @@ done fi else + # we need (non-bash) programs to parse descriptors. + LISTER=`which usbmodules` + if [ "$LISTER" = "" -o ! -f /proc/bus/usb/devices ]; then + echo $"** can't synthesize root hub events" + return + fi for DEVICE in /proc/bus/usb/*/*; do /etc/hotplug/usb.agent done --=_ums.usu.ru-19045-1084541432-0001-2-- ------------------------------------------------------- This SF.Net email is sponsored by: SourceForge.net Broadband Sign-up now for SourceForge Broadband and get the fastest 6.0/768 connection for only $19.95/mo for the first 3 months! http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click _______________________________________________ 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