defs.h revision 1.3.2.2 1 1.3.2.2 tls /* $NetBSD: defs.h,v 1.3.2.2 2014/08/10 07:00:24 tls Exp $ */
2 1.3.2.2 tls
3 1.3.2.2 tls /*
4 1.3.2.2 tls * Copyright 1997 Piermont Information Systems Inc.
5 1.3.2.2 tls * All rights reserved.
6 1.3.2.2 tls *
7 1.3.2.2 tls * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 1.3.2.2 tls *
9 1.3.2.2 tls * Redistribution and use in source and binary forms, with or without
10 1.3.2.2 tls * modification, are permitted provided that the following conditions
11 1.3.2.2 tls * are met:
12 1.3.2.2 tls * 1. Redistributions of source code must retain the above copyright
13 1.3.2.2 tls * notice, this list of conditions and the following disclaimer.
14 1.3.2.2 tls * 2. Redistributions in binary form must reproduce the above copyright
15 1.3.2.2 tls * notice, this list of conditions and the following disclaimer in the
16 1.3.2.2 tls * documentation and/or other materials provided with the distribution.
17 1.3.2.2 tls * 3. The name of Piermont Information Systems Inc. may not be used to endorse
18 1.3.2.2 tls * or promote products derived from this software without specific prior
19 1.3.2.2 tls * written permission.
20 1.3.2.2 tls *
21 1.3.2.2 tls * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
22 1.3.2.2 tls * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 1.3.2.2 tls * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.3.2.2 tls * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
25 1.3.2.2 tls * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 1.3.2.2 tls * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 1.3.2.2 tls * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 1.3.2.2 tls * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 1.3.2.2 tls * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 1.3.2.2 tls * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
31 1.3.2.2 tls * THE POSSIBILITY OF SUCH DAMAGE.
32 1.3.2.2 tls *
33 1.3.2.2 tls */
34 1.3.2.2 tls
35 1.3.2.2 tls #ifndef _DEFS_H_
36 1.3.2.2 tls #define _DEFS_H_
37 1.3.2.2 tls
38 1.3.2.2 tls /* defs.h -- definitions for use in the sysinst program. */
39 1.3.2.2 tls
40 1.3.2.2 tls /* System includes needed for this. */
41 1.3.2.2 tls #include <sys/queue.h>
42 1.3.2.2 tls #include <sys/types.h>
43 1.3.2.2 tls #include <sys/disklabel.h>
44 1.3.2.2 tls #include <sys/disk.h>
45 1.3.2.2 tls
46 1.3.2.2 tls const char *getfslabelname(uint8_t);
47 1.3.2.2 tls
48 1.3.2.2 tls static inline void *
49 1.3.2.2 tls deconst(const void *p)
50 1.3.2.2 tls {
51 1.3.2.2 tls return (char *)0 + ((const char *)p - (const char *)0);
52 1.3.2.2 tls }
53 1.3.2.2 tls
54 1.3.2.2 tls #include "msg_defs.h"
55 1.3.2.2 tls #include "menu_defs.h"
56 1.3.2.2 tls
57 1.3.2.2 tls #define min(a,b) ((a) < (b) ? (a) : (b))
58 1.3.2.2 tls #define max(a,b) ((a) > (b) ? (a) : (b))
59 1.3.2.2 tls
60 1.3.2.2 tls /* constants */
61 1.3.2.2 tls #define MEG (1024 * 1024)
62 1.3.2.2 tls #define STRSIZE 255
63 1.3.2.2 tls #define SSTRSIZE 30
64 1.3.2.2 tls
65 1.3.2.2 tls /* For run.c: collect() */
66 1.3.2.2 tls #define T_FILE 0
67 1.3.2.2 tls #define T_OUTPUT 1
68 1.3.2.2 tls
69 1.3.2.2 tls /* Some install status/response values */
70 1.3.2.2 tls #define SET_OK 0 /* Set extracted */
71 1.3.2.2 tls #define SET_RETRY 1 /* Retry */
72 1.3.2.2 tls #define SET_SKIP 2 /* Skip this set */
73 1.3.2.2 tls #define SET_SKIP_GROUP 3 /* Skip this set and rest of group */
74 1.3.2.2 tls #define SET_ABANDON 4 /* Abandon installation */
75 1.3.2.2 tls #define SET_CONTINUE 5 /* Continue (copy from floppy loop) */
76 1.3.2.2 tls
77 1.3.2.2 tls /* run_prog flags */
78 1.3.2.2 tls #define RUN_DISPLAY 0x0001 /* Display program output */
79 1.3.2.2 tls #define RUN_FATAL 0x0002 /* errors are fatal */
80 1.3.2.2 tls #define RUN_CHROOT 0x0004 /* chroot to target disk */
81 1.3.2.2 tls #define RUN_FULLSCREEN 0x0008 /* fullscreen (use with RUN_DISPLAY) */
82 1.3.2.2 tls #define RUN_SILENT 0x0010 /* Do not show output */
83 1.3.2.2 tls #define RUN_ERROR_OK 0x0040 /* Don't wait for error confirmation */
84 1.3.2.2 tls #define RUN_PROGRESS 0x0080 /* Output is just progess test */
85 1.3.2.2 tls #define RUN_NO_CLEAR 0x0100 /* Leave program output after error */
86 1.3.2.2 tls #define RUN_XFER_DIR 0x0200 /* cd to xfer_dir in child */
87 1.3.2.2 tls
88 1.3.2.2 tls /* for bsddisklabel.c */
89 1.3.2.2 tls enum { LY_SETNEW, LY_NEWRAID, LY_NEWCGD, LY_NEWLVM, LY_USEEXIST };
90 1.3.2.2 tls
91 1.3.2.2 tls /* Installation sets */
92 1.3.2.2 tls enum {
93 1.3.2.2 tls SET_NONE,
94 1.3.2.2 tls SET_KERNEL_FIRST,
95 1.3.2.2 tls SET_KERNEL_1, /* Usually GENERIC */
96 1.3.2.2 tls SET_KERNEL_2, /* MD kernel... */
97 1.3.2.2 tls SET_KERNEL_3, /* MD kernel... */
98 1.3.2.2 tls SET_KERNEL_4, /* MD kernel... */
99 1.3.2.2 tls SET_KERNEL_5, /* MD kernel... */
100 1.3.2.2 tls SET_KERNEL_6, /* MD kernel... */
101 1.3.2.2 tls SET_KERNEL_7, /* MD kernel... */
102 1.3.2.2 tls SET_KERNEL_8, /* MD kernel... */
103 1.3.2.2 tls SET_KERNEL_9, /* MD kernel... */
104 1.3.2.2 tls SET_KERNEL_LAST, /* allow 9 kernels */
105 1.3.2.2 tls
106 1.3.2.2 tls /* System sets */
107 1.3.2.2 tls SET_BASE, /* base */
108 1.3.2.2 tls SET_ETC, /* /etc */
109 1.3.2.2 tls SET_COMPILER, /* compiler tools */
110 1.3.2.2 tls SET_GAMES, /* text games */
111 1.3.2.2 tls SET_MAN_PAGES, /* online manual pages */
112 1.3.2.2 tls SET_MISC, /* miscellaneuous */
113 1.3.2.2 tls SET_MODULES, /* kernel modules */
114 1.3.2.2 tls SET_TESTS, /* tests */
115 1.3.2.2 tls SET_TEXT_TOOLS, /* text processing tools */
116 1.3.2.2 tls
117 1.3.2.2 tls /* X11 sets */
118 1.3.2.2 tls SET_X11_FIRST,
119 1.3.2.2 tls SET_X11_BASE, /* X11 base and clients */
120 1.3.2.2 tls SET_X11_FONTS, /* X11 fonts */
121 1.3.2.2 tls SET_X11_SERVERS, /* X11 servers */
122 1.3.2.2 tls SET_X11_PROG, /* X11 programming */
123 1.3.2.2 tls SET_X11_ETC, /* X11 config */
124 1.3.2.2 tls SET_X11_LAST,
125 1.3.2.2 tls
126 1.3.2.2 tls /* Machine dependent sets */
127 1.3.2.2 tls SET_MD_1, /* Machine dependent set */
128 1.3.2.2 tls SET_MD_2, /* Machine dependent set */
129 1.3.2.2 tls SET_MD_3, /* Machine dependent set */
130 1.3.2.2 tls SET_MD_4, /* Machine dependent set */
131 1.3.2.2 tls
132 1.3.2.2 tls /* Source sets */
133 1.3.2.2 tls SET_SYSSRC,
134 1.3.2.2 tls SET_SRC,
135 1.3.2.2 tls SET_SHARESRC,
136 1.3.2.2 tls SET_GNUSRC,
137 1.3.2.2 tls SET_XSRC,
138 1.3.2.2 tls
139 1.3.2.2 tls /* Debug sets */
140 1.3.2.2 tls SET_DEBUG,
141 1.3.2.2 tls SET_X11_DEBUG,
142 1.3.2.2 tls
143 1.3.2.2 tls SET_LAST,
144 1.3.2.2 tls SET_GROUP, /* Start of submenu */
145 1.3.2.2 tls SET_GROUP_END, /* End of submenu */
146 1.3.2.2 tls SET_PKGSRC, /* pkgsrc, not counted as regular set */
147 1.3.2.2 tls };
148 1.3.2.2 tls
149 1.3.2.2 tls /* Initialisers to select sets */
150 1.3.2.2 tls /* All kernels */
151 1.3.2.2 tls #define SET_KERNEL SET_KERNEL_1, SET_KERNEL_2, SET_KERNEL_3, SET_KERNEL_4, \
152 1.3.2.2 tls SET_KERNEL_5, SET_KERNEL_6, SET_KERNEL_7, SET_KERNEL_8
153 1.3.2.2 tls /* Core system sets */
154 1.3.2.2 tls #define SET_CORE SET_MODULES, SET_BASE, SET_ETC
155 1.3.2.2 tls /* All system sets */
156 1.3.2.2 tls #define SET_SYSTEM SET_CORE, SET_COMPILER, SET_GAMES, \
157 1.3.2.2 tls SET_MAN_PAGES, SET_MISC, SET_TESTS, SET_TEXT_TOOLS
158 1.3.2.2 tls /* All X11 sets */
159 1.3.2.2 tls #define SET_X11_NOSERVERS SET_X11_BASE, SET_X11_FONTS, SET_X11_PROG, SET_X11_ETC
160 1.3.2.2 tls #define SET_X11 SET_X11_NOSERVERS, SET_X11_SERVERS
161 1.3.2.2 tls
162 1.3.2.2 tls /* All machine dependent sets */
163 1.3.2.2 tls #define SET_MD SET_MD_1, SET_MD_2, SET_MD_3, SET_MD_4
164 1.3.2.2 tls
165 1.3.2.2 tls /* All source sets */
166 1.3.2.2 tls #define SET_SOURCE SET_SYSSRC, SET_SRC, SET_SHARESRC, SET_GNUSRC, SET_XSRC
167 1.3.2.2 tls
168 1.3.2.2 tls /* All debug sets */
169 1.3.2.2 tls #define SET_DEBUGGING SET_DEBUG, SET_X11_DEBUG
170 1.3.2.2 tls
171 1.3.2.2 tls /* Set list flags */
172 1.3.2.2 tls #define SFLAG_MINIMAL 1
173 1.3.2.2 tls #define SFLAG_NOX 2
174 1.3.2.2 tls
175 1.3.2.2 tls /* Macros */
176 1.3.2.2 tls #define nelem(x) (sizeof (x) / sizeof *(x))
177 1.3.2.2 tls
178 1.3.2.2 tls /* Round up to the next full cylinder size */
179 1.3.2.2 tls #define NUMSEC(size, sizemult, cylsize) \
180 1.3.2.2 tls ((size) == ~0u ? ~0u : (sizemult) == 1 ? (size) : \
181 1.3.2.2 tls roundup((size) * (sizemult), (cylsize)))
182 1.3.2.2 tls
183 1.3.2.2 tls /* What FS type? */
184 1.3.2.2 tls #define PI_ISBSDFS(p) ((p)->pi_fstype == FS_BSDLFS || \
185 1.3.2.2 tls (p)->pi_fstype == FS_BSDFFS)
186 1.3.2.2 tls
187 1.3.2.2 tls /* standard cd0 device */
188 1.3.2.2 tls #define CD_NAMES "cd0a"
189 1.3.2.2 tls
190 1.3.2.2 tls /* Types */
191 1.3.2.2 tls typedef struct distinfo {
192 1.3.2.2 tls const char *name;
193 1.3.2.2 tls uint set;
194 1.3.2.2 tls const char *desc;
195 1.3.2.2 tls const char *marker_file; /* set assumed installed if exists */
196 1.3.2.2 tls } distinfo;
197 1.3.2.2 tls
198 1.3.2.2 tls #define MOUNTLEN 20
199 1.3.2.2 tls typedef struct _partinfo {
200 1.3.2.2 tls struct partition pi_partition;
201 1.3.2.2 tls #define pi_size pi_partition.p_size
202 1.3.2.2 tls #define pi_offset pi_partition.p_offset
203 1.3.2.2 tls #define pi_fsize pi_partition.p_fsize
204 1.3.2.2 tls #define pi_fstype pi_partition.p_fstype
205 1.3.2.2 tls #define pi_frag pi_partition.p_frag
206 1.3.2.2 tls #define pi_cpg pi_partition.p_cpg
207 1.3.2.2 tls char pi_mount[MOUNTLEN];
208 1.3.2.2 tls uint pi_isize; /* bytes per inode (for # inodes) */
209 1.3.2.2 tls uint pi_flags;
210 1.3.2.2 tls #define PIF_NEWFS 0x0001 /* need to 'newfs' partition */
211 1.3.2.2 tls #define PIF_FFSv2 0x0002 /* newfs with FFSv2, not FFSv1 */
212 1.3.2.2 tls #define PIF_MOUNT 0x0004 /* need to mount partition */
213 1.3.2.2 tls #define PIF_ASYNC 0x0010 /* mount -o async */
214 1.3.2.2 tls #define PIF_NOATIME 0x0020 /* mount -o noatime */
215 1.3.2.2 tls #define PIF_NODEV 0x0040 /* mount -o nodev */
216 1.3.2.2 tls #define PIF_NODEVMTIME 0x0080 /* mount -o nodevmtime */
217 1.3.2.2 tls #define PIF_NOEXEC 0x0100 /* mount -o noexec */
218 1.3.2.2 tls #define PIF_NOSUID 0x0200 /* mount -o nosuid */
219 1.3.2.2 tls #define PIF__UNUSED 0x0400 /* unused */
220 1.3.2.2 tls #define PIF_LOG 0x0800 /* mount -o log */
221 1.3.2.2 tls #define PIF_MOUNT_OPTS 0x0ff0 /* all above mount flags */
222 1.3.2.2 tls #define PIF_RESET 0x1000 /* internal - restore previous values */
223 1.3.2.2 tls const char *mnt_opts;
224 1.3.2.2 tls const char *fsname;
225 1.3.2.2 tls char mounted[MOUNTLEN];
226 1.3.2.2 tls int lvmpv; /* should we use partition as LVM PV? */
227 1.3.2.2 tls } partinfo; /* Single partition from a disklabel */
228 1.3.2.2 tls
229 1.3.2.2 tls struct ptn_info {
230 1.3.2.2 tls int menu_no;
231 1.3.2.2 tls struct ptn_size {
232 1.3.2.2 tls int ptn_id;
233 1.3.2.2 tls char mount[MOUNTLEN];
234 1.3.2.2 tls daddr_t dflt_size;
235 1.3.2.2 tls daddr_t size;
236 1.3.2.2 tls int limit;
237 1.3.2.2 tls int changed;
238 1.3.2.2 tls } ptn_sizes[MAXPARTITIONS + 1]; /* +1 for delete code */
239 1.3.2.2 tls menu_ent ptn_menus[MAXPARTITIONS + 1]; /* +1 for unit chg */
240 1.3.2.2 tls int free_parts;
241 1.3.2.2 tls daddr_t free_space;
242 1.3.2.2 tls struct ptn_size *pool_part;
243 1.3.2.2 tls char exit_msg[70];
244 1.3.2.2 tls };
245 1.3.2.2 tls
246 1.3.2.2 tls /* variables */
247 1.3.2.2 tls
248 1.3.2.2 tls int debug; /* set by -D option */
249 1.3.2.2 tls
250 1.3.2.2 tls char rel[SSTRSIZE];
251 1.3.2.2 tls char machine[SSTRSIZE];
252 1.3.2.2 tls
253 1.3.2.2 tls int yesno;
254 1.3.2.2 tls int ignorerror;
255 1.3.2.2 tls int ttysig_ignore;
256 1.3.2.2 tls pid_t ttysig_forward;
257 1.3.2.2 tls int layoutkind;
258 1.3.2.2 tls int sizemult;
259 1.3.2.2 tls const char *multname;
260 1.3.2.2 tls int partman_go; /* run extended partition manager */
261 1.3.2.2 tls
262 1.3.2.2 tls /* logging variables */
263 1.3.2.2 tls
264 1.3.2.2 tls FILE *logfp;
265 1.3.2.2 tls FILE *script;
266 1.3.2.2 tls
267 1.3.2.2 tls /* Information for the NetBSD disklabel */
268 1.3.2.2 tls
269 1.3.2.2 tls enum DLTR { PART_A, PART_B, PART_C, PART_D, PART_E, PART_F, PART_G, PART_H,
270 1.3.2.2 tls PART_I, PART_J, PART_K, PART_L, PART_M, PART_N, PART_O, PART_P};
271 1.3.2.2 tls #define partition_name(x) ('a' + (x))
272 1.3.2.2 tls daddr_t tmp_ramdisk_size;
273 1.3.2.2 tls #define MAX_DISKS 15
274 1.3.2.2 tls
275 1.3.2.2 tls unsigned int root_limit; /* BIOS (etc) read limit */
276 1.3.2.2 tls
277 1.3.2.2 tls enum SHRED_T { SHRED_NONE=0, SHRED_ZEROS, SHRED_RANDOM, SHRED_CRYPTO };
278 1.3.2.2 tls
279 1.3.2.2 tls /* All information that is unique for each drive */
280 1.3.2.2 tls SLIST_HEAD(pm_head_t, pm_devs_t) pm_head;
281 1.3.2.2 tls
282 1.3.2.2 tls typedef struct pm_devs_t {
283 1.3.2.2 tls int unsaved; /* Flag indicating to partman that device need saving */
284 1.3.2.2 tls int found; /* Flag to delete unplugged and unconfigured devices */
285 1.3.2.2 tls int blocked; /* Device is busy and cannot be changed */
286 1.3.2.2 tls void *refdev; /* If device is blocked thats is a pointers to a parent dev */
287 1.3.2.2 tls int isspecial; /* LVM LV or DK device that doesnot accept disklabel */
288 1.3.2.2 tls char diskdev[SSTRSIZE]; /* Actual name of the disk. */
289 1.3.2.2 tls char diskdev_descr[STRSIZE];
290 1.3.2.2 tls int bootable;
291 1.3.2.2 tls #define DISKNAME_SIZE 16
292 1.3.2.2 tls char bsddiskname[DISKNAME_SIZE];
293 1.3.2.2 tls partinfo oldlabel[MAXPARTITIONS]; /* What we found on the disk */
294 1.3.2.2 tls partinfo bsdlabel[MAXPARTITIONS]; /* What we want it to look like */
295 1.3.2.2 tls int gpt;
296 1.3.2.2 tls int no_mbr; /* set for raid (etc) */
297 1.3.2.2 tls int rootpart; /* partition we install into */
298 1.3.2.2 tls const char *disktype; /* ST506, SCSI, ... */
299 1.3.2.2 tls const char *doessf;
300 1.3.2.2 tls /* Actual values for current disk - set by find_disks() or md_get_info() */
301 1.3.2.2 tls int sectorsize, dlcyl, dlhead, dlsec, dlcylsize, current_cylsize;
302 1.3.2.2 tls daddr_t dlsize;
303 1.3.2.2 tls /* Area of disk we can allocate, start and size in disk sectors. */
304 1.3.2.2 tls daddr_t ptstart, ptsize;
305 1.3.2.2 tls /* If we have an MBR boot partition, start and size in sectors */
306 1.3.2.2 tls int bootstart, bootsize;
307 1.3.2.2 tls struct ptn_info pi;
308 1.3.2.2 tls SLIST_ENTRY(pm_devs_t) l;
309 1.3.2.2 tls } pm_devs_t;
310 1.3.2.2 tls pm_devs_t *pm; /* Pointer to currend device with which we work */
311 1.3.2.2 tls pm_devs_t *pm_new; /* Pointer for next allocating device in find_disks() */
312 1.3.2.2 tls
313 1.3.2.2 tls #define MAX_WEDGES 16 /* num of dk* devices */
314 1.3.2.2 tls typedef struct pm_wedge_t {
315 1.3.2.2 tls int allocated;
316 1.3.2.2 tls int todel;
317 1.3.2.2 tls pm_devs_t *pm;
318 1.3.2.2 tls int ptn;
319 1.3.2.2 tls } pm_wedge_t;
320 1.3.2.2 tls pm_wedge_t wedges[MAX_WEDGES];
321 1.3.2.2 tls
322 1.3.2.2 tls /* Generic structure for partman */
323 1.3.2.2 tls typedef struct {
324 1.3.2.2 tls int retvalue;
325 1.3.2.2 tls int dev_num;
326 1.3.2.2 tls int wedge_num;
327 1.3.2.2 tls void *dev_ptr;
328 1.3.2.2 tls int dev_ptr_delta;
329 1.3.2.2 tls char fullname[SSTRSIZE];
330 1.3.2.2 tls enum {PM_DISK_T=1, PM_PART_T, PM_WEDGE_T, PM_SPEC_T, PM_RAID_T, PM_CGD_T,
331 1.3.2.2 tls PM_VND_T, PM_LVM_T, PM_LVMLV_T} type;
332 1.3.2.2 tls } part_entry_t;
333 1.3.2.2 tls
334 1.3.2.2 tls /* Relative file name for storing a distribution. */
335 1.3.2.2 tls char xfer_dir[STRSIZE];
336 1.3.2.2 tls int clean_xfer_dir;
337 1.3.2.2 tls
338 1.3.2.2 tls #if !defined(SYSINST_FTP_HOST)
339 1.3.2.2 tls #define SYSINST_FTP_HOST "ftp.NetBSD.org"
340 1.3.2.2 tls #endif
341 1.3.2.2 tls
342 1.3.2.2 tls #if !defined(SYSINST_FTP_DIR)
343 1.3.2.2 tls #define SYSINST_FTP_DIR "pub/NetBSD/NetBSD-" REL
344 1.3.2.2 tls #endif
345 1.3.2.2 tls
346 1.3.2.2 tls #if !defined(SYSINST_PKG_HOST)
347 1.3.2.2 tls #define SYSINST_PKG_HOST SYSINST_FTP_HOST
348 1.3.2.2 tls #endif
349 1.3.2.2 tls
350 1.3.2.2 tls #if !defined(SYSINST_PKG_DIR)
351 1.3.2.2 tls #define SYSINST_PKG_DIR "pub/pkgsrc/packages/NetBSD"
352 1.3.2.2 tls #endif
353 1.3.2.2 tls
354 1.3.2.2 tls #if !defined(SYSINST_PKGSRC_HOST)
355 1.3.2.2 tls #define SYSINST_PKGSRC_HOST SYSINST_PKG_HOST
356 1.3.2.2 tls #endif
357 1.3.2.2 tls
358 1.3.2.2 tls /* Abs. path we extract binary sets from */
359 1.3.2.2 tls char ext_dir_bin[STRSIZE];
360 1.3.2.2 tls
361 1.3.2.2 tls /* Abs. path we extract source sets from */
362 1.3.2.2 tls char ext_dir_src[STRSIZE];
363 1.3.2.2 tls
364 1.3.2.2 tls /* Abs. path we extract pkgsrc from */
365 1.3.2.2 tls char ext_dir_pkgsrc[STRSIZE];
366 1.3.2.2 tls
367 1.3.2.2 tls /* Place we look for binary sets in all fs types */
368 1.3.2.2 tls char set_dir_bin[STRSIZE];
369 1.3.2.2 tls
370 1.3.2.2 tls /* Place we look for source sets in all fs types */
371 1.3.2.2 tls char set_dir_src[STRSIZE];
372 1.3.2.2 tls
373 1.3.2.2 tls /* Place we look for pkgs in all fs types */
374 1.3.2.2 tls char pkg_dir[STRSIZE];
375 1.3.2.2 tls
376 1.3.2.2 tls /* Place we look for pkgsrc in all fs types */
377 1.3.2.2 tls char pkgsrc_dir[STRSIZE];
378 1.3.2.2 tls
379 1.3.2.2 tls /* User shell */
380 1.3.2.2 tls const char *ushell;
381 1.3.2.2 tls
382 1.3.2.2 tls struct ftpinfo {
383 1.3.2.2 tls char host[STRSIZE];
384 1.3.2.2 tls char dir[STRSIZE] ;
385 1.3.2.2 tls char user[SSTRSIZE];
386 1.3.2.2 tls char pass[STRSIZE];
387 1.3.2.2 tls char proxy[STRSIZE];
388 1.3.2.2 tls const char *xfer_type; /* "ftp" or "http" */
389 1.3.2.2 tls };
390 1.3.2.2 tls
391 1.3.2.2 tls /* use the same struct for sets ftp and to build pkgpath */
392 1.3.2.2 tls struct ftpinfo ftp, pkg, pkgsrc;
393 1.3.2.2 tls
394 1.3.2.2 tls int (*fetch_fn)(const char *);
395 1.3.2.2 tls char nfs_host[STRSIZE];
396 1.3.2.2 tls char nfs_dir[STRSIZE];
397 1.3.2.2 tls
398 1.3.2.2 tls char cdrom_dev[SSTRSIZE]; /* Typically "cd0a" */
399 1.3.2.2 tls char fd_dev[SSTRSIZE]; /* Typically "/dev/fd0a" */
400 1.3.2.2 tls const char *fd_type; /* "msdos", "ffs" or maybe "ados" */
401 1.3.2.2 tls
402 1.3.2.2 tls char localfs_dev[SSTRSIZE];
403 1.3.2.2 tls char localfs_fs[SSTRSIZE];
404 1.3.2.2 tls char localfs_dir[STRSIZE];
405 1.3.2.2 tls
406 1.3.2.2 tls char targetroot_mnt[SSTRSIZE];
407 1.3.2.2 tls
408 1.3.2.2 tls int mnt2_mounted;
409 1.3.2.2 tls
410 1.3.2.2 tls char dist_postfix[SSTRSIZE];
411 1.3.2.2 tls
412 1.3.2.2 tls /* needed prototypes */
413 1.3.2.2 tls void set_menu_numopts(int, int);
414 1.3.2.2 tls void remove_color_options(void);
415 1.3.2.2 tls void remove_raid_options(void);
416 1.3.2.2 tls void remove_lvm_options(void);
417 1.3.2.2 tls void remove_cgd_options(void);
418 1.3.2.2 tls void remove_gpt_options(void);
419 1.3.2.2 tls
420 1.3.2.2 tls /* Machine dependent functions .... */
421 1.3.2.2 tls void md_init(void);
422 1.3.2.2 tls void md_prelim_menu(void);
423 1.3.2.2 tls void md_init_set_status(int); /* SFLAG_foo */
424 1.3.2.2 tls
425 1.3.2.2 tls /* MD functions if user selects install - in order called */
426 1.3.2.2 tls int md_get_info(void);
427 1.3.2.2 tls int md_make_bsd_partitions(void);
428 1.3.2.2 tls int md_check_partitions(void);
429 1.3.2.2 tls int md_pre_disklabel(void);
430 1.3.2.2 tls int md_post_disklabel(void);
431 1.3.2.2 tls int md_pre_mount(void);
432 1.3.2.2 tls int md_post_newfs(void);
433 1.3.2.2 tls int md_post_extract(void);
434 1.3.2.2 tls void md_cleanup_install(void);
435 1.3.2.2 tls
436 1.3.2.2 tls /* MD functions if user selects upgrade - in order called */
437 1.3.2.2 tls int md_pre_update(void);
438 1.3.2.2 tls int md_update(void);
439 1.3.2.2 tls /* Also calls md_post_extract() */
440 1.3.2.2 tls
441 1.3.2.2 tls /* from main.c */
442 1.3.2.2 tls void toplevel(void);
443 1.3.2.2 tls
444 1.3.2.2 tls /* from disks.c */
445 1.3.2.2 tls const char *get_default_cdrom(void);
446 1.3.2.2 tls int find_disks(const char *);
447 1.3.2.2 tls struct menudesc;
448 1.3.2.2 tls void fmt_fspart(struct menudesc *, int, void *);
449 1.3.2.2 tls void disp_cur_fspart(int, int);
450 1.3.2.2 tls int write_disklabel(void);
451 1.3.2.2 tls int make_filesystems(void);
452 1.3.2.2 tls int make_fstab(void);
453 1.3.2.2 tls int mount_disks(void);
454 1.3.2.2 tls int set_swap(const char *, partinfo *);
455 1.3.2.2 tls int check_swap(const char *, int);
456 1.3.2.2 tls char *bootxx_name(void);
457 1.3.2.2 tls void label_read(void);
458 1.3.2.2 tls int get_dkwedges(struct dkwedge_info **, const char *);
459 1.3.2.2 tls const char *get_gptfs_by_id(int);
460 1.3.2.2 tls
461 1.3.2.2 tls
462 1.3.2.2 tls /* from disks_lfs.c */
463 1.3.2.2 tls int fs_is_lfs(void *);
464 1.3.2.2 tls
465 1.3.2.2 tls /* from label.c */
466 1.3.2.2 tls const char *get_last_mounted(int, int, partinfo *);
467 1.3.2.2 tls int savenewlabel(partinfo *, int);
468 1.3.2.2 tls int incorelabel(const char *, partinfo *);
469 1.3.2.2 tls int edit_and_check_label(partinfo *, int, int, int);
470 1.3.2.2 tls void set_bsize(partinfo *, int);
471 1.3.2.2 tls void set_fsize(partinfo *, int);
472 1.3.2.2 tls void set_ptype(partinfo *, int, int);
473 1.3.2.2 tls int edit_ptn(menudesc *, void *);
474 1.3.2.2 tls int checkoverlap(partinfo *, int, int, int);
475 1.3.2.2 tls
476 1.3.2.2 tls /* from install.c */
477 1.3.2.2 tls void do_install(void);
478 1.3.2.2 tls
479 1.3.2.2 tls /* from factor.c */
480 1.3.2.2 tls void factor(long, long *, int, int *);
481 1.3.2.2 tls
482 1.3.2.2 tls /* from fdisk.c */
483 1.3.2.2 tls void get_disk_info(char *);
484 1.3.2.2 tls void set_disk_info(char *);
485 1.3.2.2 tls
486 1.3.2.2 tls /* from geom.c */
487 1.3.2.2 tls int get_geom(const char *, struct disklabel *);
488 1.3.2.2 tls int get_real_geom(const char *, struct disklabel *);
489 1.3.2.2 tls
490 1.3.2.2 tls /* from net.c */
491 1.3.2.2 tls extern int network_up;
492 1.3.2.2 tls extern char net_namesvr6[STRSIZE];
493 1.3.2.2 tls int get_via_ftp(const char *);
494 1.3.2.2 tls int get_via_nfs(void);
495 1.3.2.2 tls int config_network(void);
496 1.3.2.2 tls void mnt_net_config(void);
497 1.3.2.2 tls void make_url(char *, struct ftpinfo *, const char *);
498 1.3.2.2 tls int get_pkgsrc(void);
499 1.3.2.2 tls
500 1.3.2.2 tls /* From run.c */
501 1.3.2.2 tls int collect(int, char **, const char *, ...) __printflike(3, 4);
502 1.3.2.2 tls int run_program(int, const char *, ...) __printflike(2, 3);
503 1.3.2.2 tls void do_logging(void);
504 1.3.2.2 tls int do_system(const char *);
505 1.3.2.2 tls
506 1.3.2.2 tls /* from upgrade.c */
507 1.3.2.2 tls void do_upgrade(void);
508 1.3.2.2 tls void do_reinstall_sets(void);
509 1.3.2.2 tls void restore_etc(void);
510 1.3.2.2 tls
511 1.3.2.2 tls /* from util.c */
512 1.3.2.2 tls int dir_exists_p(const char *);
513 1.3.2.2 tls int file_exists_p(const char *);
514 1.3.2.2 tls int file_mode_match(const char *, unsigned int);
515 1.3.2.2 tls uint get_ramsize(void);
516 1.3.2.2 tls void ask_sizemult(int);
517 1.3.2.2 tls void run_makedev(void);
518 1.3.2.2 tls int boot_media_still_needed(void);
519 1.3.2.2 tls int get_via_floppy(void);
520 1.3.2.2 tls int get_via_cdrom(void);
521 1.3.2.2 tls int get_via_localfs(void);
522 1.3.2.2 tls int get_via_localdir(void);
523 1.3.2.2 tls void show_cur_distsets(void);
524 1.3.2.2 tls void make_ramdisk_dir(const char *);
525 1.3.2.2 tls void set_kernel_set(unsigned int);
526 1.3.2.2 tls unsigned int get_kernel_set(void);
527 1.3.2.2 tls unsigned int set_X11_selected(void);
528 1.3.2.2 tls int get_and_unpack_sets(int, msg, msg, msg);
529 1.3.2.2 tls int sanity_check(void);
530 1.3.2.2 tls int set_timezone(void);
531 1.3.2.2 tls void scripting_fprintf(FILE *, const char *, ...) __printflike(2, 3);
532 1.3.2.2 tls void scripting_vfprintf(FILE *, const char *, va_list) __printflike(2, 0);
533 1.3.2.2 tls void add_rc_conf(const char *, ...);
534 1.3.2.2 tls int del_rc_conf(const char *);
535 1.3.2.2 tls void add_sysctl_conf(const char *, ...) __printflike(1, 2);
536 1.3.2.2 tls void enable_rc_conf(void);
537 1.3.2.2 tls void set_sizemultname_cyl(void);
538 1.3.2.2 tls void set_sizemultname_meg(void);
539 1.3.2.2 tls int binary_available(const char *);
540 1.3.2.2 tls int check_lfs_progs(void);
541 1.3.2.2 tls void init_set_status(int);
542 1.3.2.2 tls void customise_sets(void);
543 1.3.2.2 tls void umount_mnt2(void);
544 1.3.2.2 tls int set_is_source(const char *);
545 1.3.2.2 tls const char *set_dir_for_set(const char *);
546 1.3.2.2 tls const char *ext_dir_for_set(const char *);
547 1.3.2.2 tls void replace(const char *, const char *, ...);
548 1.3.2.2 tls void get_tz_default(void);
549 1.3.2.2 tls int extract_file(distinfo *, int);
550 1.3.2.2 tls void do_coloring (unsigned int, unsigned int);
551 1.3.2.2 tls int set_menu_select(menudesc *, void *);
552 1.3.2.2 tls
553 1.3.2.2 tls /* from target.c */
554 1.3.2.2 tls #if defined(DEBUG) || defined(DEBUG_ROOT)
555 1.3.2.2 tls void backtowin(void);
556 1.3.2.2 tls #endif
557 1.3.2.2 tls const char *concat_paths(const char *, const char *);
558 1.3.2.2 tls const char *target_expand(const char *);
559 1.3.2.2 tls void make_target_dir(const char *);
560 1.3.2.2 tls void append_to_target_file(const char *, const char *);
561 1.3.2.2 tls void echo_to_target_file(const char *, const char *);
562 1.3.2.2 tls void sprintf_to_target_file(const char *, const char *, ...)
563 1.3.2.2 tls __printflike(2, 3);
564 1.3.2.2 tls void trunc_target_file(const char *);
565 1.3.2.2 tls const char *target_prefix(void);
566 1.3.2.2 tls int target_chdir(const char *);
567 1.3.2.2 tls void target_chdir_or_die(const char *);
568 1.3.2.2 tls int target_already_root(void);
569 1.3.2.2 tls FILE *target_fopen(const char *, const char *);
570 1.3.2.2 tls int target_collect_file(int, char **, const char *);
571 1.3.2.2 tls int is_active_rootpart(const char *, int);
572 1.3.2.2 tls int cp_to_target(const char *, const char *);
573 1.3.2.2 tls void dup_file_into_target(const char *);
574 1.3.2.2 tls void mv_within_target_or_die(const char *, const char *);
575 1.3.2.2 tls int cp_within_target(const char *, const char *, int);
576 1.3.2.2 tls int target_mount(const char *, const char *, int, const char *);
577 1.3.2.2 tls int target_mount_do(const char *, const char *, const char *);
578 1.3.2.2 tls int target_test(unsigned int, const char *);
579 1.3.2.2 tls int target_dir_exists_p(const char *);
580 1.3.2.2 tls int target_file_exists_p(const char *);
581 1.3.2.2 tls int target_symlink_exists_p(const char *);
582 1.3.2.2 tls void unwind_mounts(void);
583 1.3.2.2 tls int target_mounted(void);
584 1.3.2.2 tls
585 1.3.2.2 tls /* from partman.c */
586 1.3.2.2 tls int partman(void);
587 1.3.2.2 tls int pm_partusage(pm_devs_t *, int, int);
588 1.3.2.2 tls int pm_getrefdev(pm_devs_t *);
589 1.3.2.2 tls void pm_setfstype(pm_devs_t *, int, int);
590 1.3.2.2 tls int pm_editpart(int);
591 1.3.2.2 tls void pm_rename(pm_devs_t *);
592 1.3.2.2 tls int pm_shred(pm_devs_t *, int, int);
593 1.3.2.2 tls void pm_umount(pm_devs_t *, int);
594 1.3.2.2 tls int pm_unconfigure(pm_devs_t *);
595 1.3.2.2 tls int pm_cgd_edit(void *, part_entry_t *);
596 1.3.2.2 tls int pm_gpt_convert(pm_devs_t *);
597 1.3.2.2 tls void pm_wedges_fill(pm_devs_t *);
598 1.3.2.2 tls void pm_make_bsd_partitions(pm_devs_t *);
599 1.3.2.2 tls
600 1.3.2.2 tls /* from bsddisklabel.c */
601 1.3.2.2 tls int make_bsd_partitions(void);
602 1.3.2.2 tls int save_ptn(int, daddr_t, daddr_t, int, const char *);
603 1.3.2.2 tls void set_ptn_titles(menudesc *, int, void *);
604 1.3.2.2 tls void set_ptn_menu(struct ptn_info *);
605 1.3.2.2 tls int set_ptn_size(menudesc *, void *);
606 1.3.2.2 tls void get_ptn_sizes(daddr_t, daddr_t, int);
607 1.3.2.2 tls int check_partitions(void);
608 1.3.2.2 tls
609 1.3.2.2 tls /* from aout2elf.c */
610 1.3.2.2 tls int move_aout_libs(void);
611 1.3.2.2 tls
612 1.3.2.2 tls #ifdef WSKBD
613 1.3.2.2 tls void get_kb_encoding(void);
614 1.3.2.2 tls void save_kb_encoding(void);
615 1.3.2.2 tls #else
616 1.3.2.2 tls #define get_kb_encoding()
617 1.3.2.2 tls #define save_kb_encoding()
618 1.3.2.2 tls #endif
619 1.3.2.2 tls
620 1.3.2.2 tls /* from configmenu.c */
621 1.3.2.2 tls void do_configmenu(void);
622 1.3.2.2 tls
623 1.3.2.2 tls /* from checkrc.c */
624 1.3.2.2 tls int check_rcvar(const char *);
625 1.3.2.2 tls int check_rcdefault(const char *);
626 1.3.2.2 tls WINDOW *mainwin;
627 1.3.2.2 tls
628 1.3.2.2 tls #endif /* _DEFS_H_ */
629