Magellan Linux

Contents of /trunk/udev/config-udev-046-r3/make_extra_nodes.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (show annotations) (download) (as text)
Fri Dec 10 12:17:31 2004 UTC (19 years, 4 months ago) by niro
File MIME type: application/x-sh
File size: 2906 byte(s)
This commit was generated by cvs2svn to compensate for changes in r2,
which included commits to RCS files with non-trunk default branches.

1 #! /bin/bash
2 # Make extra /dev nodes.
3 #
4 # Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
5 # Released under the GPL v2 only.
6 #
7 # Enhanced for Slackware Linux by volkerdi@slackware.com.
8
9 if [ -z $udev_root ]; then
10 . /etc/udev/udev.conf
11 fi
12
13 # these are a few things that sysfs does not export for us.
14 ln -snf /proc/self/fd $udev_root/fd
15 ln -snf /proc/self/fd/0 $udev_root/stdin
16 ln -snf /proc/self/fd/1 $udev_root/stdout
17 ln -snf /proc/self/fd/2 $udev_root/stderr
18 ln -snf /proc/kcore $udev_root/core
19 if [ -r $udev_root/psaux ]; then
20 ( cd $udev_root ; ln -sf psaux mouse )
21 fi
22 mkdir $udev_root/pts
23 mkdir $udev_root/shm
24
25 # If we can, add a default /dev/cdrom and /dev/dvd link:
26 if /bin/ls -l /dev | grep -w cdrom 1> /dev/null 2> /dev/null ; then
27 ( cd $udev_root
28 /bin/ls -l * | grep -w cdrom | cut -f 2 -d : | cut -f 2 -d ' ' | while read optical_device ; do
29 # It has to be a cdrom. Last one wins.
30 ln -sf $optical_device cdrom
31 # If it's a DVD, set that link as well:
32 if grep -i dvd /proc/ide/$optical_device/model 1> /dev/null 2> /dev/null ; then
33 ln -sf $optical_device dvd
34 fi
35 done
36 unset optical_device
37 )
38 fi
39
40 # If we add /dev/ppp manually, then using it will autoload the modules.
41 # I think this is how most people expect ppp to work these days.
42 if [ ! -r /dev/ppp ]; then
43 mknod -m 660 /dev/ppp c 108 0
44 chown root:uucp /dev/ppp
45 fi
46
47 # nVidia modules don't know about udev, so a little bit more clutter is in order.
48 if [ ! -r /dev/nvidiactl ]
49 then
50 mknod -m 660 /dev/nvidiactl c 195 255
51 fi
52 if [ ! -r /dev/nvidia0 ]
53 then
54 mknod -m 660 /dev/nvidia0 c 195 0
55 fi
56 if [ ! -r /dev/nvidia1 ]
57 then
58 mknod -m 660 /dev/nvidia1 c 195 1
59 fi
60 # If you have more than two of these cards, you'll have to add devices below.
61 #mknod -m 660 /dev/nvidia2 c 195 2
62 #mknod -m 660 /dev/nvidia3 c 195 3
63 chown root:video /dev/nvidia*
64
65 # Seed the loop device by adding /dev/loop0 (use this, and they'll all appear):
66 if [ ! -r /dev/loop0 ]; then
67 mknod -m 660 /dev/loop0 b 7 0
68 chown root:disk /dev/loop0
69 fi
70
71 # Seed the floppy devices:
72 if [ ! -r /dev/fd0 ]; then
73 mknod -m 660 /dev/fd0 b 2 0
74 mknod -m 660 /dev/fd1 b 2 1
75 mknod -m 660 /dev/fd2 b 2 2
76 mknod -m 660 /dev/fd3 b 2 3
77 chown root:floppy /dev/fd{0,1,2,3}
78 fi
79
80 # We don't want to kludge *every* possible device, but a few would certainly be
81 # useful. Most of the benefit in udev is the massive reduction of tty/pty clutter
82 # (well, IMO), and I'd like to see kmod remain functional. I'd take a few more
83 # requests here. :-)
84 if [ ! -r /dev/rtc ]; then
85 mknod -m 664 /dev/rtc c 10 135
86 fi
87
88 # Devices needed for VMWare:
89 if [ ! -r /dev/vmmon ]; then
90 mknod -m 660 /dev/vmmon c 10 165
91 fi
92 if [ ! -r /dev/vmnet0 ]; then
93 mknod -m 660 /dev/vmnet0 c 119 0
94 for vmdev in 1 2 3 4 5 6 7 8 9 ; do
95 if [ ! -r /dev/vmnet${vmdev} ]; then
96 mknod -m 660 /dev/vmnet${vmdev} c 119 ${vmdev}
97 fi
98 done
99 unset vmdev
100 fi

Properties

Name Value
svn:executable *