Commit | Line | Data |
---|---|---|
f078e99d | 1 | #!/bin/sh |
362925ff | 2 | # install1.fs disk 'install' |
f078e99d | 3 | # |
362925ff AM |
4 | # Currently, no method for checking to see if the designated disk type is |
5 | # already in /etc/disktab. You can edit it out of the file after installation. | |
f078e99d | 6 | # |
d39e7451 | 7 | PATH=/sbin:/bin:/usr/bin:/usr/sbin:. |
56164db9 | 8 | export PATH |
d39e7451 | 9 | |
c5bc0e81 | 10 | OPSYSTEM=FreeBSD |
362925ff AM |
11 | OPSYSID=165 |
12 | ROOTMIN=7 | |
13 | SWAPMIN=8 | |
4c569b4c | 14 | USRMIN=7 |
362925ff | 15 | DISKMIN=`expr $ROOTMIN + $SWAPMIN + 1` |
0d255f16 | 16 | DEFBLOCKING=2 |
8231ed99 RG |
17 | DEFSECT=17 |
18 | DEFHEAD=12 | |
19 | DEFCYLN=1024 | |
362925ff | 20 | RUN_FDISK="" |
f078e99d | 21 | |
4c569b4c AM |
22 | DOS1_ID=1 |
23 | DOS2_ID=4 | |
24 | DOS3_ID=6 | |
25 | ||
362925ff AM |
26 | set_arbitrary_defaults() { |
27 | cyls_per_disk=$DEFCYLN | |
28 | tracks_per_cyl=$DEFHEAD | |
29 | sects_per_track=$DEFSECT | |
30 | unused_last_part=3 | |
31 | part_cnt=4 | |
32 | } | |
33 | ||
34 | ||
35 | get_fdisk_data() { | |
36 | cyls_per_disk= | |
37 | part_id= | |
38 | got_sysid= | |
39 | part_cnt=0 | |
40 | sysid_cnt=0 | |
41 | have_opsys_part= | |
4c569b4c | 42 | have_dos_part= |
362925ff AM |
43 | unused_last_part= |
44 | extent_max=0 | |
45 | extent_max_part= | |
46 | ||
47 | fdisk /dev/r${drivename}d >fdisk.out 2>fdisk.err | |
48 | if [ $? -gt 0 ]; then | |
49 | echo "Can't open /dev/r${drivename}d for reading!" | |
50 | set_arbitrary_defaults | |
51 | >fdisk.out | |
52 | >fdisk.err | |
53 | return 2 | |
54 | elif [ -s fdisk.err ]; then | |
55 | echo "Disk doesn't appear to be initialized..." | |
56 | no_part_table=1 | |
21a421ff | 57 | fi |
362925ff AM |
58 | while read data; do |
59 | if [ ! "$cyls_per_disk" ]; then | |
60 | cyls_per_disk=`expr "$data" : '[^=]*=\([0-9]*\)'` | |
61 | tracks_per_cyl=`expr "$data" : '[^=]*=[^=]*=\([0-9]*\)'` | |
62 | sects_per_track=`expr "$data" : '[^=]*=[^=]*=[^=]*=\([0-9]*\)'` | |
63 | continue | |
64 | fi | |
65 | if [ "$got_sysid" ]; then | |
66 | start_part=`expr "$data" : '[^0-9]*\([0-9]*\)'` | |
67 | size_part=`expr "$data" : '[^0-9]*[0-9]*[^0-9]*\([0-9]*\)'` | |
68 | extent_part=`expr $start_part + $size_part` | |
69 | if [ $extent_part -gt $extent_max ]; then | |
70 | extent_max=$extent_part | |
71 | extent_max_part=$part_id | |
72 | fi | |
73 | eval start${part_id}=$start_part | |
74 | eval size${part_id}=$size_part | |
75 | sysid_cnt=`expr $sysid_cnt + 1` | |
76 | got_sysid= | |
77 | part_id= | |
78 | elif [ "$part_id" ]; then | |
79 | sysid=`expr "$data" : 'sysid \([0-9]*\)'` | |
e7f1e154 | 80 | sysname=`expr "$data" : 'sysid[^(]*(\([^)]*\)'` |
362925ff AM |
81 | if [ "$no_part_table" -o "$sysid" = "0" -o \ |
82 | "$(expr "$data" : '\(<UNUSED>\)')" = "<UNUSED>" ]; then | |
83 | unused_last_part=$part_id | |
84 | part_id= | |
85 | continue | |
86 | fi | |
4c569b4c AM |
87 | if [ "$sysid" = "$OPSYSID" ]; then |
88 | have_opsys_part=$part_id | |
89 | elif [ ! "$have_dos_part" -a \( "$sysid" = "$DOS1_ID" -o \ | |
90 | "$sysid" = "$DOS2_ID" -o "$sysid" = "$DOS3_ID" \) ]; then | |
91 | have_dos_part=$part_id | |
92 | fi | |
362925ff | 93 | eval sysid${part_id}=$sysid |
691e6212 | 94 | eval sysname${part_id}=\"$sysname\" |
362925ff AM |
95 | got_sysid=1 |
96 | else | |
97 | part_id=`expr "$data" : 'The data[^0-9]*\([0-9]*\)'` | |
98 | beg_cyl=`expr "$data" : '[ ]*beg[^0-9]*\([0-9]*\)'` | |
99 | end_cyl=`expr "$data" : '[ ]*end[^0-9]*\([0-9]*\)'` | |
100 | if [ "$part_id" ]; then | |
101 | part_cnt=`expr $part_cnt + 1` | |
d39e7451 AM |
102 | elif [ "${beg_cyl}" -gt "${cyls_per_disk}" -o \ |
103 | "${end_cyl}" -gt "${cyls_per_disk}" ]; then | |
104 | no_part_table=1 | |
105 | sysid_cnt=0 | |
106 | have_opsys_part=0 | |
107 | unused_last_part=`expr $part_cnt - 1` | |
362925ff AM |
108 | fi |
109 | fi | |
110 | done <fdisk.out | |
111 | if [ ! "$cyls_per_disk" ]; then | |
112 | set_arbitrary_defaults | |
113 | return 2 | |
114 | fi | |
115 | >fdisk.out | |
116 | >fdisk.err | |
117 | return 0 | |
118 | } | |
119 | ||
691e6212 AM |
120 | set_existing_part() { |
121 | # Set existing partiton values as default (adjusting to cylinder boundaries) | |
122 | eval opsys_size=\$size${opsys_part} | |
123 | eval opsys_start=\$start${opsys_part} | |
124 | [ $opsys_size -eq 50000 ] && opsys_size=$disksize | |
125 | opsys_off=`expr $opsys_start / $cylindersize` | |
126 | opsys_adjusted=`expr $opsys_off \* $cylindersize` | |
127 | if [ $opsys_adjusted -lt $opsys_start -o $opsys_off -eq 0 ]; then | |
128 | opsys_off=`expr $opsys_off + 1` | |
129 | opsys_adjusted=`expr $opsys_off \* $cylindersize` | |
130 | opsys_size=`expr $opsys_size - $opsys_adjusted + $opsys_start` | |
131 | fi | |
132 | cyls_per_opsys=`expr $opsys_size / $cylindersize` | |
133 | RUN_FDISK="fdisk -u" | |
134 | } | |
135 | ||
136 | ||
137 | set_overwrite_part() { | |
138 | while :; do | |
139 | echo | |
140 | echo -n "Please specify partition to overwrite: [3] " | |
141 | read resp junk | |
142 | opsys_part=${resp:-3} | |
143 | if [ "$opsys_part" -ge 0 -a "$opsys_part" -le 3 ]; then | |
144 | break | |
145 | else | |
146 | echo | |
147 | echo "Partition must be in the range [0-3]" | |
148 | fi | |
149 | done | |
150 | set_existing_part | |
151 | } | |
152 | ||
362925ff | 153 | analyze_fdisk_data() { |
691e6212 AM |
154 | if [ "$part_cnt" -gt 0 ]; then |
155 | echo | |
156 | echo "Partition Offset* Size* Name" | |
157 | echo "--------- ------ ---- ----" | |
158 | i=0 | |
159 | while [ $i -lt $part_cnt ]; do | |
160 | pcyls= | |
161 | poff= | |
162 | eval psize=\$size${i} | |
163 | eval pstart=\$start${i} | |
164 | eval pname=\$sysname${i} | |
165 | [ "$psize" -eq 50000 ] && psize=$disksize | |
166 | if [ "$psize" ]; then | |
167 | poff=`expr $pstart / $cylindersize` | |
168 | padjusted=`expr $poff \* $cylindersize` | |
169 | if [ "$padjusted" -lt "$pstart" ]; then | |
170 | poff=`expr $poff + 1` | |
171 | padjusted=`expr $poff \* $cylindersize` | |
172 | psize=`expr $psize - $padjusted + $pstart` | |
173 | fi | |
174 | pcyls=`expr $psize / $cylindersize` | |
175 | fi | |
176 | echo -n "${i}" | |
177 | echo -n " ${poff:-0}" | |
178 | echo -n " ${pcyls:-0}" | |
179 | echo " ${pname:-(Unused)}" | |
180 | i=`expr $i + 1` | |
181 | done | |
182 | echo "* Sizes and offsets are in units of cylinders." | |
183 | fi | |
362925ff AM |
184 | # Case I: >1024 cylinders |
185 | force_offset= | |
186 | if [ $cyls_per_disk -gt 1024 ]; then | |
187 | echo | |
1f49206c AM |
188 | echo " WARNING: >1024 cylinders. On some hardware, this prevents" |
189 | echo " ${OPSYSTEM} from sharing the disk with other operating systems." | |
691e6212 | 190 | echo -n "Install ${OPSYSTEM} on entire disk, overwriting existing partitions? [n] " |
362925ff | 191 | read resp junk |
362925ff | 192 | case "$resp" in |
f078e99d | 193 | y*|Y*) |
730f2c4e | 194 | RUN_FDISK="" |
362925ff | 195 | force_offset=1 |
730f2c4e AM |
196 | opsys_off=0 |
197 | cyls_per_opsys=${cyls_per_disk} | |
198 | opsys_part=${unused_last_part:-3} | |
199 | return 0 | |
362925ff AM |
200 | ;; |
201 | *) | |
21a421ff | 202 | echo |
730f2c4e | 203 | echo "If the number of disk cylinders does not exceed 1024, then ${OPSYSTEM}" |
362925ff | 204 | echo "can be installed alongside other operating systems on a single disk." |
730f2c4e AM |
205 | echo "Otherwise, it is system-dependent whether this will work or not." |
206 | echo "In the worst case, ${OPSYSTEM} MUST be installed at the beginning of" | |
207 | echo "the disk, and existing partitions will be lost." | |
208 | echo | |
209 | echo "For now, we will assume that >1024 cylinders creates no problems..." | |
210 | # FALL THROUGH | |
362925ff AM |
211 | ;; |
212 | esac | |
730f2c4e | 213 | fi |
362925ff | 214 | # Case II: no partitions used |
730f2c4e | 215 | if [ $sysid_cnt -eq 0 ]; then |
362925ff | 216 | echo |
1f49206c AM |
217 | echo " WARNING: partition table is either missing or corrupt." |
218 | echo " Existing partitions will be lost." | |
362925ff AM |
219 | part_cnt=${part_cnt:-4} |
220 | RUN_FDISK="overwrite" | |
221 | opsys_off=1 | |
222 | cyls_per_opsys=`expr ${cyls_per_disk} - 1` | |
223 | opsys_part=${unused_last_part:-3} | |
224 | return 0 | |
225 | # Case IIIa: overwrite an existing 386BSD/NetBSD/FreeBSD partition | |
226 | elif [ "$have_opsys_part" ]; then | |
227 | echo | |
228 | echo "386/Net/FreeBSD partition already exists!" | |
691e6212 | 229 | echo -n "Overwrite existing partition? [n] " |
362925ff | 230 | read resp junk |
362925ff AM |
231 | case "$resp" in |
232 | y*|Y*) | |
362925ff | 233 | opsys_part=${have_opsys_part} |
691e6212 | 234 | set_existing_part |
362925ff AM |
235 | return 0 |
236 | ;; | |
237 | *) | |
238 | have_opsys_part= | |
239 | # FALL THROUGH | |
240 | ;; | |
241 | esac | |
242 | fi | |
243 | ||
244 | # Case IIIb: no partitions available | |
245 | if [ $sysid_cnt -eq $part_cnt -a ! "$have_opsys_part" ]; then | |
246 | echo | |
247 | echo "No unused partitions." | |
362925ff AM |
248 | echo -n "Install $OPSYSTEM and overwrite the entire disk? [n] " |
249 | read resp junk | |
250 | case "$resp" in | |
251 | y*|Y*) | |
252 | # don't use first cylinder! | |
253 | opsys_off=1 | |
254 | cyls_per_opsys=`expr $cyls_per_disk - 1` | |
255 | opsys_part=${unused_last_part} | |
256 | RUN_FDISK="overwrite" | |
362925ff AM |
257 | ;; |
258 | *) | |
691e6212 | 259 | set_overwrite_part |
362925ff AM |
260 | ;; |
261 | esac | |
691e6212 | 262 | return 0 |
362925ff AM |
263 | fi |
264 | ||
265 | ||
266 | # *** CAVEAT *** | |
267 | # $OPSYSTEM installs at the end of the disk. If the | |
268 | # beginning of the disk is free but not the end, install fails! | |
269 | ||
270 | # Assume `fdisk -u' to add $OPSYSTEM in last unused partition for remaining cases | |
271 | opsys_part=${unused_last_part} | |
272 | RUN_FDISK="fdisk -u" | |
273 | mb_sect=`expr 1024 \* 1024 / $bytes_per_sect` | |
274 | disk_minimum=`expr $DISKMIN \* $mb_sect` | |
275 | ||
276 | # Case IV: No room (at end of disk) for mininal install | |
691e6212 | 277 | [ $extent_max -eq 50000 ] && extent_max=$disksize |
362925ff AM |
278 | disk_remaining=`expr $disksize - $extent_max` |
279 | if [ $disk_remaining -lt $disk_minimum ]; then | |
280 | echo | |
281 | echo "Not enough space ($DISKMIN Mb) at end of disk to install $OPSYSTEM." | |
282 | echo -n "Install FreeBSD and overwrite the entire disk? [n] " | |
283 | read resp junk | |
284 | case "$resp" in | |
285 | y*|Y*) | |
286 | # don't use first cylinder! | |
287 | opsys_off=1 | |
288 | cyls_per_opsys=`expr $cyls_per_disk - 1` | |
289 | opsys_part=${unused_last_part} | |
290 | RUN_FDISK="overwrite" | |
f078e99d RG |
291 | ;; |
292 | *) | |
362925ff | 293 | echo |
691e6212 AM |
294 | echo -n "Overwrite an existing partition? [n] " |
295 | read resp junk | |
296 | case "$resp" in | |
297 | y*|Y*) | |
298 | set_overwrite_part | |
299 | ;; | |
300 | *) | |
301 | echo | |
302 | echo " WARNING: To install ${OPSYSTEM}, you're on your own in figuring" | |
303 | echo " out where on the disk it will fit without overwriting another" | |
304 | echo " partition..." | |
305 | # Set defaults assuming there is only one partition at end of disk | |
306 | eval start=\$start${extent_max_part} | |
307 | # don't use first cylinder! | |
308 | opsys_off=1 | |
309 | cyls_per_opsys=`expr $start / $cylindersize - 1` | |
310 | [ $cyls_per_opsys -lt 0 ] && cyls_per_opsys=0 | |
311 | ;; | |
312 | esac | |
f078e99d | 313 | ;; |
362925ff AM |
314 | esac |
315 | return 0 | |
316 | fi | |
317 | ||
318 | # Case V: Room for $OPSYSTEM and partition data okay | |
319 | opsys_off=`expr $extent_max / $cylindersize` | |
320 | opsys_extent=`expr $opsys_off \* $cylindersize` | |
321 | [ $opsys_extent -lt $extent_max ] && opsys_off=`expr $opsys_off + 1` | |
322 | cyls_per_opsys=`expr $cyls_per_disk - $opsys_off` | |
323 | return 0 | |
324 | } | |
325 | ||
326 | put_fdisk_data() { | |
327 | start=$root_offset | |
328 | size=$partition | |
329 | ||
330 | if [ "$RUN_FDISK" = "overwrite" ]; then | |
331 | # How do you overwrite without explicitly editing each entry? | |
332 | ( | |
333 | echo y | |
334 | echo $cyls_per_disk | |
335 | echo $tracks_per_cyl | |
336 | echo $sects_per_track | |
337 | echo y | |
338 | ) >fdisk.script | |
339 | i=0 | |
340 | n=`expr ${part_cnt:-4} - 1` | |
341 | while [ $i -lt $n ]; do | |
342 | echo y | |
343 | echo 0 | |
344 | echo 0 | |
345 | echo 0 | |
346 | echo n | |
347 | echo y | |
348 | i=`expr $i + 1` | |
349 | done >>fdisk.script | |
350 | ( echo y | |
351 | echo ${OPSYSID} | |
352 | echo ${start} | |
353 | echo ${size} | |
354 | echo n | |
355 | echo y | |
356 | echo y | |
357 | echo ${n} | |
358 | echo y | |
359 | echo y | |
360 | ) >>fdisk.script | |
a631d31f | 361 | fdisk -u /dev/r${drivename}d <fdisk.script >/dev/null 2>&1 |
362925ff | 362 | elif [ "$RUN_FDISK" ]; then |
a631d31f | 363 | $RUN_FDISK -${opsys_part:-${unused_last_part:-3}} /dev/r${drivename}d <<-EOF >/dev/null 2>&1 |
362925ff AM |
364 | y |
365 | $cyls_per_disk | |
366 | $tracks_per_cyl | |
367 | $sects_per_track | |
368 | y | |
369 | y | |
370 | ${OPSYSID} | |
371 | ${start} | |
372 | ${size} | |
373 | n | |
374 | y | |
375 | y | |
376 | ${opsys_part:-${unused_last_part:-3}} | |
377 | y | |
378 | y | |
379 | EOF | |
380 | fi | |
381 | ||
382 | } | |
383 | ||
43a91bf9 | 384 | echo "Welcome to ${OPSYSTEM}." |
362925ff | 385 | echo |
43a91bf9 | 386 | echo "This program is designed to help put ${OPSYSTEM} on a hard disk with" |
362925ff AM |
387 | echo "at least $DISKMIN Megabytes of free space." |
388 | echo | |
e72bf634 AM |
389 | echo "Before starting, it is important to know your hard disk's geometry" |
390 | echo "(i.e., number of cylinders, heads and sectors/track). If installing" | |
391 | echo "${OPSYSTEM} on the same disk as another operating system, then the" | |
392 | echo "two systems should use the same geometry. In particular, ${OPSYSTEM}'s" | |
393 | echo "default geometry is inappropriate for MS-DOS. So in this case, the" | |
394 | echo "DOS geometry should be used instead." | |
362925ff | 395 | echo |
e72bf634 AM |
396 | echo "As with anything which modifies a hard drive's contents, this program" |
397 | echo "can cause SIGNIFICANT data loss. We strongly recommend making sure" | |
398 | echo "that the hard drive is backed up before going further with the" | |
399 | echo "installation process." | |
362925ff AM |
400 | echo |
401 | echo -n "Proceed with installation? [y] " | |
402 | read resp junk | |
403 | resp=${resp:-y} | |
404 | case "$resp" in | |
405 | y*|Y*) | |
406 | echo | |
43a91bf9 | 407 | echo "Cool! Let's get to it..." |
362925ff AM |
408 | echo |
409 | echo "If a mistake is made along the way, don't bail out." | |
e72bf634 | 410 | echo "At the end, you have the option of redoing the configuration." |
362925ff AM |
411 | echo "If you really must quit at some point, type <CTRL>+C and" |
412 | echo "enter \`halt' at the command prompt, \`#'." | |
413 | ;; | |
414 | *) | |
415 | echo | |
43a91bf9 RG |
416 | echo "OK, then. Enter \`halt' to halt the machine." |
417 | echo "Once the machine has halted, remove the floppy," | |
418 | echo "and press any key to reboot." | |
362925ff AM |
419 | exit |
420 | ;; | |
f078e99d | 421 | esac |
c5bc0e81 | 422 | |
362925ff AM |
423 | mount -u /dev/fd0a / |
424 | sync | |
ede9f473 | 425 | verified_install="" |
362925ff | 426 | while [ ! "$verified_install" ]; do # Begin of Big Loop |
ede9f473 | 427 | |
c5bc0e81 RG |
428 | rotdelay="" |
429 | drivename=wd0 | |
430 | drivetype=wd | |
431 | sect_fwd="" | |
362925ff | 432 | echo |
43a91bf9 | 433 | echo "First, we need to know the drive type. This can be can be one of" |
21a421ff | 434 | echo "ESDI, SCSI, ST506, or IDE." |
362925ff AM |
435 | echo -n "Drive type? [${type:-IDE}] " |
436 | read resp junk | |
437 | type=${resp:-${type:-IDE}} | |
f078e99d | 438 | case "$type" in |
362925ff AM |
439 | e*|E*|st*|ST*) |
440 | echo -n "Does it support AUTOMATIC sector remapping? [y] " | |
441 | read remap junk | |
442 | case "$remap" in | |
443 | n*|N*) | |
444 | sect_fwd="sf:" | |
f078e99d | 445 | ;; |
362925ff AM |
446 | esac |
447 | case "$type" in | |
448 | e*|E*) | |
449 | DEFSECT=36 | |
21a421ff | 450 | ;; |
362925ff AM |
451 | esac |
452 | ;; | |
453 | i*|I*) | |
454 | type=ST506 | |
455 | rotdelay="-d 0" | |
456 | ;; | |
457 | sc*|SC*) | |
458 | drivename=sd0 | |
459 | drivetype=sd | |
460 | type=SCSI | |
461 | rotdelay="-d 0" | |
462 | DEFSECT=32 | |
463 | DEFHEAD=64 | |
464 | ;; | |
465 | *) | |
466 | echo "Unknown type. Assuming ST506 with automatic sectoring..." | |
467 | type=ST506 | |
468 | ;; | |
f078e99d | 469 | esac |
362925ff | 470 | echo |
43a91bf9 | 471 | echo "Disk is of device type $drivetype." |
362925ff AM |
472 | if [ ! "$partition" ]; then |
473 | echo | |
43a91bf9 | 474 | echo "Please wait. Examining device /dev/r${drivename}d..." |
362925ff AM |
475 | get_fdisk_data |
476 | if [ $? -gt 1 ]; then | |
477 | echo "Hm - we can't seem to read that drive." | |
478 | echo | |
479 | echo -n "Are you sure that $type is the correct type? [n] " | |
480 | read resp | |
481 | case "$resp" in | |
482 | y*|Y*) | |
10b607dd | 483 | echo |
362925ff AM |
484 | echo "Well, since we can't even open it, there isn't much" |
485 | echo "hope for writing a label on it. But you're free" | |
486 | echo "to give it a try. You need to specify the geometry." | |
487 | ;; | |
488 | *) | |
10b607dd | 489 | echo |
362925ff AM |
490 | echo "Okay. Let's start again from the top." |
491 | continue | |
492 | ;; | |
493 | esac | |
494 | fi | |
495 | fi | |
496 | echo | |
21a421ff AM |
497 | echo "Now we want to build a data base entry in /etc/disktab describing" |
498 | echo "the geometry of the /dev/$drivename disk. The name of the entry" | |
499 | echo "should be descriptive of the disk's type and model. For example," | |
500 | echo "a Maxtor IDE, model 7080 disk might be named \`maxtor7080'." | |
362925ff AM |
501 | echo -n "Disk label name (one word, please)? [${name:-mfr_model}] " |
502 | read resp junk | |
503 | name=${resp:-${name:-mfr_model}} | |
504 | echo | |
e72bf634 AM |
505 | echo "${OPSYSTEM} should use the same hard disk geometry as used by other" |
506 | echo "operating systems on the hard disk." | |
1f49206c AM |
507 | echo -n "Number of bytes per disk sector? [${bytes_per_sect:-512}] " |
508 | read resp junk | |
509 | bytes_per_sect=${resp:-${bytes_per_sect:-512}} | |
510 | echo | |
362925ff AM |
511 | echo -n "Total number of disk cylinders? [${cyls_per_disk:-${DEFCYLN}}] " |
512 | read resp junk | |
513 | cyls_per_disk=${resp:-${cyls_per_disk:-${DEFCYLN}}} | |
514 | echo | |
515 | echo -n "Number of disk heads (i.e., tracks/cylinder)? [${tracks_per_cyl:-${DEFHEAD}}] " | |
516 | read resp junk | |
517 | tracks_per_cyl=${resp:-${tracks_per_cyl:-${DEFHEAD}}} | |
518 | echo | |
519 | echo -n "Number of disk sectors (i.e., sectors/track)? [${sects_per_track:-${DEFSECT}}] " | |
520 | read resp junk | |
521 | sects_per_track=${resp:-${sects_per_track:-${DEFSECT}}} | |
f078e99d RG |
522 | cylindersize=`expr $sects_per_track \* $tracks_per_cyl` |
523 | disksize=`expr $cylindersize \* $cyls_per_disk` | |
21a421ff AM |
524 | mb_sect=`expr 1024 \* 1024 / $bytes_per_sect` |
525 | mb_per_disk=`expr $disksize / $mb_sect` | |
362925ff AM |
526 | opsys_cyls_min=`expr $DISKMIN \* $mb_sect / $cylindersize` |
527 | analyze_fdisk_data | |
528 | if [ $? -eq 0 ]; then | |
529 | partition=`expr $cyls_per_opsys \* $cylindersize` | |
530 | part_offset=`expr $opsys_off \* $cylindersize` | |
21a421ff | 531 | fi |
362925ff AM |
532 | echo |
533 | echo "Disk has a total of $mb_per_disk Mb." | |
534 | echo "The size of the ${OPSYSTEM} portion of the disk must be at least" | |
535 | echo "${opsys_cyls_min} cylinders, and should not exceed $(expr $cyls_per_disk - 1) cylinders." | |
536 | echo "The offset of ${OPSYSTEM} from the beginning of the disk should be at" | |
537 | echo "least 1 cylinder." | |
538 | echo | |
539 | echo "For efficiency, partitions begin and end on cylinder boundaries." | |
540 | echo "If you know the size NN in Megabytes (Mb) of a partition you want, then" | |
541 | echo "use the following formula to determine the number NC of cylinders to use:" | |
542 | echo " NC = integer { ( NN * $mb_sect ) / $cylindersize }" | |
543 | while :; do | |
544 | echo -n "Total size of the ${OPSYSTEM} portion of the disk (in cylinders)? [${cyls_per_opsys:-`expr ${cyls_per_disk} - 1`}] " | |
545 | read resp junk | |
546 | cyls_per_opsys=${resp:-${cyls_per_opsys:-`expr ${cyls_per_disk} - 1`}} | |
547 | partition=`expr $cyls_per_opsys \* $cylindersize` | |
548 | if [ $cyls_per_opsys -lt $cyls_per_disk -a ! "$force_offset" ]; then | |
549 | echo | |
550 | echo -n "Offset of ${OPSYSTEM} from beginning of disk (in cylinders)? [${opsys_off:-1}] " | |
551 | read resp junk | |
552 | opsys_off=${resp:-${opsys_off:-1}} | |
553 | else | |
554 | echo | |
1f49206c AM |
555 | echo " WARNING: Existing partitions will be lost. In addition," |
556 | echo " installing at cylinder 0 may cause problems for some disk" | |
557 | echo " controllers. If the filesystem is corrupted or install" | |
558 | echo " fails, install at cylinder 1." | |
362925ff AM |
559 | RUN_FDISK="" |
560 | cyls_per_opsys=$cyls_per_disk | |
561 | partition=$disksize | |
562 | opsys_off=0 | |
21a421ff | 563 | fi |
362925ff AM |
564 | part_offset=`expr $opsys_off \* $cylindersize` |
565 | opsys_extent=`expr $opsys_off + $cyls_per_opsys` | |
566 | if [ ${opsys_extent} -gt ${cyls_per_disk} ]; then | |
567 | echo | |
568 | echo "${OPSYSTEM} Size + Offset cannot exceed ${cyls_per_disk} cylinders." | |
569 | elif [ ${cyls_per_opsys} -lt ${opsys_cyls_min} ]; then | |
570 | echo | |
571 | echo "${OPSYSTEM} requires at least ${opsys_cyls_min} cylinders to install." | |
572 | else break | |
573 | fi | |
574 | done | |
f078e99d RG |
575 | badspacesec=0 |
576 | if [ "$sect_fwd" = "sf:" ]; then | |
577 | badspacecyl=`expr $sects_per_track + 126` | |
578 | badspacecyl=`expr $badspacecyl + $cylindersize - 1` | |
579 | badspacecyl=`expr $badspacecyl / $cylindersize` | |
580 | badspacesec=`expr $badspacecyl \* $cylindersize` | |
362925ff | 581 | echo |
f078e99d RG |
582 | echo -n "Using $badspacesec sectors ($badspacecyl cylinders) for the " |
583 | echo "bad144 bad block table" | |
584 | fi | |
585 | whats_left=`expr $partition - $badspacesec` | |
586 | cyl_left=`expr $whats_left / $cylindersize` | |
21a421ff | 587 | mb_left=`expr $whats_left / $mb_sect` |
362925ff AM |
588 | swap_cyls_min=`expr $SWAPMIN \* $mb_sect / $cylindersize` |
589 | root_cyls_max=`expr ${cyl_left} - ${swap_cyls_min}` | |
590 | root_cyls_min=`expr $ROOTMIN \* $mb_sect / $cylindersize` | |
591 | echo | |
592 | echo "There are $mb_left Mb ($cyl_left cylinders) to allocate." | |
593 | echo | |
594 | echo "The $OPSYSTEM portion of the disk must itself be divided into at least" | |
595 | echo "two partitions: one for the root filesystem and one for swap. It is a" | |
596 | echo "good idea to have at least a third (large) $OPSYSTEM partition for the /usr" | |
597 | echo "filesystem." | |
598 | echo | |
599 | echo "The root partition cannot exceed ${root_cyls_max} cylinders. It is usually" | |
600 | echo "no larger than about 15 Mb ($(expr 15 \* $mb_sect / $cylindersize) cylinders), and sometimes" | |
601 | echo "as small as $ROOTMIN Mb ($root_cyls_min cylinders)." | |
602 | if [ ! "$cyls_per_root" ]; then | |
603 | # set default root partition to 15MB | |
604 | cyls_per_root=`expr \( 15 \* $mb_sect \) / $cylindersize` | |
4c569b4c AM |
605 | usr_cyls_max=`expr ${root_cyls_max} - ${cyls_per_root}` |
606 | mb_usr=`expr ${usr_cyls_max} \* $cylindersize / $mb_sect` | |
607 | [ $cyls_per_root -gt $root_cyls_max -o $mb_usr -lt $USRMIN ] && | |
608 | cyls_per_root=$root_cyls_max | |
21a421ff | 609 | fi |
362925ff AM |
610 | while :; do |
611 | echo -n "Root partition size (in cylinders)? [${cyls_per_root}] " | |
612 | read resp junk | |
613 | cyls_per_root=${resp:-${cyls_per_root}} | |
614 | root=`expr $cyls_per_root \* $cylindersize` | |
615 | if [ ${cyls_per_root} -gt ${root_cyls_max} ]; then | |
616 | echo | |
617 | echo "The root partition size cannot exceed $root_cyls_max cylinders." | |
618 | elif [ ${cyls_per_root} -lt ${root_cyls_min} ]; then | |
619 | echo | |
620 | echo "The root partition size must be at least $root_cyls_min cylinders." | |
621 | else | |
622 | part_used=`expr $root + $badspacesec` | |
623 | break | |
21a421ff | 624 | fi |
f078e99d RG |
625 | done |
626 | root_offset=$part_offset | |
627 | whats_left=`expr $partition - $part_used` | |
21a421ff AM |
628 | cyl_left=`expr $whats_left / $cylindersize` |
629 | mb_left=`expr $whats_left / $mb_sect` | |
362925ff | 630 | echo |
0d255f16 RG |
631 | # DO NOT USE DIFFERENT BLOCKING FACTORS FOR EACH PARITION.. IT TRASHES THE |
632 | # VM SYSTEM! When that gets fixed this can go back the way it was... | |
633 | # | |
634 | echo "We can build the filesystems with block/fragment sizes of either" | |
21a421ff AM |
635 | echo " 1) 4k/512, to save disk space at the expense of speed, or" |
636 | echo " 2) 8k/1k for speed at the expense of disk space." | |
0d255f16 | 637 | echo -n "Which blocking factor should we use for the filesystems? " |
362925ff AM |
638 | echo -n "[${blocking_factor:-${DEFBLOCKING}}] " |
639 | read resp junk | |
640 | blocking_factor=${resp:-${blocking_factor:-${DEFBLOCKING}}} | |
21a421ff AM |
641 | fragsize=`expr $bytes_per_sect \* $blocking_factor` |
642 | blocksize=`expr $bytes_per_sect \* $blocking_factor \* 8` | |
362925ff | 643 | echo |
43a91bf9 | 644 | echo "$mb_left Mb ($cyl_left cylinders) remaining in ${OPSYSTEM} portion of disk." |
362925ff AM |
645 | echo |
646 | echo "Minimum swap space is ${swap_cyls_min} cylinders." | |
647 | echo "For running X, if your RAM size is NR Mb, then the recomended swap" | |
648 | echo "size NS (in cylinders) is:" | |
649 | echo " NS = integer { ( NR x `expr 21 \* $mb_sect / 10` ) / ${cylindersize} }" | |
650 | if [ ! "$swap_cyl" ]; then | |
21a421ff AM |
651 | # guess memory size |
652 | mb_ram=16 | |
362925ff AM |
653 | swap_cyl=`expr \( 21 \* $mb_ram \* $mb_sect \) / 10` |
654 | swap_cyl=`expr $swap_cyl / ${cylindersize}` | |
21a421ff AM |
655 | |
656 | # but not swap size more than 10% of disk size... | |
657 | swap_quot=`expr $mb_left / $mb_ram` | |
658 | if [ $swap_quot -lt 10 ]; then | |
362925ff | 659 | swap_cyl=$swap_cyls_min |
21a421ff | 660 | fi |
362925ff AM |
661 | fi |
662 | while :; do | |
663 | echo -n "Swap partition size (in cylinders)? [${swap_cyl}] " | |
664 | read resp junk | |
665 | swap_cyl=${resp:-${swap_cyl}} | |
666 | swap=`expr $swap_cyl \* $cylindersize` | |
667 | if [ ${swap_cyl} -gt ${cyl_left} ]; then | |
668 | echo | |
669 | echo "Swap size cannot exceed $cyl_left cylinders." | |
670 | elif [ ${swap_cyl} -lt ${swap_cyls_min} ]; then | |
671 | echo | |
672 | echo "Swap size must be at least ${swap_cyls_min} cylinders." | |
673 | else | |
674 | break | |
21a421ff | 675 | fi |
f078e99d | 676 | done |
362925ff | 677 | echo |
f078e99d RG |
678 | swap_offset=`expr $root_offset + $root` |
679 | part_used=`expr $part_used + $swap` | |
43a91bf9 RG |
680 | echo "" >/etc/disktab |
681 | echo "$name|${OPSYSTEM} installation generated:\\" >>/etc/disktab | |
682 | echo " :dt=${type}:ty=winchester:\\" >>/etc/disktab | |
f078e99d | 683 | echo -n " :nc#${cyls_per_disk}:ns#${sects_per_track}" >>/etc/disktab |
43a91bf9 RG |
684 | echo ":nt#${tracks_per_cyl}:\\" >>/etc/disktab |
685 | echo " :se#${bytes_per_sect}:${sect_fwd}\\" >>/etc/disktab | |
f078e99d | 686 | echo -n " :pa#${root}:oa#${root_offset}" >>/etc/disktab |
43a91bf9 RG |
687 | echo ":ta=4.2BSD:ba#${blocksize}:fa#${fragsize}:\\" >>/etc/disktab |
688 | echo " :pb#${swap}:ob#${swap_offset}:tb=swap:\\" >>/etc/disktab | |
689 | echo " :pc#${partition}:oc#${part_offset}:\\" >>/etc/disktab | |
f078e99d | 690 | ename="";fname="";gname="";hname="" |
362925ff AM |
691 | if [ $part_used -lt $partition ]; then |
692 | echo | |
693 | echo "Now we enter information about any other partitions and filesystems" | |
694 | echo "to be created in the ${OPSYSTEM} portion of the disk. This process" | |
695 | echo "is complete when we've filled up all remaining space in the ${OPSYSTEM}" | |
696 | echo "portion of the disk." | |
697 | fi | |
f078e99d RG |
698 | while [ $part_used -lt $partition ]; do |
699 | part_size=0 | |
700 | whats_left=`expr $partition - $part_used` | |
21a421ff AM |
701 | cyl_left=`expr $whats_left / $cylindersize` |
702 | mb_left=`expr $whats_left / $mb_sect` | |
362925ff | 703 | echo |
43a91bf9 | 704 | echo "$mb_left Mb ($cyl_left cylinders) remaining in ${OPSYSTEM} portion of disk." |
362925ff AM |
705 | echo |
706 | while :; do | |
21a421ff | 707 | echo -n "Next partition size (in cylinders)? [${cyl_left}] " |
362925ff AM |
708 | read resp junk |
709 | part_size=${resp:-${cyl_left}} | |
710 | part_size=`expr $part_size \* $cylindersize` | |
711 | total=`expr $part_used + $part_size` | |
712 | if [ $total -gt $partition ]; then | |
713 | echo | |
714 | echo "Partition size cannot exceed ${cyl_left} cylinders." | |
715 | else | |
716 | part_used=$total | |
717 | part_name="" | |
718 | while [ "$part_name" = "" ]; do | |
719 | echo | |
720 | echo -n "On which directory should this filesystem be mounted? [usr] " | |
721 | read resp junk | |
722 | part_name=${resp:-usr} | |
723 | part_name=`expr "$part_name" : '/*\(.*\)'` | |
724 | done | |
725 | break | |
21a421ff | 726 | fi |
f078e99d | 727 | done |
362925ff AM |
728 | echo |
729 | if [ ! "$ename" ]; then | |
f078e99d RG |
730 | ename=$part_name |
731 | offset=`expr $part_offset + $root + $swap` | |
732 | echo -n " :pe#${part_size}:oe#${offset}" >>/etc/disktab | |
733 | echo ":te=4.2BSD:be#${blocksize}:fe#${fragsize}:\\" >>/etc/disktab | |
734 | offset=`expr $offset + $part_size` | |
362925ff | 735 | elif [ ! "$fname" ]; then |
f078e99d RG |
736 | fname=$part_name |
737 | echo -n " :pf#${part_size}:of#${offset}" >>/etc/disktab | |
738 | echo ":tf=4.2BSD:bf#${blocksize}:ff#${fragsize}:\\" >>/etc/disktab | |
739 | offset=`expr $offset + $part_size` | |
362925ff | 740 | elif [ ! "$gname" ]; then |
f078e99d RG |
741 | gname=$part_name |
742 | echo -n " :pg#${part_size}:og#${offset}" >>/etc/disktab | |
743 | echo ":tg=4.2BSD:bg#${blocksize}:fg#${fragsize}:\\" >>/etc/disktab | |
744 | offset=`expr $offset + $part_size` | |
362925ff | 745 | elif [ ! "$hname" ]; then |
f078e99d RG |
746 | hname=$part_name |
747 | echo -n " :ph#${part_size}:oh#${offset}" >>/etc/disktab | |
748 | echo ":th=4.2BSD:bh#${blocksize}:fh#${fragsize}:\\" >>/etc/disktab | |
749 | part_used=partition | |
750 | fi | |
751 | done | |
4c569b4c AM |
752 | if [ "$have_dos_part" -a ! "$hname" ]; then |
753 | part_name="" | |
754 | echo "There appears to be a MS-DOS filesystem on disk." | |
755 | while [ "$part_name" = "" ]; do | |
756 | echo -n "On which directory should this filesystem be mounted? [dos] " | |
757 | read resp junk | |
758 | part_name=${resp:-dos} | |
759 | part_name=`expr "$part_name" : '/*\(.*\)'` | |
760 | done | |
761 | hname=$part_name | |
762 | eval offset=\$start${have_dos_part} | |
763 | eval part_size=\$size${have_dos_part} | |
764 | echo -n " :ph#${part_size}:oh#${offset}" >>/etc/disktab | |
765 | echo ":th=MSDOS:\\" >>/etc/disktab | |
766 | part_used=partition | |
767 | else | |
768 | have_dos_part="" | |
769 | fi | |
43a91bf9 | 770 | echo " :pd#${disksize}:od#0:" >>/etc/disktab |
f078e99d RG |
771 | sync |
772 | ||
362925ff AM |
773 | # cat /etc/disktab |
774 | OIFS=$IFS | |
775 | IFS=' | |
776 | ' | |
777 | while read data; do | |
778 | echo $data | |
779 | done < /etc/disktab | |
780 | IFS=$OIFS | |
781 | ||
782 | echo | |
8231ed99 RG |
783 | echo -n "Verbose installation? [n] " |
784 | read resp | |
785 | ||
786 | case $resp in | |
362925ff AM |
787 | y*) |
788 | cpioverbose=v | |
789 | ;; | |
790 | *) | |
791 | cpioverbose= | |
792 | ;; | |
8231ed99 RG |
793 | esac |
794 | ||
362925ff AM |
795 | |
796 | echo | |
43a91bf9 | 797 | echo "OK! THIS IS THE LAST CHANCE!!! Data on the hard disk wil be lost." |
21a421ff | 798 | echo -n "Are you sure you want to install on the hard drive? (yes/no) " |
362925ff AM |
799 | resp="" |
800 | while [ ! "$resp" ]; do | |
801 | read resp junk | |
802 | case "$resp" in | |
803 | Yes|yes|YES) | |
804 | verified_install=1 | |
805 | echo | |
43a91bf9 | 806 | echo "OK! Here we go..." |
362925ff AM |
807 | ;; |
808 | No|no|NO) | |
809 | echo | |
810 | echo -n "Would you like to change the configuration? [y] " | |
811 | read resp junk | |
812 | resp=${resp:-y} | |
813 | case "$resp" in | |
814 | y*|Y*) | |
f078e99d RG |
815 | ;; |
816 | *) | |
362925ff | 817 | echo |
43a91bf9 RG |
818 | echo "OK, then. Enter 'halt' to halt the machine." |
819 | echo "Once the machine has halted, remove the floppy," | |
820 | echo "and press any key to reboot." | |
362925ff | 821 | exit |
f078e99d | 822 | ;; |
362925ff AM |
823 | esac |
824 | ;; | |
825 | *) | |
826 | echo "Please spell out either of \`yes' or \`no'..." | |
827 | echo -n "Install on the hard disk? (yes/no) " | |
828 | resp= | |
829 | ;; | |
f078e99d RG |
830 | esac |
831 | done | |
ede9f473 AM |
832 | done # End of Big Loop |
833 | ||
362925ff AM |
834 | put_fdisk_data |
835 | ||
836 | echo | |
f078e99d | 837 | echo -n "Labelling disk..." |
362925ff AM |
838 | echo y | |
839 | /sbin/disklabel -w -r ${drivename} $name /usr/mdec/${drivetype}boot /usr/mdec/boot${drivetype} >/dev/null 2>&1 | |
43a91bf9 | 840 | echo " done." |
f078e99d RG |
841 | |
842 | if [ "$sect_fwd" = "sf:" ]; then | |
843 | echo -n "Initializing bad144 badblock table..." | |
844 | bad144 $drivename 0 | |
845 | echo " done." | |
362925ff AM |
846 | echo "Updating badblock table..." |
847 | # `2>&1 >/dev/null' filters stdout and leaves only stderr... | |
1f49206c | 848 | badlist=$(bad144 -s $drivename 2>&1 >/dev/null | |
362925ff | 849 | while read data; do |
1f49206c AM |
850 | bad_seek=$(expr "$data" : '[^(]*(seek)[^0-9]*\([0-9]*\)') |
851 | bad_read=$(expr "$data" : '[^(]*(read)[^0-9]*\([0-9]*\)') | |
362925ff | 852 | [ "$bad_seek" -o "$bad_read" ] && echo -n "$bad_seek $bad_read " |
1f49206c AM |
853 | done) |
854 | [ "$badlist" ] && bad144 -a -c $drivename "$badlist" | |
362925ff | 855 | echo " done." |
f078e99d RG |
856 | fi |
857 | ||
43a91bf9 | 858 | echo "Initializing root filesystem, and mounting..." |
c5bc0e81 | 859 | newfs ${rotdelay} /dev/r${drivename}a $name |
f078e99d RG |
860 | mount -v /dev/${drivename}a /mnt |
861 | if [ "$ename" != "" ]; then | |
362925ff | 862 | echo |
43a91bf9 | 863 | echo "Initializing $ename filesystem, and mounting..." |
c5bc0e81 | 864 | newfs ${rotdelay} /dev/r${drivename}e $name |
f078e99d RG |
865 | mkdir -p /mnt/$ename |
866 | mount -v /dev/${drivename}e /mnt/$ename | |
867 | fi | |
868 | if [ "$fname" != "" ]; then | |
362925ff | 869 | echo |
43a91bf9 | 870 | echo "Initializing $fname filesystem, and mounting..." |
c5bc0e81 | 871 | newfs ${rotdelay} /dev/r${drivename}f $name |
f078e99d RG |
872 | mkdir -p /mnt/$fname |
873 | mount -v /dev/${drivename}f /mnt/$fname | |
874 | fi | |
875 | if [ "$gname" != "" ]; then | |
362925ff | 876 | echo |
43a91bf9 | 877 | echo "Initializing $gname filesystem, and mounting..." |
c5bc0e81 | 878 | newfs ${rotdelay} /dev/r${drivename}g $name |
f078e99d RG |
879 | mkdir -p /mnt/$gname |
880 | mount -v /dev/${drivename}g /mnt/$gname | |
881 | fi | |
882 | if [ "$hname" != "" ]; then | |
362925ff | 883 | echo |
4c569b4c AM |
884 | if [ ! "$have_dos_part" ]; then |
885 | echo "Initializing $hname filesystem, and mounting..." | |
886 | newfs ${rotdelay} /dev/r${drivename}h $name | |
887 | else | |
888 | echo "Initializing $hname filesystem..." | |
889 | fi | |
f078e99d | 890 | mkdir -p /mnt/$hname |
4c569b4c | 891 | [ ! "$have_dos_part" ] && |
f078e99d RG |
892 | mount -v /dev/${drivename}h /mnt/$hname |
893 | fi | |
894 | ||
8231ed99 | 895 | echo |
362925ff | 896 | echo "Please wait. Copying to disk..." |
f078e99d | 897 | cd / |
362925ff AM |
898 | # cat filelist | cpio -pdamu${cpioverbose} /mnt |
899 | OIFS=$IFS | |
900 | IFS=' | |
901 | ' | |
902 | while read data; do | |
903 | echo $data | |
904 | done <filelist | cpio -pdamu${cpioverbose} /mnt | |
905 | IFS=$OIFS | |
f078e99d RG |
906 | |
907 | cd /mnt | |
c5bc0e81 | 908 | echo "/dev/${drivename}a / ufs rw 1 1" >etc/fstab |
f078e99d | 909 | if [ "$ename" != "" ]; then |
c5bc0e81 | 910 | echo "/dev/${drivename}e /$ename ufs rw 1 2" >>etc/fstab |
f078e99d RG |
911 | fi |
912 | if [ "$fname" != "" ]; then | |
c5bc0e81 | 913 | echo "/dev/${drivename}f /$fname ufs rw 1 3" >>etc/fstab |
f078e99d RG |
914 | fi |
915 | if [ "$gname" != "" ]; then | |
c5bc0e81 | 916 | echo "/dev/${drivename}g /$gname ufs rw 1 4" >>etc/fstab |
f078e99d RG |
917 | fi |
918 | if [ "$hname" != "" ]; then | |
4c569b4c AM |
919 | if [ ! "$have_dos_part" ]; then |
920 | echo "/dev/${drivename}h /$hname ufs rw 1 5" >>etc/fstab | |
921 | else | |
922 | echo "/dev/${drivename}h /$hname pcfs rw" >>etc/fstab | |
923 | fi | |
f078e99d RG |
924 | fi |
925 | ||
362925ff AM |
926 | # cat /etc/disktab >etc/disktab.install |
927 | OIFS=$IFS | |
928 | IFS=' | |
929 | ' | |
930 | while read data; do | |
931 | echo $data | |
932 | done </etc/disktab >etc/disktab.install | |
933 | IFS=$OIFS | |
0d255f16 | 934 | |
362925ff AM |
935 | # cat << EOF >.profile |
936 | ( | |
86d10fc7 | 937 | echo "PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/distbin:.:" |
362925ff AM |
938 | echo "export PATH" |
939 | echo "HOME=/root" | |
940 | echo "export HOME" | |
941 | echo "TERM=pc3" | |
942 | echo "export TERM" | |
943 | echo "mount -at ufs" | |
944 | echo "echo" | |
a8a6c1e9 | 945 | echo "echo \"Insert cpio installation floppy in drive and\"" |
43a91bf9 | 946 | echo "echo -n \"enter that drive's number (e.g. 0 or 1): [0] \"" |
362925ff AM |
947 | echo "read resp junk" |
948 | echo "driveno=\${resp:-0}" | |
949 | echo "mount -o ro /dev/fd\${driveno}a /mnt" | |
950 | echo "cd /mnt" | |
951 | echo "install" | |
730f2c4e AM |
952 | echo "cd /" |
953 | echo "umount /mnt >/dev/null 2>&1" | |
954 | echo "echo" | |
83dff685 | 955 | echo "echo -n \"Install optional dos floppy? [n] \"" |
730f2c4e | 956 | echo "read resp junk" |
83dff685 | 957 | echo "case \"\$resp\" in" |
53c2fade | 958 | echo "y*|Y*)" |
83dff685 | 959 | echo " echo" |
4f65640a AM |
960 | echo " echo \"Remove cpio installation floppy from drive.\"" |
961 | echo " echo \"Insert third installation (dos) floppy and\"" | |
83dff685 AM |
962 | echo " echo -n \"enter that drive's number (e.g. 0 or 1): [0] \"" |
963 | echo " read resp junk" | |
964 | echo " driveno=\${resp:-0}" | |
965 | echo " mount -t pcfs -o ro /dev/fd\${driveno}a /mnt" | |
966 | echo " mkdir -p /usr/distbin" | |
5ae4c83e | 967 | echo " cp /mnt/* /usr/distbin/ >/dev/null 2>&1" |
83dff685 AM |
968 | echo " sync" |
969 | echo " umount /mnt >/dev/null 2>&1" | |
970 | echo " ;;" | |
971 | echo "esac" | |
730f2c4e | 972 | echo "echo" |
43a91bf9 | 973 | echo "echo \"OK. All of the base files are installed.\"" |
730f2c4e | 974 | echo "echo" |
43a91bf9 RG |
975 | echo "echo \"The next step: reboot from the hard disk, and follow\"" |
976 | echo "echo \"more instrutctions.\"" | |
730f2c4e | 977 | echo "echo" |
43a91bf9 | 978 | echo "echo \"To do this, enter 'halt' at the prompt to halt the machine.\"" |
730f2c4e AM |
979 | echo "echo \"Once the machine has halted, remove the floppy from the disk\"" |
980 | echo "echo \"drive, and hit any key to reboot from the hard disk.\"" | |
362925ff | 981 | ) >.profile |
f078e99d RG |
982 | |
983 | sync | |
984 | ||
362925ff | 985 | echo |
43a91bf9 RG |
986 | echo "The next step: reboot from the kernel-copy disk, copy a kernel" |
987 | echo "to the hard disk, and finally reboot from the hard disk." | |
362925ff | 988 | echo |
43a91bf9 | 989 | echo "To do this, enter 'halt' now to halt the machine. After it" |
21a421ff AM |
990 | echo "announces that it has halted, remove the floppy from the drive" |
991 | echo "and insert the kernel-copy disk that was booted before." | |
730f2c4e AM |
992 | echo "Press any key to reboot. When prompted to insert the filesystem" |
993 | echo "floppy this time, just hit RETURN without changing floppies." | |
362925ff AM |
994 | echo |
995 | echo "If all goes well, you can enter the command \`copy' at the prompt to" | |
996 | echo "copy the kernel to the hard disk. When asked for which partition to" | |
997 | echo "copy to, enter to \`${drivename}a' (without the quotes)." | |
998 | echo | |
21a421ff | 999 | echo "Okay, that's all for now. I'm waiting for you to enter \`halt'..." |