]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - usr.sbin/sysinstall/globals.c
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / usr.sbin / sysinstall / globals.c
1 /*
2  * The new sysinstall program.
3  *
4  * This is probably the last program in the `sysinstall' line - the next
5  * generation being essentially a complete rewrite.
6  *
7  * $FreeBSD$
8  *
9  * Copyright (c) 1995
10  *      Jordan Hubbard.  All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions and the following disclaimer,
17  *    verbatim and that no modifications are made prior to this
18  *    point in the file.
19  * 2. Redistributions in binary form must reproduce the above copyright
20  *    notice, this list of conditions and the following disclaimer in the
21  *    documentation and/or other materials provided with the distribution.
22  *
23  * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED.  IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
27  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29  * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33  * SUCH DAMAGE.
34  *
35  */
36
37 #include "sysinstall.h"
38
39 /*
40  * Various global variables and an initialization hook to set them to
41  * whatever values we feel are appropriate.
42  */
43
44 int             DebugFD;        /* Where diagnostic output goes */
45 Boolean         Fake;           /* Only pretend to be useful */
46 Boolean         RunningAsInit;  /* Are we running as init? */
47 Boolean         DialogActive;   /* Is libdialog initialized? */
48 Boolean         ColorDisplay;   /* Are we on a color display? */
49 Boolean         OnVTY;          /* Are we on a VTY? */
50 Boolean         Restarting;     /* Are we restarting sysinstall? */
51 Boolean         have_volumes;   /* Media has more than one volume. */
52 Variable        *VarHead;       /* The head of the variable chain */
53 Device          *mediaDevice;   /* Where we're installing from */
54 int             BootMgr;        /* Which boot manager we're using */
55 int             StatusLine;     /* Where to stick our status messages */
56 int             low_volume;     /* Lowest volume number */
57 int             high_volume;    /* Highest volume number */
58 jmp_buf         BailOut;        /* Beam me up, scotty! The natives are pissed! */
59
60 Chunk           *HomeChunk;
61 Chunk           *RootChunk;
62 Chunk           *SwapChunk;
63 Chunk           *TmpChunk;
64 Chunk           *UsrChunk;
65 Chunk           *VarChunk;
66 #ifdef __ia64__
67 Chunk           *EfiChunk;
68 #endif
69
70 /*
71  * Yes, I know some of these are already automatically initialized as
72  * globals.  I simply find it clearer to set everything explicitly.
73  */
74 void
75 globalsInit(void)
76 {
77     DebugFD = -1;
78     ColorDisplay = FALSE;
79     OnVTY = FALSE;
80     DialogActive = FALSE;
81     VarHead = NULL;
82     mediaDevice = NULL;
83
84     HomeChunk = NULL;
85     RootChunk = NULL;
86     SwapChunk = NULL;
87     TmpChunk = NULL;
88     UsrChunk = NULL;
89     VarChunk = NULL;
90 #ifdef __ia64__
91     EfiChunk = NULL;
92 #endif
93 }