LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 05-17-2007, 05:41 PM   #1
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 14.1 (multilib)
Posts: 1,211

Rep: Reputation: 57
Udev and eject problems with Ipod


Ok so I have my ipod nano working with amarok but there are 2 things that are unsatisfactory.

Problem 1.
I have to mount it with /dev/sdc2. For my other usb devices I have udev rules to create specific /dev/ files but I cannot get this to work with the ipod, possibly because it has to be sd*2 rather than 1. I have seen various suggestions eg

BUS=="scsi", SYSFS{model}=="iPod*", NAME=="ipod"
BUS=="scsi", SYSFS{model}=="iPod*" KERNEL=="sd?2", NAME+="ipod", SYMLINK="%k", MODE="0777", GROUP="ipod"

but none of these work for me.


Problem 2
To eject I have to su to root. How can I eject as a user?

One suggestion I have seen is to edit the sudoers file as below. Is that safe?

Quote:
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#

# Host alias specification

# User alias specification

# Cmnd alias specification
Cmnd_Alias EJECT=/usr/bin/eject
# Defaults

Defaults !lecture,tty_tickets,!fqdn

# User privilege specification
root ALL=(ALL) ALL
ben ALL= NOPASSWD : EJECT

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL


 
Old 05-17-2007, 09:29 PM   #2
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,973

Rep: Reputation: Disabled
Quote:
Originally Posted by arubin
I have to mount it with /dev/sdc2. For my other usb devices I have udev rules to create specific /dev/ files but I cannot get this to work with the ipod, possibly because it has to be sd*2 rather than 1. I have seen various suggestions eg

BUS=="scsi", SYSFS{model}=="iPod*", NAME=="ipod"
BUS=="scsi", SYSFS{model}=="iPod*" KERNEL=="sd?2", NAME+="ipod", SYMLINK="%k", MODE="0777", GROUP="ipod"

but none of these work for me.
This rule is bad. First, don't change the name of device; use the kernel name - make the symlink customized.
BUS=="scsi", SYSFS{model}=="iPod*", KERNEL=="sd?2", NAME="%k", SYMLINK+="ipod", MODE="0664", GROUP:="ipod"

This assumes you want all users to be able to read the device, and only members of group 'ipod' to write to it, and that group 'ipod' actually exists, and that your user is a member of that group.

See http://slackwiki.org/Udev for more information on the syntax used and such...


Quote:
To eject I have to su to root. How can I eject as a user?
Assuming the above information is following, this should "just work."
 
Old 05-18-2007, 03:12 AM   #3
arubin
Senior Member
 
Registered: Mar 2004
Location: Middx UK
Distribution: Slackware64 14.1 (multilib)
Posts: 1,211

Original Poster
Rep: Reputation: 57
When you say don't change the name, use the symlink - is that for the ipod or for all devices. I generally change the name and have found that it works fine for me. This is my rules file.

Quote:
SUBSYSTEM=="block", SYSFS{size}=="2050209", NAME+="mpman"
SUBSYSTEM=="block", SYSFS{model}=="Cruzer Mini*", NAME+="cruzer"
SUBSYSTEM=="block", SYSFS{model}=="Flash*", NAME+="flash"
SUBSYSTEM=="block", SYSFS{model}=="Evoke*", NAME+="evoke"
SUBSYSTEM=="block", SYSFS{model}=="00JB-22REA0*", NAME+="external"
SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="3058", GROUP="users"
SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="3126", GROUP="users"
SUBSYSTEM=="block", SYSFS{model}=="USB Flash*", NAME+="disgo"
 
Old 05-18-2007, 03:19 AM   #4
rworkman
Slackware Contributor
 
Registered: Oct 2004
Location: Tuscaloosa, Alabama (USA)
Distribution: Slackware
Posts: 1,973

Rep: Reputation: Disabled
I don't recall specifics now, and it's late (0215 here), so I don't feel like searching for the relevant information, but I do recall reading somewhere (from one of the udev maintainers, I think) that renaming devices can potentially cause some problems (but again, I don't recall specifics). So far as I'm concerned, that is/was good enough reason to not do it, especially since creating the custom symlinks works just fine. For me, it seems to be a bit more elegant solution too, but that's just me... :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
iPod udev rules for 2 different iPods Yalla-One Slackware 3 05-20-2006 05:27 AM
iPod & udev PsypherPunk Linux - Hardware 2 12-21-2005 01:44 PM
Can't eject iPod as normal user, but works as root FreeThinkerJim Linux - Hardware 3 11-18-2005 09:19 PM
ipod with udev on gentoo Greg Haynes Linux - Hardware 5 04-01-2005 06:48 AM
ipod eject problem drigz Linux - Hardware 5 06-27-2004 12:35 PM


All times are GMT -5. The time now is 11:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration