* Regression in udev-139?
@ 2009-02-28 9:15 Chris Clayton
0 siblings, 0 replies; 2+ messages in thread
From: Chris Clayton @ 2009-02-28 9:15 UTC (permalink / raw)
To: linux-hotplug
Hi,
Please cc me on any reply - I'm not subscribed.
I have a script that is run via udev whenever a usb storage device is plugged in
to my computer - all it does is place an icon on the desktop. A similar script
hides the icon again when the device is unplugged. OK, it's not sophisticated,
but it does the job.
I've been using the scripts for maybe two years or so without problem, but
yesterday I built and installed udev-139 and they stopped working. Enabling a
bit of debugging in the scripts shows that with udev-139 the ID_BUS environment
variable is no longer being passed down when the scripts are run.
The showicon script is as follows:
#!/bin/sh
#SEQ=$RANDOM
#/usr/bin/logger "Starting environment dump : id is $SEQ"
#/usr/bin/env | while read v; do
# /usr/bin/logger "$SEQ: $v"
#done
#/usr/bin/logger "environment dump $SEQ complete"
#/usr/bin/logger "udevshowicon: starting to get icon name"
#/usr/bin/logger "udevshowicon: ACTION is \"$ACTION\""
#/usr/bin/logger "udevshowicon: SUBSYSTEM is \"$SUBSYSTEM\""
#/usr/bin/logger "udevshowicon: DEVTYPE is \"$DEVTYPE\""
#/usr/bin/logger "udevshowicon: ID_FS_VERSION is \"$ID_FS_VERSION\""
#/usr/bin/logger "udevshowicon: ID_FS_TYPE is \"$ID_FS_TYPE\""
#/usr/bin/logger "udevshowicon: ID_BUS is \"$ID_BUS\""
# belt and braces sanity checks ...
[ "$ACTION" = "add" ] || exit 1
[ "$SUBSYSTEM" = "block" ] || exit 1
[ "$DEVTYPE" = "partition" ] || exit 1
[ -z "$ID_FS_VERSION" ] && exit 1
[ -z "$ID_FS_TYPE" ] && exit 1
# The following breaks from udev-139...
#[ "$ID_BUS" = "usb" ] || exit 1
# ...so do this instead
if ! echo $DEVPATH | grep -q usb; then
exit 1
fi
ICON=`echo $DEVLINKS | cut -f1 -d' '`
ICON=`echo $ICON | cut -f3 -d'/'`
#/usr/bin/logger "udevshowicon: about to show $ICON"
[ -e /home/users/chris/Desktop/.$ICON ] && \
/usr/bin/mv /home/users/chris/Desktop/.$ICON /home/users/chris/Desktop/$ICON
Is this an intentional change or a regression, please? The changelog entries are
too cryptic for me to work out whether one of them is saying that ID_BUS is no
longer provided on usb {,un}plug events. Happy to provide aditional information
or test patches,
Regards
Chris
--
In a world without walls and fences, who needs windows and gates?.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Regression in udev-139?
@ 2009-03-01 15:49 Kay Sievers
0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2009-03-01 15:49 UTC (permalink / raw)
To: linux-hotplug
On Sat, Feb 28, 2009 at 10:15, Chris Clayton <chris2553@googlemail.com> wrote:
> I have a script that is run via udev whenever a usb storage device is plugged in
> to my computer - all it does is place an icon on the desktop. A similar script
> hides the icon again when the device is unplugged. OK, it's not sophisticated,
> but it does the job.
>
> I've been using the scripts for maybe two years or so without problem, but
> yesterday I built and installed udev-139 and they stopped working.
That still works fine here:
udevadm monitor --env --udev | grep ID_BUS
ID_BUS=usb
ID_BUS=usb
ID_BUS=usb
ID_BUS=usb
It's likely something wrong with your rules, maybe left-over stuff in
/etc/rules.d/, while the default udev rules are now in
/lib/udev/rules.d/.
You can check what's going on, with:
udevadm test /class/block/sdb
an you look for:
util_run_program: 'usb_id --export /devices/ ... /block/sdb'
...
util_run_program: '/lib/udev/usb_id' (stdout) 'ID_BUS=usb'
...
Kay
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-03-01 15:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-28 9:15 Regression in udev-139? Chris Clayton
-- strict thread matches above, loose matches on Subject: below --
2009-03-01 15:49 Kay Sievers
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).