xref: /plan9/sys/lib/dist/pc/inst/stop (revision 3ff48bf5ed603850fcd251ddf13025d23d693782)
1#!/bin/rc
2
3# desc: save the current installation state, to be resumed later
4# prereq:
5# mustdo:
6
7switch($1) {
8case checkdone
9	stop=notdone
10	export stop
11
12case checkready
13	if(~ $cdboot yes){
14		stop=notdone
15		export stop
16	}
17
18case go
19	coherence
20	switch($2){
21	case finished
22		echo 'We need to write the state of the current installation to the install floppy,'
23		echo 'so that you can pick up from here if, for example, you want to set up'
24		echo 'more boot methods.'
25		echo
26	case *
27		echo 'We need to write the state of the current installation to the install floppy.'
28		echo 'so that you can pick up from here when you wish to continue.'
29		echo
30	}
31	echo -n 'Please make sure the install floppy is in the floppy drive and press enter.'
32	read >/dev/null >[2]/dev/null
33
34	if(! a:) {
35		echo 'Couldn''t mount the floppy disk; sorry.'
36		exit
37	}
38
39	if(cp /tmp/vars /n/a:/9inst.cnf || cp /tmp/vars /n/a:/9inst.cnf) {
40		echo 'Your install state has been saved to the install floppy.'
41		if(~ $2 finished){
42			echo
43			echo 'Congratulations; you''ve completed the install.'
44		}
45		echo
46		halt
47	}
48
49	echo 'Couldn''t save the state to your install floppy.  Sorry.'
50}
51