Debian Bug report logs - #481535
"leds beep" assumes that beep device is called /dev/input/event1

version graph

Package: nslu2-utils; Maintainer for nslu2-utils is Joey Hess <joeyh@debian.org>; Source for nslu2-utils is src:nslu2-utils.

Reported by: Per Olofsson <pelle@debian.org>

Date: Fri, 16 May 2008 19:12:01 UTC

Severity: normal

Tags: patch

Found in version nslu2-utils/20080403-1

Fixed in version nslu2-utils/20080403-3

Done: Martin Michlmayr <tbm@cyrius.com>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#481535; Package nslu2-utils. Full text and rfc822 format available.

Acknowledgement sent to Per Olofsson <pelle@debian.org>:
New Bug report received and forwarded. Copy sent to Joey Hess <joeyh@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Per Olofsson <pelle@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: "leds beep" assumes that beep device is called /dev/input/event1
Date: Fri, 16 May 2008 21:04:17 +0200
Package: nslu2-utils
Version: 20080403-1
Severity: normal

The command "leds beep" doesn't work on my system. The reason is that it
doesn't give the correct -e option specifying my beep device when
calling the "beep" command. My beep device is called /dev/input/event0,
while the leds script only checks for /dev/input/event1.

One fix could be running something like:

beep -e /dev/input/by-path/platform-ixp4xx-beeper*

instead, which will work regardless what the beeper device is called.
However, it needs udev to work. Perhaps at least leds could try that
device first.

-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: armel (armv5tel)

Kernel: Linux 2.6.24-1-ixp4xx
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages nslu2-utils depends on:
ii  devio                       1.2-1        correctly read (or write) a region
ii  flash-kernel                1.11         utility to write kernel and initra
ii  slugimage                   1:0.0+r104-3 NSLU2 firmware image manipulation 

nslu2-utils recommends no packages.

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#481535; Package nslu2-utils. Full text and rfc822 format available.

Acknowledgement sent to Martin Michlmayr <tbm@cyrius.com>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. Full text and rfc822 format available.

Message #10 received at 481535@bugs.debian.org (full text, mbox):

From: Martin Michlmayr <tbm@cyrius.com>
To: Per Olofsson <pelle@debian.org>, 481535@bugs.debian.org
Cc: Gordon Farquharson <gordonfarquharson@gmail.com>
Subject: Re: Bug#481535: "leds beep" assumes that beep device is called /dev/input/event1
Date: Sun, 14 Sep 2008 11:16:01 +0300
* Per Olofsson <pelle@debian.org> [2008-05-16 21:04]:
> One fix could be running something like:
> 
> beep -e /dev/input/by-path/platform-ixp4xx-beeper*

Why /dev/input/by-path/platform-ixp4xx-beeper* (ie with the star at
the end)?  What's the actual filename?
-- 
Martin Michlmayr
http://www.cyrius.com/




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#481535; Package nslu2-utils. Full text and rfc822 format available.

Acknowledgement sent to Per Olofsson <pelle@dsv.su.se>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. Full text and rfc822 format available.

Message #15 received at 481535@bugs.debian.org (full text, mbox):

From: Per Olofsson <pelle@dsv.su.se>
To: Martin Michlmayr <tbm@cyrius.com>
Cc: Per Olofsson <pelle@debian.org>, 481535@bugs.debian.org, Gordon Farquharson <gordonfarquharson@gmail.com>
Subject: Re: Bug#481535: "leds beep" assumes that beep device is called /dev/input/event1
Date: Sun, 14 Sep 2008 23:31:31 +0200
Hi,

Martin Michlmayr wrote:
> * Per Olofsson <pelle@debian.org> [2008-05-16 21:04]:
>> One fix could be running something like:
>>
>> beep -e /dev/input/by-path/platform-ixp4xx-beeper*
> 
> Why /dev/input/by-path/platform-ixp4xx-beeper* (ie with the star at
> the end)?  What's the actual filename?

The full name is "/dev/input/by-path/platform-ixp4xx-beeper.4-event-"

I used the glob star because I wasn't sure if it is always called
beepter.4-event- at the end.

-- 
Pelle




Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#481535; Package nslu2-utils. Full text and rfc822 format available.

Acknowledgement sent to "Gordon Farquharson" <gordonfarquharson@gmail.com>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. Full text and rfc822 format available.

