From mboxrd@z Thu Jan 1 00:00:00 1970 From: Herton Ronaldo Krzesinski Date: Tue, 20 Oct 2009 22:00:33 +0000 Subject: [PATCH] extras/modem-modeswitch: fix eject of fake CD-ROMs Message-Id: <200910202000.33814.herton@mandriva.com.br> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Fix the udev rule so we make sure it is called when the block device is really added, so eject is called with proper block device for ZTE modems. --- extras/modem-modeswitch/61-mobile-action.rules | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) please CC me if replying, I'm not subscribed to linux-hotplug diff --git a/extras/modem-modeswitch/61-mobile-action.rules b/extras/modem-modeswitch/61-mobile-action.rules index 9116b25..9d5ca02 100644 --- a/extras/modem-modeswitch/61-mobile-action.rules +++ b/extras/modem-modeswitch/61-mobile-action.rules @@ -1,4 +1,4 @@ -ACTION!="add", GOTO="mobile_action_end" +ACTION!="add", GOTO="zerocd_eject_end" SUBSYSTEM="usb", ATTR{bDeviceClass}="00|ff", ATTR{bDeviceSubClass}="00|ff", ENV{DEVTYPE}="usb_device", GOTO="mobile_action_switch" GOTO="mobile_action_end" @@ -6,9 +6,14 @@ GOTO="mobile_action_end" LABEL="mobile_action_switch" ATTRS{idVendor}="0df7", ATTRS{idProduct}="0800", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t mobile-action-8280p" +LABEL="mobile_action_end" + # modem-modeswitch does not work with these devices, the fake CD-ROM needs to be ejected -# ZTE MF6xx +SUBSYSTEM="block", ENV{ID_BUS}="usb", ENV{ID_USB_DRIVER}="usb-storage", ENV{ID_CDROM}="1", GOTO="zerocd_eject" +GOTO="zerocd_eject_end" + +LABEL="zerocd_eject" ATTRS{idVendor}="19d2", ATTRS{idProduct}="2000", RUN+="/usr/bin/eject %k" -LABEL="mobile_action_end" +LABEL="zerocd_eject_end" -- 1.6.4.4