Annotation of src/distrib/utils/sysinst/install.c, Revision 1.38
1.38 ! dsl 1: /* $NetBSD: install.c,v 1.37 2003/07/25 08:26:21 dsl Exp $ */
1.1 phil 2:
3: /*
4: * Copyright 1997 Piermont Information Systems Inc.
5: * All rights reserved.
6: *
7: * Written by Philip A. Nelson for Piermont Information Systems Inc.
8: *
9: * Redistribution and use in source and binary forms, with or without
10: * modification, are permitted provided that the following conditions
11: * are met:
12: * 1. Redistributions of source code must retain the above copyright
13: * notice, this list of conditions and the following disclaimer.
14: * 2. Redistributions in binary form must reproduce the above copyright
15: * notice, this list of conditions and the following disclaimer in the
16: * documentation and/or other materials provided with the distribution.
17: * 3. All advertising materials mentioning features or use of this software
18: * must display the following acknowledgement:
1.17 cgd 19: * This product includes software developed for the NetBSD Project by
1.1 phil 20: * Piermont Information Systems Inc.
21: * 4. The name of Piermont Information Systems Inc. may not be used to endorse
22: * or promote products derived from this software without specific prior
23: * written permission.
24: *
25: * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
26: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28: * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
29: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
35: * THE POSSIBILITY OF SUCH DAMAGE.
36: *
37: */
38:
39: /* install.c -- system installation. */
40:
41: #include <stdio.h>
42: #include <curses.h>
43: #include "defs.h"
44: #include "msg_defs.h"
45: #include "menu_defs.h"
46:
47: /* Do the system install. */
48:
1.12 mrg 49: void
1.34 dsl 50: do_install(void)
1.1 phil 51: {
52:
1.12 mrg 53: msg_display(MSG_installusure);
1.31 dsl 54: process_menu(MENU_noyes, NULL);
1.14 bouyer 55: if (!yesno)
56: return;
1.3 phil 57:
58: get_ramsize();
1.32 dsl 59:
1.36 dsl 60: if (find_disks(msg_string(MSG_install)) < 0)
1.1 phil 61: return;
1.22 fvdl 62:
1.33 dsl 63: if (check_swap(diskdev, 0) > 0) {
1.22 fvdl 64: msg_display(MSG_swapactive);
1.31 dsl 65: process_menu(MENU_ok, NULL);
1.33 dsl 66: if (check_swap(diskdev, 1) < 0) {
1.22 fvdl 67: msg_display(MSG_swapdelfailed);
1.31 dsl 68: process_menu(MENU_ok, NULL);
1.35 dsl 69: if (!debug)
70: return;
1.22 fvdl 71: }
72: }
1.35 dsl 73:
74: process_menu(MENU_distset, NULL);
1.1 phil 75:
1.12 mrg 76: if (!md_get_info()) {
77: msg_display(MSG_abort);
1.31 dsl 78: process_menu(MENU_ok, NULL);
1.4 phil 79: return;
80: }
1.1 phil 81:
1.12 mrg 82: if (md_make_bsd_partitions() == 0) {
1.10 jonathan 83: msg_display(MSG_abort);
1.31 dsl 84: process_menu(MENU_ok, NULL);
1.10 jonathan 85: return;
86: }
1.1 phil 87:
88: /* Last chance ... do you really want to do this? */
1.13 garbled 89: clear();
90: refresh();
1.21 hubertf 91: msg_display(MSG_lastchance, diskdev);
1.31 dsl 92: process_menu(MENU_noyes, NULL);
1.1 phil 93: if (!yesno)
94: return;
95:
1.14 bouyer 96: if (md_pre_disklabel() != 0)
97: return;
1.1 phil 98:
1.14 bouyer 99: if (write_disklabel() != 0)
100: return;
1.1 phil 101:
1.14 bouyer 102: if (md_post_disklabel() != 0)
103: return;
1.1 phil 104:
1.14 bouyer 105: if (make_filesystems())
106: return;
1.1 phil 107:
1.14 bouyer 108: if (md_copy_filesystem() != 0)
109: return;
1.1 phil 110:
1.14 bouyer 111: if (make_fstab() != 0)
112: return;
1.1 phil 113:
1.14 bouyer 114: if (md_post_newfs() != 0)
115: return;
1.1 phil 116:
117: /* Done to here. */
1.13 garbled 118: msg_display(MSG_disksetupdone);
1.7 jonathan 119:
1.1 phil 120: getchar();
1.27 jdc 121: wrefresh(curscr);
1.25 jdc 122: wmove(stdscr,0, 0);
1.16 bouyer 123: wclear(stdscr);
1.1 phil 124: wrefresh(stdscr);
125:
1.6 jonathan 126: /* Unpack the distribution. */
1.23 fvdl 127: if (get_and_unpack_sets(MSG_extractcomplete, MSG_abortinst) != 0)
1.19 cgd 128: return;
1.8 jonathan 129:
1.20 hubertf 130: set_timezone();
1.28 ad 131:
132: set_crypt_type();
1.23 fvdl 133:
134: set_root_password();
1.29 grant 135: set_root_shell();
1.20 hubertf 136:
1.8 jonathan 137: sanity_check();
1.11 fvdl 138:
139: md_cleanup_install();
1.24 fvdl 140:
141: msg_display(MSG_instcomplete);
1.31 dsl 142: process_menu(MENU_ok, NULL);
1.1 phil 143: }
CVSweb <webmaster@jp.NetBSD.org>