-
Notifications
You must be signed in to change notification settings - Fork 1
/
runsetup2
executable file
·123 lines (109 loc) · 2.58 KB
/
runsetup2
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/usr/bin/env expect
#
# Boot single user from the minimal system setup by "runsetup",
# configure the system and install the other tape images.
# see http://minnie.tuhs.org/PUPS/Setup/v6_setup.html
#
source common.tcl
spawn pdp11
simh "set cpu 11/40"
simh "set tto 7b"
simh "set tm0 locked"
simh "attach tm0 dist.tap"
simh "attach rk0 rk0"
simh "attach rk1 rk1"
simh "attach rk2 rk2"
simh "dep system sr 173030"
simh "boot rk0"
respond "@" "rkunix\r"
unix "stty -lcase"
# configure and build a new kernel
unix "chdir /usr/sys/conf"
unix "cc mkconf.c"
unix "mv a.out mkconf"
unix "mkconf"
sendline "rk"
sendline "tm"
sendline "tc"
sendline "8dc"
sendline "done"
unix "as m40.s"
unix "mv a.out m40.o"
unix "cc -c c.c"
unix "as l.s"
unix "ld -x a.out m40.o c.o ../lib1 ../lib2"
unix "mv a.out /unix"
# make devices
unix "/etc/mknod /dev/rk0 b 0 0"
unix "/etc/mknod /dev/rk1 b 0 1"
unix "/etc/mknod /dev/rk2 b 0 2"
unix "/etc/mknod /dev/mt0 b 3 0"
unix "/etc/mknod /dev/tap0 b 4 0"
unix "/etc/mknod /dev/rrk0 c 9 0"
unix "/etc/mknod /dev/rrk1 c 9 1"
unix "/etc/mknod /dev/rrk2 c 9 2"
unix "/etc/mknod /dev/rmt0 c 12 0"
unix "/etc/mknod /dev/tty0 c 3 0"
unix "/etc/mknod /dev/tty1 c 3 1"
unix "/etc/mknod /dev/tty2 c 3 2"
unix "/etc/mknod /dev/tty3 c 3 3"
unix "/etc/mknod /dev/tty4 c 3 4"
unix "/etc/mknod /dev/tty5 c 3 5"
unix "/etc/mknod /dev/tty6 c 3 6"
unix "/etc/mknod /dev/tty7 c 3 7"
unix "chmod 640 /dev/*rk*"
unix "chmod 640 /dev/*mt*"
unix "chmod 640 /dev/*tap*"
# install other filesystems from tape
unix "dd if=/dev/mt0 of=/dev/rk1 count=4000 skip=4100"
unix "/etc/mount /dev/rk1 /usr/source"
unix "dd if=/dev/mt0 of=/dev/rk2 count=4000 skip=8100"
unix "mkdir /usr/doc"
#unix "/etc/mount /dev/rk2 /usr/doc"
# configure boot
unix "ed /etc/rc"
sendline "\$a"
sendline "/etc/mount /dev/rk1 /usr/source"
sendline "/etc/mount /dev/rk2 /usr/doc"
sendline "."
sendline "w"
sendline "q"
# configure df
unix "chdir /usr/source/s1"
unix "ed df.c"
sendline "/rp0/d"
sendline ".-2a"
sendline " \"/dev/rk0\","
sendline " \"/dev/rk1\","
sendline "."
sendline "w"
sendline "q"
unix "cc df.c"
unix "cat a.out >/bin/df"
# configure a user
unix "ed /etc/passwd"
sendline "\$a"
sendline "user::10:1::/usr/user:"
sendline "."
sendline "w"
sendline "q"
unix "mkdir /usr/user"
unix "chown user /usr/user"
# enable 8 serial ttys
unix "ed /etc/ttys"
sendline "1,8s/^0/1/"
sendline "w"
sendline "q"
# cleanup
#unix "icheck /dev/rrk0"
#unix "dcheck /dev/rrk0"
#unix "icheck /dev/rrk1"
#unix "dcheck /dev/rrk1"
#unix "icheck /dev/rrk2"
#unix "dcheck /dev/rrk2"
unix "sync"
unix "sync"
unix "sync"
respond "# " $break
simh "quit"
expect eof