SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I am trying to build a udev rule that will enable all floppy devices and usb devices to automatically have full r/w/x access allowed to everyone.
This is my first attempt at a udev rule, so please be patient.
Unfortunately, after a reboot, this seems to have had no effect whatsoever on my fd*/sd* permissions.
So, before I get lost on a wrong tangent; can anyone offer firstly confirmation that I am on the right path with this syntax, and secondly a pointer in where I went wrong with it?
I'm not an expert, but I wrote some udev rules a couple of weeks ago.
I think man udev gives some critical information that's not in the document you cited.
There are two sets of udev rules. The default set of rules is in /lib/udev/rules.d/. The custom rule set is in /etc/udev/rules.d/.
If your custom udev rules seem to have no effect, maybe your custom rules are failing to override the default udev rules in /lib/udev/rules.d/.
For example, the floppy devices fd* are created in /lib/udev/rules.d/50-udev-default-rules. In order to override those rules, your custom rules file would need to be in /etc/udev/rules.d/ 50-udev-default-rules.
Anyway, take a look at the man page for udev and see if you are properly taking into account the existence of the default rules already in /lib/udev/rules.d/.
Last edited by DavidHindman; 02-18-2009 at 11:40 PM.
Reason: Correct an error
I know what you mean about 'master' rules not allowing user rules to be run, but after looking ... I don't have a /lib/udev/rules.d/ directory? Are you using Slackware .. or another Linux?
So anyway I scrapped the first attempt and tried again, this time I created:
I saved this in /etc/udev/rules.d/98-local.rules ... then rebooted.
Result is that absolutely nothing has changed? USB and floppies are still mounting [ user - root : drwxr-xr-x ]
Am I missing something here? Why after two attempts has nothing changed (for good or bad)? Am I working on the right file?
Right now I am having a very hard time getting my head around these (seemingly thousands) of Options and Variables in UDEV syntax, and am quite confused as to what is the correct way to go.
So if anyone can shed some light as to whether I am even remotely on track .. or ... way out of the ballpark, I would really appreciate it.
What I've done here is put my new udev rules in /etc/udev/rules.d/40-alsa.rules. This overrides the file of the same name in the /lib/udev/rules.d/ directory.
I think you have "KERNEL=" instead of "KERNEL==" in the first rule of your second attempt, also "MODE==" instead of "MODE=" in the same rule. Every little bug adds up.
Last edited by DavidHindman; 02-19-2009 at 01:55 AM.
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,647
Rep:
I'm not absolutely sure, but I think your problem is that the underlying device node has not the permissions you want. It probably won't help to create just a symlink with other permissions if the real node has other ones.
That said I guess you have to change udev's default rules. Mine (Slackware 12.1) are in /etc/udev/rules.d/50-udev-default.rules, yours should AFAIK be in /lib/udev/rules.d if you are running Slackware 12.2. Look there for the floppy and sd* node creation and change it to your needs ... (to make a copy of this file first is a good idea)
...What I have made so far (in /etc/udev/rules.d/98-local-rules) is the following...
For the version of udev on Slack 12.2, a rule file must end with the extension .rules
That is, for my version of udev, the file "98-local-rules" would have to be named "98-local-rules.rules", else it would have no effect.
I took your floppy rule and put it into my /etc/udev/rules.d/98-local-rules.rules. I also changed it to generate devices named /dev/xfd* instead of /dev/fd*, so I could isolate the effect of your new rule. It sort of worked, giving the 666 permissions you intended. The device name came out as /dev/xfd/0 instead of /dev/xfd0, but it's close!
But so far this seems to have had no effect on the 'real world' /read/write/execute permissions and ownerships of these devices.
Quote:
Code:
mount
/dev/sda1 on /media/512_Cruzer type vfat (rw,nosuid,nodev,noatime,flush,uid=1000,utf8,shortname=lower)
root@Crazed-Weasel:/etc/udev/rules.d#
Code:
ls -l /dev/sda1
brwxrwxrwx 1 user plugdev 8, 1 2009-02-23 13:25 /dev/sda1
root@Crazed-Weasel:/media#
Code:
ls -l /media/512_Cruzer
total 5488
-rwxr-xr-x 1 user root 5619080 2009-02-16 13:38 Opera_963_en_Setup.exe
As you can see from the above code, the /dev's are now getting the correct permissions that I have set, but their corresponding /media mountpoints still retain the original permissions (which are no good).
Can anyone offer a suggestion as to how I can make a systemwide policy of making these user (vfat) floppy and USB mountpoints automatically default to rwx for all users?
(Please don't mention fstab as I need this to be done automatically via UDEV/HAL/DBUS? as devices are inserted by the user; without requiring user intervention, or (su)root access editing).
p.s. I'm currently working on a Slackware 12.0.0 system, but would like to migrate this (rule/policy?) [once I get it working] to multiple Slackware 12.1.0 and Slackware 12.2.0 systems.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.