File: postinst

package info (click to toggle)
makedev 2.3.1-83
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 196 kB
  • ctags: 4
  • sloc: sh: 2,140; makefile: 46
file content (84 lines) | stat: -rw-r--r-- 1,973 bytes parent folder | download
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/sh

set +e

#DEBHELPER#

cd /dev

# don't stomp on devfs users
if  [ -c .devfsd ]
then
    echo ".devfsd presence implies active DevFS.  Aborting postinst before touching /dev."
    # use exit 0, not 1, since this isn't a failure, per se
    exit 0
fi

/sbin/MAKEDEV std
/sbin/MAKEDEV consoleonly

/bin/chmod g-r,o= /dev/tty[0-9]*

# ensure base tty set exists, since debootstrap no longer does
for i in tty0 tty1 tty2 tty3 tty4 tty5 tty6 tty7 tty8 tty9; do
	test -e /dev/$i || /sbin/MAKEDEV $i
done

test -e /dev/random || /sbin/MAKEDEV random
test -e /dev/urandom || /sbin/MAKEDEV urandom
test -e /dev/audio || /sbin/MAKEDEV audio
test -e /dev/agpgart || /sbin/MAKEDEV agpgart

[ ! -f /dev/mouse ] && [ -f /dev/sunmouse ] && ln -s sunmouse mouse

# force update of fb devices if kernel is >= 2.4 and they already exist
kern_rev1=`uname -r | sed -e 's@^\([^.]*\)\..*@\1@'`
kern_rev2=`uname -r | sed -e 's@^[^.]*\.\([^.]*\)\..*@\1@'`
if [ $kern_rev1 -ge 2 ] && [ $kern_rev2 -ge 4 ] && [ -e /dev/fb0 ]
then
	/sbin/MAKEDEV fb
fi

for A in sda16 sdb16 sdc16 sdd16 sde16 sdf16 sdg16 sdh16 \
	 ada16 adb16 adc16 add16 ade16 adf16 adg16 adh16
do
	test -e /dev/$A && rm /dev/$A
done

for A in logibm psaux inportbm atibm jbm smouse logimouse psmouse \
msmouse atimouse jmouse amigamouse atarimouse sunmouse amigamouse1
do
	test -e /dev/$A && chmod 600 /dev/$A
done

# fix security hole caused by group-write permissions on kmem
test -e /dev/kmem && chown root:kmem /dev/kmem && chmod 0640 /dev/kmem

LIST=""

for TYPE in tty pty ; do
	for LETTER in p q r s t u v w x y z a b c d e ; do
		if [ -e /dev/$TYPE$LETTER"0" ]; then
			MAJOR="`/bin/ls -l /dev/$TYPE$LETTER"0"|cut -c33-36`"
			if [ "$MAJOR" = 4 ] ; then
				LIST="$LIST $TYPE$LETTER"
			fi
		fi
	done
done

if [ -n "$LIST" ]; then
	cat > /etc/rc.boot/makedev << EOF
#!/bin/sh

echo "Creating new console devices"
/sbin/MAKEDEV $LIST

rm /etc/rc.boot/makedev ; exit 0
EOF

chmod 755 /etc/rc.boot/makedev

fi

exit 0