udev-022 with Slackware 9.1 / -current
I decided that I wanted to get udev support working for Slackware. As of this writing, I have udev-022 managing my /dev directory which is mounted at boot.
You should make sure you have the most up to date hotplug package from slackware-current before installing udev.
I had to put in a bit of work to pull this off, but I think it will be worth it. I am going to assume from this point on that you have udev installed already.
udev.permissions and udev.rules
In order to use udev, you need a udev.permissions file that is fairly detailed. Slackware’s dev package provides all the default permissions with the static /dev entries that are generated with the MAKEDEV script.
I modified that in to a mkudev.sh script that can be used to generate a fairly complete udev.permissions file. Here’s the help output for the script:
Usage: ./mkudev.sh [TARGET]
[TARGET] can be one of the following:
arch - Generates a udev.permissions file
specific to your architecture
Alternatively, you can run ./mkudev.sh [DEVICE] and
you will see the suggested udev.permission
entry for that device.
Example:
./mkudev.sh hda - Shows an entry similar to:
hd*:root:disk:660
Get the mkudev.sh script and run the following:
./mkudev arch > /etc/udev/udev.permissions
Now that you have a decent permissions file, you can move on to setting up the Slackware boot process. You may want to customize the permissions file for your needs, the default gives you a very good base.
Setting up the boot process
Slackware’s boot process is fairly 2.6 friendly but it could use some improvements. For example, sysfs and proc need to be mounted before udev can start. This means removing the entries from /etc/fstab like I have done:
/dev/hda5 swap swap defaults 0 0
/dev/hda6 / jfs defaults 1 1
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
NOTE: I left proc in there to stay somewhat consistent with Slackware.
Now, you need to patch /etc/rc.d/rc.S so that it does the following:
- Mount sysfs
- Mount proc
- Start the inital udev process
You then need to put rc.udev.boot in to /etc/rc.d. Make sure root owns it and that it is executable.
- entries: