source: npl/system/udev/make_extra_nodes.sh @ 26ffad7

Last change on this file since 26ffad7 was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100755
File size: 2.7 KB
Line 
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
9if [ -z $udev_root ]; then
10  . /etc/udev/udev.conf
11fi
12
13# these are a few things that sysfs does not export for us.
14ln -snf /proc/self/fd $udev_root/fd
15ln -snf /proc/self/fd/0 $udev_root/stdin
16ln -snf /proc/self/fd/1 $udev_root/stdout
17ln -snf /proc/self/fd/2 $udev_root/stderr
18ln -snf /proc/kcore $udev_root/core
19if [ -r $udev_root/psaux ]; then
20  ( cd $udev_root ; ln -sf psaux mouse )
21fi
22mkdir $udev_root/pts
23mkdir $udev_root/shm
24
25# If we can, add a default /dev/cdrom and /dev/dvd link:
26if /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  )
38fi
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.
42if [ ! -r /dev/ppp ]; then
43  mknod -m 660 /dev/ppp c 108 0
44  chown root:uucp /dev/ppp
45fi
46
47# nVidia modules don't know about udev, so a little bit more clutter is in order.
48mknod -m 660 /dev/nvidiactl c 195 255
49mknod -m 660 /dev/nvidia0 c 195 0
50mknod -m 660 /dev/nvidia1 c 195 1
51# If you have more than two of these cards, you'll have to add devices below.
52#mknod -m 660 /dev/nvidia2 c 195 2
53#mknod -m 660 /dev/nvidia3 c 195 3
54chown root:video /dev/nvidia*
55
56# Seed the loop device by adding /dev/loop0 (use this, and they'll all appear):
57if [ ! -r /dev/loop0 ]; then
58  mknod -m 660 /dev/loop0 b 7 0
59  chown root:disk /dev/loop0
60fi
61
62# Seed the floppy devices:
63if [ ! -r /dev/fd0 ]; then
64  mknod -m 660 /dev/fd0 b 2 0
65  mknod -m 660 /dev/fd1 b 2 1
66  mknod -m 660 /dev/fd2 b 2 2
67  mknod -m 660 /dev/fd3 b 2 3
68  chown root:floppy /dev/fd{0,1,2,3}
69fi
70
71# We don't want to kludge *every* possible device, but a few would certainly be
72# useful.  Most of the benefit in udev is the massive reduction of tty/pty clutter
73# (well, IMO), and I'd like to see kmod remain functional.  I'd take a few more
74# requests here.  :-)
75if [ ! -r /dev/rtc ]; then
76  mknod -m 664 /dev/rtc c 10 135
77fi
78
79# Devices needed for VMWare:
80if [ ! -r /dev/vmmon ]; then
81  mknod -m 660 /dev/vmmon c 10 165
82fi
83if [ ! -r /dev/vmnet0 ]; then
84  mknod -m 660 /dev/vmnet0 c 119 0
85  for vmdev in 1 2 3 4 5 6 7 8 9 ; do
86    if [ ! -r /dev/vmnet${vmdev} ]; then
87      mknod -m 660 /dev/vmnet${vmdev} c 119 ${vmdev}
88    fi
89  done
90  unset vmdev
91fi
92
Note: See TracBrowser for help on using the repository browser.