aboutsummaryrefslogtreecommitdiffstats
path: root/release/bininst
blob: 1de2dee1eb33cf4026164ec5fa99025da656ce5c (plain) (blame)
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/stand/sh
#
# bininst - perform the last stage of installation by somehow getting
# a bindist onto the user's disk and unpacking it.  The name bininst
# is actually something of a misnomer, since this utility will install
# more than just the bindist set.
#
# November 11th, 1994
# Copyright (C) 1994 by Jordan K. Hubbard
#
# Permission to copy or use this software for any purpose is granted
# provided that this message stay intact, and at this location (no putting
# your name on top after doing something trivial like reindenting it, just
# to make it look like you wrote it!).
#
DIALOG=${DIALOG=/usr/bin/dialog}

set_defaults() {
	media_type="" ;
	media_device="" ;
	inst_dir="/usr/tmp" ;
}

handle_rval() {
	case $1 in
	0)
		return 0
	;;
	255)
		echo "User aborted installation, invoking shell.";
		exec /stand/sh
	;;
	*)
		return 1
	;;
	esac
}

not_supported() {
	$DIALOG --title "Sorry!" \
        --msgbox "This feature is not supported in the current version of the \
installation tools but will be in the release, barring \
some sort of fatal accident.  Please press RETURN to go on." 10 60
}

welcome() {
	$DIALOG --title "Welcome to FreeBSD" --clear \
--msgbox "Hi!  Nice to see you've made it this far.  We're now ready to
install one or more packed distribution sets onto your machine.  At
the minimum, you need a bindist installation. A secrdist is also useful
if you want your system to have any kind of effective security.
The secrdist is a bit of a special case since it cannot be legally
obtained from the U.S. due to export restrictions, but non-U.S.
versions are also available.  See the release notes for more information
on where to obtain a secrdist for your part of the world.  In the menus
and dialogs that follow, you may use your arrow keys to move up and down,
as well as your PageUp and PageDown keys to scroll.  If you wish to abort
while in a dialog, hit ESC twice." 15 77
	if ! handle_rval $?; then return 1; fi
}

choose_media() {
	while [ "$media_device" = "" ]; do

	$DIALOG --clear --title "Chose installation media" \
--menu "Before we begin the installation, we need to chose and possibly \n\
configure your method of installation.  Please pick from one of \n\
the following options.  If your option isn't listed here, your \n\
best bet may be to simply select CANCEL to get a shell and proceed \n\
manually on your own. \n\n\
	Please choose one of the following:" 20 70 5 \
	"Tape" "Load installation from SCSI or QIC tape" \
	"CDROM" "Load installation from SCSI or Mitsumi CDROM" \
        "DOS" "Load from DOS floppies or a DOS hard disk partition" \
        "FTP" "Load the distribution over ftp" \
        "NFS" "Load the distribution over NFS" 2> /tmp/menu.tmp.$$

	retval=$?
	choice=`cat /tmp/menu.tmp.$$`
	rm -f /tmp/menu.tmp.$$
	if ! handle_rval $retval; then return 1; fi

	case $choice in
	Tape)
		$DIALOG --clear --title "Chose tape type" \
--menu "Which type of tape drive do you have attached to your \n\
system?  FreeBSD supports the following types:\n\n\
		Choose one of the following:" 20 70 2 \
		"SCSI" "SCSI tape drive attached to standard SCSI controller" \
		"QIC" "QIC tape drive (Colorado Jumbo, etc)" \
			2> /tmp/menu.tmp.$$
		retval=$?
		choice=`cat /tmp/menu.tmp.$$`
		rm -f /tmp/menu.tmp.$$
		if ! handle_rval $retval; then continue; fi
		media_type=tape;
		case $choice in
			SCSI)
				media_device=/dev/rst0
			;;
			QIC)
				media_device=/dev/rwt0
			;;
		esac
	;;
	CDROM)
		not_supported
	;;
	DOS)
		not_supported
	;;
	FTP)
		$DIALOG --title "FTP Installation Information" --clear \
--inputbox "Please specify the machine and directory location of the
distribution you wish to load.  This should be a \"URL style\"
specification (e.g. something like ftp://ftp.freeBSD.org/pub/...)\n\n" \
16 70 'ftp://ftp.freebsd.org/pub/FreeBSD/2.0-ALPHA/bindist/' 2> /tmp/inputbox.tmp.$$
		if ! handle_rval $?; then continue; fi
		media_type=ftp
		media_device=`cat /tmp/inputbox.tmp.$$`
	;;
	NFS)
		not_supported
	;;
	esac
	done
}

install_set()
{
	echo Installing from $media_type on $media_device
}

welcome

while :; do
	if choose_media; then
		install_set
	else
		echo "Exiting per user request.";
		exit 0;
	fi
done