[BACK]Return to defs.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / distrib / utils / sysinst

Annotation of src/distrib/utils/sysinst/defs.h, Revision 1.11

1.11    ! jonathan    1: /*     $NetBSD: defs.h,v 1.10 1997/10/31 23:00:32 phil 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:
                     19:  *      This product includes software develooped for the NetBSD Project by
                     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: /* defs.h -- definitions for use in the sysinst program. */
                     40:
1.5       phil       41: /* System includes needed for this. */
                     42: #include <sys/types.h>
                     43: #include <sys/disklabel.h>
                     44:
1.1       phil       45: /* Define for external varible use */
                     46: #ifdef MAIN
                     47: #define EXTERN
                     48: #define INIT(x) = x
                     49: #else
                     50: #define EXTERN extern
                     51: #define INIT(x)
                     52: #endif
                     53:
                     54: /* constants */
                     55: #define MEG 1048576
                     56: #define STRSIZE 255
1.4       phil       57: #define SSTRSIZE 30
1.1       phil       58:
                     59: /* For run.c: collect() */
                     60: #define T_FILE 0
                     61: #define T_OUTPUT 1
                     62:
                     63: /* Macros */
                     64:
                     65: /* Round up to the next full cylinder size */
                     66: #define NUMSEC(size,sizemult,cylsize) \
1.10      phil       67:        ((size == -1) ? -1 : (sizemult == 1) ? (size) : \
1.1       phil       68:         (((size)*(sizemult)+(cylsize)-1)/(cylsize))*(cylsize))
1.9       phil       69:
                     70: /* Types */
                     71: typedef struct distinfo {
                     72:        char *name;
                     73:        int   getit;
                     74:        char *fdlast;
                     75:        char *desc;
                     76: } distinfo;
1.1       phil       77:
                     78: /* variables */
                     79:
                     80: EXTERN char rel[10] INIT(REL);
                     81: EXTERN char rels[10] INIT(REL);
                     82:
                     83: EXTERN int yesno;
                     84: EXTERN int layoutkind;
                     85: EXTERN int sizemult INIT(1);
                     86: EXTERN char *multname;
                     87: EXTERN char *doingwhat;
                     88:
                     89: /* Hardware variables */
1.4       phil       90: EXTERN long ramsize INIT(0);
                     91: EXTERN int  rammb   INIT(0);
1.1       phil       92:
1.4       phil       93: /* Disk descriptions */
                     94: #define MAX_DISKS 15
                     95: struct disk_desc {
                     96:        char name[SSTRSIZE];
                     97:        int  geom[5];
                     98: };
                     99: EXTERN struct disk_desc disks[MAX_DISKS];
                    100:
                    101: EXTERN struct disk_desc *disk;
1.1       phil      102: EXTERN int sectorsize;
                    103:
1.4       phil      104: /* Actual name of the disk. */
                    105: EXTERN char diskdev[SSTRSIZE];
                    106: EXTERN char disknames[STRSIZE];
1.1       phil      107: EXTERN int  numdisks;
                    108: EXTERN char *disktype;         /* ST506, SCSI, ... */
                    109:
                    110: /* Used in editing partitions ... BSD disklabel and others */
                    111: EXTERN int editpart;
                    112:
1.10      phil      113: /* Partition start and size in disk sectors. */
                    114: EXTERN int ptstart, ptsize;
                    115:
                    116: /* File system disk size.  File system partition size. May not include
                    117:    full disk size. */
                    118: EXTERN int fsdsize, fsptsize;
                    119:
                    120:
1.1       phil      121: EXTERN int fsdmb;
                    122: EXTERN int minfsdmb;
                    123: EXTERN int partstart;
                    124: EXTERN int partsize;
                    125:
                    126: /* set by md_get_info() */
                    127: EXTERN int dlcyl, dlhead, dlsec, dlsize, dlcylsize;
                    128: EXTERN int swapadj INIT(0);
                    129:
                    130: /* Information for the NetBSD disklabel */
                    131: EXTERN char *fstype[]
                    132: #ifdef MAIN
                    133: = {"unused", "swap", "4.2BSD", "msdos"}
                    134: #endif
                    135: ;
                    136: enum DTYPE {T_UNUSED, T_SWAP, T_42BSD, T_MSDOS};
                    137: enum DINFO {D_SIZE, D_OFFSET, D_FSTYPE, D_BSIZE, D_FSIZE};
                    138: enum DLTR {A,B,C,D,E,F,G,H};
                    139: EXTERN char partname[] INIT("abcdefgh");
                    140: EXTERN int bsdlabel[8][5];
                    141: EXTERN char fsmount[8][20] INIT({""});
                    142: EXTERN char bsddiskname[80];
                    143: EXTERN char *doessf INIT("");
                    144:
                    145: /* scsi_fake communication */
                    146: EXTERN int fake_sel;
                    147:
                    148: /* other vars for menu communication */
                    149: EXTERN int  nodist;
