[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /dev





On Thu, 27 May 1999, Cloudmaster wrote:
> is there an easy way to go through and make all the device entries in /dev
> when building a distrib from scratch?

Here's the script that I used.  It may not include all of the devs you
want, but its a good start.

Mark Blunier


#!/bin/sh
cd /dev/

mknod null c 1 3
chmod 666 null 

#tty
mknod tty c 5 0
#makedevs tty c 4 0 0 63 >null 2>&1
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 ; do
	mknod tty$i c 4 $i
done

#makedevs ttyp c 3 0 0 9 >null 2>&1
mknod ttyp0 c 3 0
mknod ttyp1 c 3 1
mknod ttyp2 c 3 2
mknod ttyp3 c 3 3
mknod ttyp4 c 3 4
mknod ttyp5 c 3 5
mknod ttyp6 c 3 6
mknod ttyp7 c 3 7
mknod ttyp8 c 3 8
mknod ttyp9 c 3 9
mknod ttypa c 3 10
mknod ttypb c 3 11
mknod ttypc c 3 12
mknod ttypd c 3 13
mknod ttype c 3 14
mknod ttypf c 3 15
#makedevs ttyq c 3 16 0 9 >null 2>&1
#mknod ttyq0 c 3 0
#mknod ttyq1 c 3 1
#mknod ttyq2 c 3 2
#mknod ttyq3 c 3 3
#mknod ttyq4 c 3 4
#mknod ttyq5 c 3 5
#mknod ttyq6 c 3 6
#mknod ttyq7 c 3 7
#mknod ttyq8 c 3 8
#mknod ttyq9 c 3 9
#mknod ttyqa c 3 10
#mknod ttyqb c 3 11
#mknod ttyqc c 3 12
#mknod ttyqd c 3 13
#mknod ttyqe c 3 14
#mknod ttyqf c 3 15
#makedevs ttyr c 3 32 0 9 >null 2>&1
mknod ttyr0 c 3 32
mknod ttyr1 c 3 33
mknod ttyr2 c 3 34
mknod ttyr3 c 3 35
mknod ttyr4 c 3 36
mknod ttyr5 c 3 37
mknod ttyr6 c 3 38
mknod ttyr7 c 3 39
mknod ttyr8 c 3 40
mknod ttyr9 c 3 41
mknod ttyra c 3 42
mknod ttyrb c 3 43
mknod ttyrc c 3 44
mknod ttyrd c 3 45
mknod ttyre c 3 46
mknod ttyrf c 3 47

#makedevs ttys c 3 48 0 9 >null 2>&1
mknod ttys0 c 3 48
mknod ttys1 c 3 49
mknod ttys2 c 3 50
mknod ttys3 c 3 51
mknod ttys4 c 3 52
mknod ttys5 c 3 53
mknod ttys6 c 3 54
mknod ttys7 c 3 55
mknod ttys8 c 3 56
mknod ttys9 c 3 57
mknod ttysa c 3 58
mknod ttysb c 3 59
mknod ttysc c 3 60
mknod ttysd c 3 61
mknod ttyse c 3 62
mknod ttysf c 3 63

#makedevs ptyp c 2 0 0 9 >null 2>&1
mknod ptyp0 c 2 0
mknod ptyp1 c 2 1
mknod ptyp2 c 2 2
mknod ptyp3 c 2 3
mknod ptyp4 c 2 4
mknod ptyp5 c 2 5
mknod ptyp6 c 2 6
mknod ptyp7 c 2 7
mknod ptyp8 c 2 8
mknod ptyp9 c 2 9
mknod ptypa c 2 10
mknod ptypb c 2 11
mknod ptypc c 2 12
mknod ptypd c 2 13
mknod ptype c 2 14
mknod ptypf c 2 15
#makedevs ptyq c 2 16 0 9 >null 2>&1
mknod ptyq0 c 2 16
mknod ptyq1 c 2 17
mknod ptyq2 c 2 18
mknod ptyq3 c 2 19
mknod ptyq4 c 2 20
mknod ptyq5 c 2 21
mknod ptyq6 c 2 22
mknod ptyq7 c 2 23
mknod ptyq8 c 2 24
mknod ptyq9 c 2 25
mknod ptyqa c 2 26
mknod ptyqb c 2 27
mknod ptyqc c 2 28
mknod ptyqd c 2 29
mknod ptyqe c 2 30
mknod ptyqf c 2 31
#makedevs ptyr c 2 32 0 9 >null 2>&1
mknod ptyr0 c 2 32
mknod ptyr1 c 2 33
mknod ptyr2 c 2 34
mknod ptyr3 c 2 35
mknod ptyr4 c 2 36
mknod ptyr5 c 2 37
mknod ptyr6 c 2 38
mknod ptyr7 c 2 39
mknod ptyr8 c 2 40
mknod ptyr9 c 2 41
mknod ptyra c 2 42
mknod ptyrb c 2 43
mknod ptyrc c 2 44
mknod ptyrd c 2 45
mknod ptyre c 2 46
mknod ptyrf c 2 47
#makedevs ptys c 2 48 0 9 >null 2>&1
mknod ptys0 c 2 48
mknod ptys1 c 2 49
mknod ptys2 c 2 50
mknod ptys3 c 2 51
mknod ptys4 c 2 52
mknod ptys5 c 2 53
mknod ptys6 c 2 54
mknod ptys7 c 2 55
mknod ptys8 c 2 56
mknod ptys9 c 2 57
mknod ptysa c 2 58
mknod ptysb c 2 59
mknod ptysc c 2 60
mknod ptysd c 2 61
mknod ptyse c 2 62
mknod ptysf c 2 63

mknod xconsole p

#Serial ports
#makedevs ttyS c 4 64 0 63 >null 2>&1
mknod /dev/ttyS0 c 4 64
mknod /dev/ttyS1 c 4 65
mknod /dev/ttyS2 c 4 66
mknod /dev/ttyS3 c 4 67

#IDE 
#makedevs hda b 3 0 0 8 s >null 2>&1
mknod hda b 3 0
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ; do
	mknod hda$i b 3 $i
done
#makedevs hdb b 3 64 0 8 s >null 2>&1
mknod hdb b 3 64
mknod hdb1 b 3 65
mknod hdb2 b 3 66
mknod hdb3 b 3 67
mknod hdb4 b 3 68
mknod hdb5 b 3 69
mknod hdb6 b 3 70
mknod hdb7 b 3 71
mknod hdb8 b 3 72
mknod hdb9 b 3 73
mknod hdb10 b 3 74
mknod hdb11 b 3 75
mknod hdb12 b 3 76
mknod hdb13 b 3 77
mknod hdb14 b 3 78
mknod hdb15 b 3 79
mknod hdb16 b 3 80
mknod hdb17 b 3 81
mknod hdb18 b 3 82
mknod hdb19 b 3 83
mknod hdb20 b 3 84

#makedevs hdc b 22 0 0 8 s >null 2>&1
mknod hdc b 22 0
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20; do
	mknod hdc$i b 22 $i
done
#makedevs hdd b 22 64 0 8 s >null 2>&1
mknod hdd b 22 64
mknod hdd1 b 22 65
mknod hdd2 b 22 66
mknod hdd3 b 22 67
mknod hdd4 b 22 68
mknod hdd5 b 22 69
mknod hdd6 b 22 70
mknod hdd7 b 22 71
mknod hdd8 b 22 72
mknod hdd9 b 22 73
mknod hdd10 b 22 74
mknod hdd11 b 22 75
mknod hdd12 b 22 76
mknod hdd13 b 22 77
mknod hdd14 b 22 78
mknod hdd15 b 22 79
mknod hdd16 b 22 80
mknod hdd17 b 22 81
mknod hdd18 b 22 82
mknod hdd19 b 22 83
mknod hdd20 b 22 84

#makedevs hdg b 34 0 0 8 s >null 2>&1

#SBPCD
mknod sbpcd0 b 25 0 
mknod sbpcd1 b 25 1 
mknod sbpcd2 b 25 2 
mknod sbpcd3 b 25 3 

#SCSI
#makedevs sda b 8 0 0 8 s>null 2>&1
mknod sda b 8 0
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
	mknod sda$i b 8 $i
done

#makedevs sdb b 8 16 0 8 s >null 2>&1
mknod sdb c 8 16
mknod sdb1 c 8 17
mknod sdb2 c 8 18
mknod sdb3 c 8 19
mknod sdb4 c 8 20
mknod sdb5 c 8 21
mknod sdb6 c 8 22
mknod sdb7 c 8 23
mknod sdb8 c 8 24
mknod sdb9 c 8 25
mknod sdb10 c 8 26
mknod sdb11 c 8 27
mknod sdb12 c 8 28
mknod sdb13 c 8 29
mknod sdb14 c 8 30
mknod sdb15 c 8 31

for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16; do
	mknod sg$i c 21 $i
done

#Block devs
#makedevs ram b 1 0 0 7 >null 2>&1
for i in 0 1 2 3 4 5 6 7 ; do
	mknod /dev/ram$i b 1 $i
done
#makedevs loop b 7 0 0 7 >null 2>&1
for i in 0 1 2 3 4 5 6 7 ; do
	mknod /dev/loop$i b 7 $i
done


mknod beep c 10 128 >null 2>&1
mknod modreq c 10 129 >null 2>&1
mknod watchdog c 10 130 >null 2>&1
mknod temperature c 10 131 >null 2>&1
mknod hwtrap c 10 132 >null 2>&1
mknod exttrp c 10 133 >null 2>&1
mknod rtc c 10 135 >null 2>&1
mknod relay8 c 10 140 >null 2>&1
mknod relay16 c 10 141 >null 2>&1
mknod msr c 10 142 >null 2>&1
mknod pciconf c 10 143 >null 2>&1
mknod nvram c 10 144 >null 2>&1
mknod hfmodem c 10 145 >null 2>&1
mknod led c 10 151 >null 2>&1
mknod apm_bios c 10 134 >null 2>&1
mknod mem c 1 1 >null 2>&1
mknod kmem c 1 2 >null 2>&1
mknod null c 1 3 >null 2>&1
mknod port c 1 4 >null 2>&1
mknod zero c 1 5 >null 2>&1
mknod full c 1 7 >null 2>&1
mknod random c 1 8 >null 2>&1
mknod urandom c 1 9 >null 2>&1
mknod initrd b 1 250 >null 2>&1
mknod tty c 5 0 >null 2>&1
mknod socksys c 30 0 >null 2>&1
mknod spx c 30 1 >null 2>&1

mknod inet/arp c 30 2 >null 2>&1
mknod inet/icmp c 30 2 >null 2>&1
mknod inet/ip c 30 2 >null 2>&1
mknod inet/tcp c 30 2 >null 2>&1
mknod inet/udp c 30 2 >null 2>&1

mknod fd0 b 2 0 >null 2>&1
mknod fd0h1200 b 2 8 >null 2>&1
mknod fd0h1440 b 2 40 >null 2>&1
mknod fd0h1476 b 2 56 >null 2>&1
mknod fd0h1494 b 2 72 >null 2>&1
mknod fd0h1600 b 2 92 >null 2>&1
mknod fd0u1040 b 2 84 >null 2>&1
mknod fd0u1120 b 2 88 >null 2>&1
mknod fd0u1440 b 2 28 >null 2>&1
mknod fd0u1600 b 2 124 >null 2>&1
mknod fd0u1680 b 2 44 >null 2>&1
mknod fd0u1722 b 2 60 >null 2>&1
mknod fd0u1743 b 2 76 >null 2>&1
mknod fd0u1760 b 2 96 >null 2>&1
mknod fd0u1840 b 2 116 >null 2>&1
mknod fd0u1920 b 2 100 >null 2>&1
mknod fd0u2880 b 2 32 >null 2>&1
mknod fd0u3200 b 2 104 >null 2>&1
mknod fd0u3520 b 2 108 >null 2>&1
mknod fd0u3840 b 2 112 >null 2>&1

#symlinks
ln -sf /proc/self/fd fd >null 2>&1
ln -sf fd/0 stdin >null 2>&1
ln -sf fd/1 stdout >null 2>&1
ln -sf fd/2 stderr >null 2>&1

ln -sf tty0 console >null 2>&1
ln -sf socksys nfsd >null 2>&1
ln -sf null X0R >null 2>&1

ln -sf ram0 ramdisk >null 2>&1
ln -sf ram0 ram >null 2>&1

cd /