]> git.pld-linux.org Git - packages/systemd.git/commitdiff
- new
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Sat, 25 Sep 2004 12:32:15 +0000 (12:32 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    start_udev -> 1.1
    udev.rules -> 1.3

start_udev [new file with mode: 0644]
udev.rules [new file with mode: 0644]

diff --git a/start_udev b/start_udev
new file mode 100644 (file)
index 0000000..fbf4553
--- /dev/null
@@ -0,0 +1,90 @@
+#!/bin/sh
+#
+# start_udev
+#
+# script to initialize /dev by using udev.
+#
+# Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
+#
+# Released under the GPL v2 only.
+#
+# This needs to be run at the earliest possible point in the boot 
+# process.
+#
+# Based on the udev init.d script
+#
+# Thanks go out to the Gentoo developers for proving 
+# that this is possible to do.
+#
+# Yes, it's very verbose, feel free to turn off all of the echo calls,
+# they were there to make me feel better that everything was working
+# properly during development...
+#
+# don't use udev if sysfs is not mounted.
+[ ! -d $sysfs_dir/class ] || exit 1
+[ -r /proc/mounts ] || exit 1
+[ -x /sbin/udev ] || exit 1
+[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
+
+
+. /etc/init.d/functions
+
+prog=udev
+sysfs_dir=/sys
+bin=/sbin/udev
+udevd=/sbin/udevd
+MAKEDEV="/sbin/MAKEDEV"
+
+make_extra_nodes () {
+       ln -snf /proc/self/fd $udev_root/fd
+       ln -snf /proc/self/fd/0 $udev_root/stdin
+       ln -snf /proc/self/fd/1 $udev_root/stdout
+       ln -snf /proc/self/fd/2 $udev_root/stderr
+       ln -snf /proc/kcore $udev_root/core
+
+       [ -d $udev_root/pts ] || (mkdir $udev_root/pts;chmod 0755 $udev_root/pts)
+       [ -d $udev_root/shm ] || (mkdir $udev_root/shm;chmod 0755 $udev_root/shm)
+
+       if [ -x $MAKEDEV ]; then
+               $MAKEDEV -x $( 
+                       for i in 0 1 2 3 4 5 6 7; do echo fd$i; done
+                       for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
+                           echo cpu/$i/microcode;
+                       done;
+                       for i in 0 1 2 3 4 5 6 7; do echo loop$i; done
+                       for i in 0 1 2 3; do echo lp$i; echo par$i;done
+                       echo net/tun ppp;
+               );
+               [ -a /dev/MAKEDEV ] || ln -s $MAKEDEV /dev/MAKEDEV;
+       fi
+}
+
+mount_udev() {
+       mount -n -o fscontext=system_u:object_r:device_t,mode=0755 \
+               -t tmpfs none "$udev_root"
+       return $?
+}
+
+
+grep -q " ${udev_root%/} " /proc/mounts || { 
+       STRING=$"Mounting... tmpfs at $udev_root: "
+       echo -n "$STRING "; 
+       mount_udev && success $"$STRING" || failure $"$STRING"; 
+}
+
+STRING=$"Making extra nodes: "
+echo -n "$STRING "
+make_extra_nodes && success $"$STRING" || failure $"$STRING"
+echo
+
+export ACTION=add
+export UDEV_NO_SLEEP=1
+STRING=$"Starting udev: "
+# propagate $udev_root from /sys
+echo -n "$STRING "
+rm -f $udev_root/.udev.tdb
+/sbin/udevstart && success $"$STRING" || failure $"$STRING"
+echo
+
+exit 0
diff --git a/udev.rules b/udev.rules
new file mode 100644 (file)
index 0000000..e3c9694
--- /dev/null
@@ -0,0 +1,56 @@
+# There are a number of modifiers that are allowed to be used in some of the
+# fields.  See the udev man page for a full description of them.
+#
+# See the udev.rules.examples file for more examples of how to create rules
+#
+
+# create a symlink named after the device map name
+# note devmap_name comes with extras/multipath
+#KERNEL="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK="%c"
+
+# DRI devices always go into a subdirectory (as per the LSB spec)
+KERNEL="card*",        NAME="dri/card%n"
+
+# alsa devices
+KERNEL="controlC[0-9]*", NAME="snd/%k"
+KERNEL="hw[CD0-9]*",     NAME="snd/%k"
+KERNEL="pcm[CD0-9cp]*",  NAME="snd/%k"
+KERNEL="midi[CD0-9]*",   NAME="snd/%k"
+KERNEL="timer",          NAME="snd/%k"
+KERNEL="seq",            NAME="snd/%k"
+
+# input devices
+KERNEL="mice",         NAME="input/%k"
+KERNEL="mouse*",       NAME="input/%k"
+KERNEL="event*",       NAME="input/%k"
+KERNEL="js*",          NAME="input/%k"
+KERNEL="ts*",          NAME="input/%k"
+
+BUS="usb", KERNEL="lp[0-9]*", NAME="usb/%k"
+
+KERNEL="microcode",     NAME="%k", SYMLINK="cpu/0/%k"
+KERNEL="ram1",                 NAME="%k", SYMLINK="ram"
+KERNEL="video0",       NAME="%k", SYMLINK="video"
+KERNEL="radio0",       NAME="%k", SYMLINK="radio"
+KERNEL="audio0",       NAME="%k", SYMLINK="audio"
+KERNEL="dsp0",         NAME="%k", SYMLINK="dsp"
+KERNEL="fb0",          NAME="%k", SYMLINK="fb"
+KERNEL="qft0",         NAME="%k", SYMLINK="ftape"
+KERNEL="isdnctrl0",    NAME="%k", SYMLINK="isdnctrl"
+KERNEL="mixer0",       NAME="%k", SYMLINK="mixer"
+KERNEL="ram0",         NAME="%k", SYMLINK="ramdisk"
+KERNEL="sbpcd0",       NAME="%k", SYMLINK="sbpcd"
+KERNEL="radio0",       NAME="%k", SYMLINK="radio"
+KERNEL="tty0",         NAME="%k", SYMLINK="systty"
+KERNEL="vbi0",         NAME="%k", SYMLINK="vbi"
+KERNEL="null",         NAME="%k", SYMLINK="XOR"
+
+KERNEL="tun",          NAME="net/%k"
+
+# old compat symlinks with enumeration
+KERNEL="sr*", NAME="scd%n", SYMLINK="cdrom%e"
+KERNEL="scd*", NAME="%k", SYMLINK="cdrom%e"
+KERNEL="pcd*", NAME="%k", SYMLINK="cdrom%e"
+KERNEL="hd[a-z]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="cdrom", NAME="%k", SYMLINK="cdrom%e"
+KERNEL="fd[0-9]", NAME="%k", SYMLINK="floppy%e"
+KERNEL="hd[a-z]", PROGRAM="/bin/cat /proc/ide/%k/media", RESULT="floppy", NAME="%k", SYMLINK="floppy%e
This page took 0.139588 seconds and 4 git commands to generate.