1.2       phil      150: EXTERN int  got_dist;
1.1       phil      151: EXTERN char dist_dir[STRSIZE] INIT("/usr/INSTALL");
1.2       phil      152: EXTERN int  clean_dist_dir INIT(0);
1.1       phil      153: EXTERN char ftp_host[STRSIZE] INIT("ftp.netbsd.org");
                    154: EXTERN char ftp_dir[STRSIZE]  INIT("/pub/NetBSD/NetBSD-" REL "/" MACH);
                    155: EXTERN char ftp_user[STRSIZE] INIT("ftp");
                    156: EXTERN char ftp_pass[STRSIZE] INIT("");
                    157:
1.5       phil      158: EXTERN char nfs_host[STRSIZE] INIT("");
                    159: EXTERN char nfs_dir[STRSIZE] INIT("");
                    160:
1.7       phil      161: EXTERN char cdrom_dev[SSTRSIZE] INIT("cd0");
                    162: EXTERN char cdrom_dir[STRSIZE] INIT("/Release/NetBSD/NetBSD-" REL "/" MACH);
                    163:
                    164: EXTERN int  mnt2_mounted INIT(0);
                    165:
1.1       phil      166: /* Vars for runing commands ... */
                    167: EXTERN char command[STRSIZE];
                    168:
                    169: /* Access to network information */
                    170: EXTERN char net_devices [STRSIZE] INIT("");
                    171: EXTERN char net_dev[STRSIZE] INIT("");
                    172: EXTERN char net_domain[STRSIZE] INIT("");
                    173: EXTERN char net_host[STRSIZE] INIT("");
                    174: EXTERN char net_ip[STRSIZE] INIT("");
                    175: EXTERN char net_mask[STRSIZE] INIT("");
                    176: EXTERN char net_namesvr[STRSIZE] INIT("");
                    177: EXTERN char net_defroute[STRSIZE] INIT("");
                    178:
1.3       phil      179: /* Variables for upgrade. */
                    180: #define MAXFS 16
                    181: EXTERN char fs_dev[MAXFS][STRSIZE];
                    182: EXTERN char fs_mount[MAXFS][STRSIZE];
                    183: EXTERN int  fs_num;
1.1       phil      184:
                    185: /* needed prototypes */
                    186:
                    187: /* Machine dependent functions .... */
1.6       phil      188: int    md_get_info __P((void));
1.5       phil      189: void   md_pre_disklabel __P((void));
                    190: void   md_post_disklabel __P((void));
                    191: void   md_post_newfs __P((void));
                    192: void   md_copy_filesystem __P((void));
                    193: void   md_make_bsd_partitions __P((void));
                    194: int    md_update __P((void));
                    195:
                    196: /* from disks.c */
                    197: int    find_disks __P((void));
                    198: void   disp_cur_part __P((int,int));
                    199: void   disp_cur_fspart __P((int, int));
                    200: void   scsi_fake __P((void));
                    201: void   make_bsd_partitions __P((void));
                    202: void   write_disklabel __P((void));
                    203: void   make_filesystems __P((void));
                    204: void   make_fstab __P((void));
                    205: int    fsck_disks __P((void));
1.1       phil      206:
                    207: /* from install.c */
1.5       phil      208: void   do_install __P((void));
1.1       phil      209:
1.5       phil      210: /* from factor.c */
                    211: void   factor __P((long, long *, int, int *));
1.1       phil      212:
1.5       phil      213: /* from geom.c */
1.6       phil      214: int    get_geom __P((char *, struct disklabel *));
1.1       phil      215:
1.5       phil      216: /* from net.c */
1.6       phil      217: int    get_via_ftp __P((void));
                    218: int    get_via_nfs __P((void));
1.8       phil      219: int    config_network __P((void));
1.7       phil      220: void   mnt_net_config __P((void));
1.1       phil      221:
1.5       phil      222: /* From run.c */
                    223: int    collect __P((int kind, char **buffer, char *name, ...));
                    224: int    run_prog __P((char *, ...));
1.11    ! jonathan  225: void   run_prog_or_die __P((char *, ...));
        !           226: int    run_prog_or_continue __P((char *, ...));
1.1       phil      227:
1.5       phil      228: /* from upgrade.c */
                    229: void   do_upgrade __P((void));
1.1       phil      230:
                    231: /* from util.c */
1.5       phil      232: void   get_ramsize __P((void));
                    233: void   ask_sizemult __P((void));
1.10      phil      234: void   reask_sizemult __P((void));
1.5       phil      235: int    ask_ynquestion __P((char *quest, char def, ...));
                    236: void   extract_dist __P((void));
                    237: void   run_makedev __P((void));
1.6       phil      238: int    get_via_floppy __P((void));
1.7       phil      239: int    get_via_cdrom __P((void));
1.9       phil      240: void   cd_dist_dir __P((char *));
                    241: void   toggle_getit __P((int));
                    242: void   show_cur_distsets __P((void));
1.11    ! jonathan  243: void   make_ramdisk_dir __P((const char *path));
        !           244: void   make_target_dir __P((const char *path));
        !           245: void   append_to_target_file __P((const char *string, const char *path));
        !           246: void   echo_to_target_file __P((const char *string, const char *path));
        !           247: void   trunc_target_file __P((const char *path));

CVSweb <webmaster@jp.NetBSD.org>