18097Sjkh/*
28097Sjkh * The new sysinstall program.
38097Sjkh *
48097Sjkh * This is probably the last program in the `sysinstall' line - the next
58097Sjkh * generation being essentially a complete rewrite.
68097Sjkh *
750479Speter * $FreeBSD$
88097Sjkh *
98097Sjkh * Copyright (c) 1995
108097Sjkh *	Jordan Hubbard.  All rights reserved.
118097Sjkh *
128097Sjkh * Redistribution and use in source and binary forms, with or without
138097Sjkh * modification, are permitted provided that the following conditions
148097Sjkh * are met:
158097Sjkh * 1. Redistributions of source code must retain the above copyright
168881Srgrimes *    notice, this list of conditions and the following disclaimer,
178881Srgrimes *    verbatim and that no modifications are made prior to this
188097Sjkh *    point in the file.
198097Sjkh * 2. Redistributions in binary form must reproduce the above copyright
208097Sjkh *    notice, this list of conditions and the following disclaimer in the
218097Sjkh *    documentation and/or other materials provided with the distribution.
228097Sjkh *
238097Sjkh * THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
248097Sjkh * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
258097Sjkh * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
268097Sjkh * ARE DISCLAIMED.  IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE
278097Sjkh * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
288097Sjkh * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
298097Sjkh * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION)
308097Sjkh * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
318097Sjkh * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
328097Sjkh * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
338097Sjkh * SUCH DAMAGE.
348097Sjkh *
358097Sjkh */
368097Sjkh
378097Sjkh#include "sysinstall.h"
388097Sjkh
398097Sjkh/*
408097Sjkh * Various global variables and an initialization hook to set them to
418097Sjkh * whatever values we feel are appropriate.
428097Sjkh */
438097Sjkh
4415439Sjkhint		DebugFD;	/* Where diagnostic output goes */
4515439SjkhBoolean		Fake;		/* Only pretend to be useful */
468735SjkhBoolean		RunningAsInit;	/* Are we running as init? */
4715439SjkhBoolean		DialogActive;	/* Is libdialog initialized? */
4815439SjkhBoolean		ColorDisplay;	/* Are we on a color display? */
4915439SjkhBoolean		OnVTY;		/* Are we on a VTY? */
5084831SjkhBoolean		Restarting;	/* Are we restarting sysinstall? */
51183921SkensmithBoolean		have_volumes;	/* Media has more than one volume. */
5215439SjkhVariable	*VarHead;	/* The head of the variable chain */
538636SjkhDevice		*mediaDevice;	/* Where we're installing from */
5415439Sjkhint		BootMgr;	/* Which boot manager we're using */
5517375Sjkhint		StatusLine;	/* Where to stick our status messages */
56183921Skensmithint		low_volume;	/* Lowest volume number */
57183921Skensmithint		high_volume;	/* Highest volume number */
5825052Sjkhjmp_buf		BailOut;	/* Beam me up, scotty! The natives are pissed! */
598097Sjkh
60133241SmarcelChunk		*HomeChunk;
61133241SmarcelChunk		*RootChunk;
62133241SmarcelChunk		*SwapChunk;
63133241SmarcelChunk		*TmpChunk;
64133241SmarcelChunk		*UsrChunk;
65133241SmarcelChunk		*VarChunk;
66133241Smarcel#ifdef __ia64__
67133241SmarcelChunk		*EfiChunk;
68133241Smarcel#endif
69133241Smarcel
708097Sjkh/*
718097Sjkh * Yes, I know some of these are already automatically initialized as
728097Sjkh * globals.  I simply find it clearer to set everything explicitly.
738097Sjkh */
748097Sjkhvoid
758097SjkhglobalsInit(void)
768097Sjkh{
778097Sjkh    DebugFD = -1;
788307Sjkh    ColorDisplay = FALSE;
798307Sjkh    OnVTY = FALSE;
808097Sjkh    DialogActive = FALSE;
818097Sjkh    VarHead = NULL;
828636Sjkh    mediaDevice = NULL;
83133241Smarcel
84133241Smarcel    HomeChunk = NULL;
85133241Smarcel    RootChunk = NULL;
86133241Smarcel    SwapChunk = NULL;
87133241Smarcel    TmpChunk = NULL;
88133241Smarcel    UsrChunk = NULL;
89133241Smarcel    VarChunk = NULL;
90133241Smarcel#ifdef __ia64__
91133241Smarcel    EfiChunk = NULL;
92133241Smarcel#endif
938097Sjkh}
94