slitaz-base-files view rootfs/sbin/mktazdevs.sh @ rev 48

Fix typos
author Mike D. Smith <MikeDSmith25@gmail.com>
date Sat Jul 19 06:44:18 2008 +0000 (2008-07-19)
parents 1a0df590c912
children 54ca1fd18377
line source
1 #!/bin/sh
2 # mktazdevs.sh: Make device files for SliTaz GNU/Linux
3 # 2007/10/02 - pankso@slitaz.org
4 #
6 # Script functions.
7 status()
8 {
9 local CHECK=$?
10 echo -en "\\033[70G[ "
11 if [ $CHECK = 0 ]; then
12 echo -en "\\033[1;33mOK"
13 else
14 echo -en "\\033[1;31mFailed"
15 fi
16 echo -e "\\033[0;39m ]"
17 }
19 # We do our work in the dev/ directory.
20 if [ -z "$1" ] ; then
21 echo "usage: `basename $0` path/to/dev"
22 exit 1
23 fi
25 # Script start.
26 echo -n "Moving to $1... "
27 cd $1
28 status
30 # Make useful directories.
31 echo -n "Starting to build directories... "
32 mkdir pts input net usb shm
33 status
35 # Script start.
36 #
37 echo -n "Starting to build devices... "
39 # Input devs.
40 #
41 mknod input/event0 c 13 64
42 mknod input/event1 c 13 65
43 mknod input/event2 c 13 66
44 mknod input/mouse0 c 13 32
45 mknod input/mice c 13 63
46 mknod input/ts0 c 254 0
48 # Miscellaneous one-of-a-kind stuff.
49 #
50 mknod logibm c 10 0
51 mknod psaux c 10 1
52 mknod inportbm c 10 2
53 mknod atibm c 10 3
54 mknod console c 5 1
55 mknod full c 1 7
56 mknod kmem c 1 2
57 mknod mem c 1 1
58 mknod null c 1 3
59 mknod port c 1 4
60 mknod random c 1 8
61 mknod urandom c 1 9
62 mknod zero c 1 5
63 mknod rtc c 10 135
64 mknod sr0 b 11 0
65 mknod sr1 b 11 1
66 mknod agpgart c 10 175
67 mknod dri c 10 63
68 mknod ttyS0 c 4 64
69 mknod audio c 14 4
70 mknod beep c 10 128
71 mknod ptmx c 5 2
72 mknod nvram c 10 144
73 ln -s /proc/kcore core
74 # DSP
75 mknod -m 0666 dsp c 14 3
76 # PPP dev.
77 mknod ppp c 108 0
79 # net/tun device.
80 #
81 mknod net/tun c 10 200
83 # Framebuffer devs.
84 #
85 mknod fb0 c 29 0
86 mknod fb1 c 29 32
87 mknod fb2 c 29 64
88 mknod fb3 c 29 96
89 mknod fb4 c 29 128
90 mknod fb5 c 29 160
91 mknod fb6 c 29 192
93 # usb/hiddev.
94 #
95 mknod usb/hiddev0 c 180 96
96 mknod usb/hiddev1 c 180 97
97 mknod usb/hiddev2 c 180 98
98 mknod usb/hiddev3 c 180 99
99 mknod usb/hiddev4 c 180 100
100 mknod usb/hiddev5 c 180 101
101 mknod usb/hiddev6 c 180 102
103 # IDE HD devs.
104 # With a fiew concievable partitions, you can do
105 # more of them yourself as you need 'em.
106 #
108 # hda devs.
109 #
110 mknod hda b 3 0
111 mknod hda1 b 3 1
112 mknod hda2 b 3 2
113 mknod hda3 b 3 3
114 mknod hda4 b 3 4
115 mknod hda5 b 3 5
116 mknod hda6 b 3 6
117 mknod hda7 b 3 7
118 mknod hda8 b 3 8
119 mknod hda9 b 3 9
121 # hdb devs.
122 #
123 mknod hdb b 3 64
124 mknod hdb1 b 3 65
125 mknod hdb2 b 3 66
126 mknod hdb3 b 3 67
127 mknod hdb4 b 3 68
128 mknod hdb5 b 3 69
129 mknod hdb6 b 3 70
130 mknod hdb7 b 3 71
131 mknod hdb8 b 3 72
132 mknod hdb9 b 3 73
134 # hdc and hdd.
135 #
136 mknod hdc b 22 0
137 mknod hdd b 22 64
139 # sda devs.
140 #
141 mknod sda b 8 0
142 mknod sda1 b 8 1
143 mknod sda2 b 8 2
144 mknod sda3 b 8 3
145 mknod sda4 b 8 4
146 mknod sda5 b 8 5
147 mknod sda6 b 8 6
148 mknod sda7 b 8 7
149 mknod sda8 b 8 8
150 mknod sda9 b 8 9
151 ln -s sda1 flash
153 # sdb devs.
154 #
155 mknod sdb b 8 16
156 mknod sdb1 b 8 17
157 mknod sdb2 b 8 18
158 mknod sdb3 b 8 19
159 mknod sdb4 b 8 20
160 mknod sdb5 b 8 21
161 mknod sdb6 b 8 22
162 mknod sdb7 b 8 23
163 mknod sdb8 b 8 24
164 mknod sdb9 b 9 25
166 # Floppy device.
167 #
168 mknod fd0 b 2 0
170 # loop devs.
171 #
172 for i in `seq 0 7`; do
173 mknod loop$i b 7 $i
174 done
176 # ram devs.
177 #
178 for i in `seq 0 7`; do
179 mknod ram$i b 1 $i
180 done
181 ln -s ram1 ram
183 # tty devs.
184 #
185 mknod tty c 5 0
186 for i in `seq 0 7`; do
187 mknod tty$i c 4 $i
188 done
190 # Virtual console screen devs.
191 #
192 for i in `seq 0 7`; do
193 mknod vcs$i c 7 $i
194 done
195 ln -s vcs0 vcs
197 # Virtual console screen w/ attributes devs.
198 #
199 for i in `seq 0 7`; do
200 mknod vcsa$i c 7 $(($i + 128))
201 done
202 ln -s vcsa0 vcsa
204 status
206 # Symlinks.
207 #
208 ln -snf /proc/self/fd fd
209 ln -snf /proc/self/fd/0 stdin
210 ln -snf /proc/self/fd/1 stdout
211 ln -snf /proc/self/fd/2 stderr
213 # Changes permissions.
214 #
215 echo -n "Changing permissions on devices... "
216 chmod 0666 ptmx
217 chmod 0666 null
218 chmod 0622 console
219 chmod 0666 tty*
220 status
222 # Script end.
223 echo -n "All devices are build..."
224 status