Message #20 received at 481535@bugs.debian.org (full text, mbox):

From: "Gordon Farquharson" <gordonfarquharson@gmail.com>
To: "Martin Michlmayr" <tbm@cyrius.com>
Cc: "Per Olofsson" <pelle@debian.org>, 481535@bugs.debian.org
Subject: Re: Bug#481535: "leds beep" assumes that beep device is called /dev/input/event1
Date: Sun, 14 Sep 2008 22:34:03 -0600
Hi Martin

On Sun, Sep 14, 2008 at 02:16, Martin Michlmayr <tbm@cyrius.com> wrote:
> * Per Olofsson <pelle@debian.org> [2008-05-16 21:04]:
>> One fix could be running something like:
>>
>> beep -e /dev/input/by-path/platform-ixp4xx-beeper*
>
> Why /dev/input/by-path/platform-ixp4xx-beeper* (ie with the star at
> the end)?  What's the actual filename?

How about applying the following patch for /usr/bin/leds. It finds the
device name associated with the ixp4xx-beeper driver, so should work
in the case in which there are multiple event devices.

--- leds.orig	2008-09-14 21:52:11.000000000 -0600
+++ leds	2008-09-14 22:25:17.000000000 -0600
@@ -178,12 +178,22 @@
 #  does nothing if there is no beep executable, is very
 #  quiet in the presence of errors
 beep(){
-	local arg
+	local arg devices module
 	arg=
 	test "$1" = beep && shift
 	if test -x /usr/bin/beep
 	then
-		test -c /dev/input/event1 && arg="-e /dev/input/event1"
+		devices=`ls -d /sys/class/input/event*`
+		for device in $devices
+		do
+			module=`egrep PHYSDEVDRIVER $device'/uevent' | cut -d '=' -f 2`
+			if test "$module" = "ixp4xx-beeper";
+			then
+				devnode=`echo "$device" | cut -d '/' -f 5`
+				arg="-e /dev/input/"$devnode
+				break
+			fi
+		done
 		/usr/bin/beep $arg "$@" 2>/dev/null
 	fi
 	return 0

Gordon

-- 
Gordon Farquharson
GnuPG Key ID: 32D6D676




Tags added: patch Request was from "Gordon Farquharson" <gordonfarquharson@gmail.com> to control@bugs.debian.org. (Mon, 15 Sep 2008 04:48:02 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Joey Hess <joeyh@debian.org>:
Bug#481535; Package nslu2-utils. Full text and rfc822 format available.

Acknowledgement sent to "Gordon Farquharson" <gordonfarquharson@gmail.com>:
Extra info received and forwarded to list. Copy sent to Joey Hess <joeyh@debian.org>. Full text and rfc822 format available.

Message #27 received at 481535@bugs.debian.org (full text, mbox):

From: "Gordon Farquharson" <gordonfarquharson@gmail.com>
To: "Martin Michlmayr" <tbm@cyrius.com>
Cc: "Per Olofsson" <pelle@debian.org>, 481535@bugs.debian.org
Subject: Re: Bug#481535: "leds beep" assumes that beep device is called /dev/input/event1
Date: Sun, 14 Sep 2008 22:58:02 -0600
On Sun, Sep 14, 2008 at 22:34, Gordon Farquharson
<gordonfarquharson@gmail.com> wrote:

> How about applying the following patch for /usr/bin/leds. It finds the
> device name associated with the ixp4xx-beeper driver, so should work
> in the case in which there are multiple event devices.

Here is a slight improvement on the patch which uses basename.

--- leds.orig	2008-09-14 21:52:11.000000000 -0600
+++ leds	2008-09-14 22:55:29.000000000 -0600
@@ -178,12 +178,22 @@
 #  does nothing if there is no beep executable, is very
 #  quiet in the presence of errors
 beep(){
-	local arg
+	local arg devices module
 	arg=
 	test "$1" = beep && shift
 	if test -x /usr/bin/beep
 	then
-		test -c /dev/input/event1 && arg="-e /dev/input/event1"
+		devices=`ls -d /sys/class/input/event*`
+		for device in $devices
+		do
+			module=`egrep PHYSDEVDRIVER $device'/uevent' | cut -d '=' -f 2`
+			if test "$module" = "ixp4xx-beeper";
+			then
+				devname=`basename "$device"`
+				arg="-e /dev/input/"$devname
+				break
+			fi
+		done
 		/usr/bin/beep $arg "$@" 2>/dev/null
 	fi
 	return 0

Gordon

-- 
Gordon Farquharson
GnuPG Key ID: 32D6D676




Reply sent to Martin Michlmayr <tbm@cyrius.com>:
You have taken responsibility. (Mon, 29 Sep 2008 16:30:03 GMT) Full text and rfc822 format available.

Notification sent to Per Olofsson <pelle@debian.org>:
Bug acknowledged by developer. (Mon, 29 Sep 2008 16:30:03 GMT) Full text and rfc822 format available.

Message #32 received at 481535-close@bugs.debian.org (full text, mbox):

From: Martin Michlmayr <tbm@cyrius.com>
To: 481535-close@bugs.debian.org
Subject: Bug#481535: fixed in nslu2-utils 20080403-3
Date: Mon, 29 Sep 2008 16:02:09 +0000
Source: nslu2-utils
Source-Version: 20080403-3

We believe that the bug you reported is fixed in the latest version of
nslu2-utils, which is due to be installed in the Debian FTP archive:

nslu2-utils_20080403-3.dsc
  to pool/main/n/nslu2-utils/nslu2-utils_20080403-3.dsc
nslu2-utils_20080403-3.tar.gz
  to pool/main/n/nslu2-utils/nslu2-utils_20080403-3.tar.gz
nslu2-utils_20080403-3_armel.deb
  to pool/main/n/nslu2-utils/nslu2-utils_20080403-3_armel.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 481535@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Martin Michlmayr <tbm@cyrius.com> (supplier of updated nslu2-utils package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Mon, 29 Sep 2008 18:31:33 +0300
Source: nslu2-utils
Binary: nslu2-utils
Architecture: source armel
Version: 20080403-3
Distribution: unstable
Urgency: low
Maintainer: Joey Hess <joeyh@debian.org>
Changed-By: Martin Michlmayr <tbm@cyrius.com>
Description: 
 nslu2-utils - utilities and init scripts for the Linksys NSLU2
Closes: 481535 497305 498987
Changes: 
 nslu2-utils (20080403-3) unstable; urgency=low
 .
   [ Martin Michlmayr ]
   * Don't call flash-kernel in the postinst because update-initramfs
     (which is also called in the postinst) calls flash-kernel now.
     Closes: #498987
 .
   [ Gordon Farquharson ]
   * Find the input device via /sys instead of hardcoding it. Closes: #481535
   * Update the disk LED udev rule to work with USB 1.x and 2.0 devices.
     Closes: #497305
Checksums-Sha1: 
 627e914f78d1c2c0ec7e2d63ae60f61103881f18 893 nslu2-utils_20080403-3.dsc
 6a9a192da752c8090dafa5c4bf6bedd148aadf3d 44910 nslu2-utils_20080403-3.tar.gz
 b39cdf18e8360b9a56e6cbce6e0e3733a913a98e 15572 nslu2-utils_20080403-3_armel.deb
Checksums-Sha256: 
 e1689e9443d3c1e9ac284928966027869780a8419b38a8f155e936a808882fd6 893 nslu2-utils_20080403-3.dsc
 71b3e3732e971855b9727437ad724526fd9988fbff2a935f0720645c0e015eaf 44910 nslu2-utils_20080403-3.tar.gz
 70558f86359d73d47d86b3a0a480bd12e66e55e7dc6d4b5c19d3a5f5ce4f83b8 15572 nslu2-utils_20080403-3_armel.deb
Files: 
 fd03760dd65bc3830e4e8c4a82bed994 893 admin extra nslu2-utils_20080403-3.dsc
 9e23f3496196f5a2d6ecfe59f9f2e8ee 44910 admin extra nslu2-utils_20080403-3.tar.gz
 0499285ace60686166c564a8a6a6f119 15572 admin extra nslu2-utils_20080403-3_armel.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkjg+CQACgkQKb5dImj9VJ8EnwCfY23gRrekh5psnNDwIEX2nl/7
Sq4AniTN4cxgADZRrrN6xggraiXih9MR
=lKSW
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 11 Nov 2008 07:27:23 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Apr 19 12:35:40 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.