2021-02-01 01:45:46 +03:00
|
|
|
/* $NetBSD: defs.h,v 1.70 2021/01/31 22:45:46 rillig Exp $ */
|
1997-09-27 03:02:53 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 1997 Piermont Information Systems Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Written by Philip A. Nelson for Piermont Information Systems Inc.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
2011-04-04 12:30:12 +04:00
|
|
|
* 3. The name of Piermont Information Systems Inc. may not be used to endorse
|
1997-09-27 03:02:53 +04:00
|
|
|
* or promote products derived from this software without specific prior
|
|
|
|
* written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
2011-04-04 12:30:12 +04:00
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
|
|
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
1997-09-27 03:02:53 +04:00
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
2011-04-04 12:30:12 +04:00
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
1997-09-27 03:02:53 +04:00
|
|
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2003-05-19 00:40:09 +04:00
|
|
|
#ifndef _DEFS_H_
|
|
|
|
#define _DEFS_H_
|
|
|
|
|
1997-09-27 03:02:53 +04:00
|
|
|
/* defs.h -- definitions for use in the sysinst program. */
|
|
|
|
|
1997-10-15 08:35:17 +04:00
|
|
|
/* System includes needed for this. */
|
2014-08-03 20:09:38 +04:00
|
|
|
#include <sys/queue.h>
|
1997-10-15 08:35:17 +04:00
|
|
|
#include <sys/types.h>
|
2014-08-03 20:09:38 +04:00
|
|
|
#include <sys/disk.h>
|
2020-11-04 17:29:40 +03:00
|
|
|
#include <limits.h>
|
2019-06-12 09:20:17 +03:00
|
|
|
#include <uuid.h>
|
2003-11-30 17:36:43 +03:00
|
|
|
|
2019-06-12 09:20:17 +03:00
|
|
|
const char *getfslabelname(uint, uint);
|
2012-01-06 02:18:36 +04:00
|
|
|
|
1999-07-05 01:32:48 +04:00
|
|
|
#include "msg_defs.h"
|
2008-01-24 02:15:37 +03:00
|
|
|
#include "menu_defs.h"
|
2019-06-12 09:20:17 +03:00
|
|
|
#include "partitions.h"
|
1999-07-05 01:32:48 +04:00
|
|
|
|
2003-11-30 17:36:43 +03:00
|
|
|
#define min(a,b) ((a) < (b) ? (a) : (b))
|
|
|
|
#define max(a,b) ((a) > (b) ? (a) : (b))
|
2000-01-13 21:52:21 +03:00
|
|
|
|
1997-09-27 03:02:53 +04:00
|
|
|
/* constants */
|
2019-06-12 09:20:17 +03:00
|
|
|
#define MEG (1024UL * 1024UL)
|
|
|
|
#define GIG (1024UL * MEG)
|
|
|
|
#define STRSIZE 255
|
|
|
|
#define MENUSTRSIZE 80
|
|
|
|
#define SSTRSIZE 30
|
|
|
|
|
2020-01-24 10:31:15 +03:00
|
|
|
/* these are used for different alignment defaults */
|
2019-06-12 09:20:17 +03:00
|
|
|
#define HUGE_DISK_SIZE (daddr_t)(128 * (GIG / 512))
|
|
|
|
#define TINY_DISK_SIZE (daddr_t)(1800 * (MEG / 512))
|
|
|
|
|
2020-01-24 10:31:15 +03:00
|
|
|
/*
|
|
|
|
* if a system does not have more ram (in MB) than this, swap will be enabled
|
|
|
|
* very early (as soon as the swap partition has been created)
|
|
|
|
*/
|
|
|
|
#define TINY_RAM_SIZE 32
|
|
|
|
/*
|
|
|
|
* if a system has less ram (in MB) than this, we will not create a
|
|
|
|
* tmpfs /tmp by default (to workaround PR misc/54886)
|
|
|
|
*/
|
2020-03-16 09:48:17 +03:00
|
|
|
#define SMALL_RAM_SIZE 384
|
2020-01-24 10:31:15 +03:00
|
|
|
|
2019-06-12 09:20:17 +03:00
|
|
|
/* helper macros to create unique internal error messages */
|
|
|
|
#define STR_NO(STR) #STR
|
|
|
|
#define TO_STR(NO) STR_NO(NO)
|
|
|
|
#define INTERNAL_ERROR __FILE__ ":" TO_STR(__LINE__) ": internal error"
|
1997-09-27 03:02:53 +04:00
|
|
|
|
|
|
|
/* For run.c: collect() */
|
2003-11-30 17:36:43 +03:00
|
|
|
#define T_FILE 0
|
|
|
|
#define T_OUTPUT 1
|
1997-09-27 03:02:53 +04:00
|
|
|
|
2006-01-13 01:02:44 +03:00
|
|
|
/* Some install status/response values */
|
|
|
|
#define SET_OK 0 /* Set extracted */
|
|
|
|
#define SET_RETRY 1 /* Retry */
|
|
|
|
#define SET_SKIP 2 /* Skip this set */
|
|
|
|
#define SET_SKIP_GROUP 3 /* Skip this set and rest of group */
|
|
|
|
#define SET_ABANDON 4 /* Abandon installation */
|
|
|
|
#define SET_CONTINUE 5 /* Continue (copy from floppy loop) */
|
|
|
|
|
2000-10-12 03:47:55 +04:00
|
|
|
/* run_prog flags */
|
2003-10-20 00:17:31 +04:00
|
|
|
#define RUN_DISPLAY 0x0001 /* Display program output */
|
2000-10-12 03:47:55 +04:00
|
|
|
#define RUN_FATAL 0x0002 /* errors are fatal */
|
|
|
|
#define RUN_CHROOT 0x0004 /* chroot to target disk */
|
|
|
|
#define RUN_FULLSCREEN 0x0008 /* fullscreen (use with RUN_DISPLAY) */
|
2003-10-20 00:17:31 +04:00
|
|
|
#define RUN_SILENT 0x0010 /* Do not show output */
|
|
|
|
#define RUN_ERROR_OK 0x0040 /* Don't wait for error confirmation */
|
|
|
|
#define RUN_PROGRESS 0x0080 /* Output is just progess test */
|
2003-11-30 17:36:43 +03:00
|
|
|
#define RUN_NO_CLEAR 0x0100 /* Leave program output after error */
|
2006-01-13 01:02:44 +03:00
|
|
|
#define RUN_XFER_DIR 0x0200 /* cd to xfer_dir in child */
|
2000-10-12 03:47:55 +04:00
|
|
|
|
2014-08-03 20:09:38 +04:00
|
|
|
/* for bsddisklabel.c */
|
2020-10-12 19:14:32 +03:00
|
|
|
enum layout_type {
|
|
|
|
LY_KEEPEXISTING, /* keep exisiting partitions */
|
|
|
|
LY_OTHERSCHEME, /* delete all, select new partitioning scheme */
|
|
|
|
LY_SETSIZES, /* edit sizes */
|
|
|
|
LY_USEDEFAULT, /* use default sizes */
|
|
|
|
LY_USEFULL, /* use full disk for NetBSD */
|
|
|
|
LY_ERROR /* used for "abort" in menu */
|
|
|
|
};
|
|
|
|
|
2019-06-12 09:20:17 +03:00
|
|
|
enum setup_type { SY_NEWRAID, SY_NEWCGD, SY_NEWLVM };
|
2014-08-03 20:09:38 +04:00
|
|
|
|
2003-06-12 01:35:35 +04:00
|
|
|
/* Installation sets */
|
2006-01-13 01:02:44 +03:00
|
|
|
enum {
|
|
|
|
SET_NONE,
|
|
|
|
SET_KERNEL_FIRST,
|
|
|
|
SET_KERNEL_1, /* Usually GENERIC */
|
|
|
|
SET_KERNEL_2, /* MD kernel... */
|
|
|
|
SET_KERNEL_3, /* MD kernel... */
|
|
|
|
SET_KERNEL_4, /* MD kernel... */
|
|
|
|
SET_KERNEL_5, /* MD kernel... */
|
|
|
|
SET_KERNEL_6, /* MD kernel... */
|
|
|
|
SET_KERNEL_7, /* MD kernel... */
|
|
|
|
SET_KERNEL_8, /* MD kernel... */
|
2013-03-27 00:56:54 +04:00
|
|
|
SET_KERNEL_9, /* MD kernel... */
|
|
|
|
SET_KERNEL_LAST, /* allow 9 kernels */
|
2006-01-13 01:02:44 +03:00
|
|
|
|
|
|
|
/* System sets */
|
|
|
|
SET_BASE, /* base */
|
|
|
|
SET_ETC, /* /etc */
|
|
|
|
SET_COMPILER, /* compiler tools */
|
2020-05-19 00:19:34 +03:00
|
|
|
SET_DTB, /* devicetree hardware descriptions */
|
2006-01-13 01:02:44 +03:00
|
|
|
SET_GAMES, /* text games */
|
|
|
|
SET_MAN_PAGES, /* online manual pages */
|
|
|
|
SET_MISC, /* miscellaneuous */
|
2009-09-07 06:31:53 +04:00
|
|
|
SET_MODULES, /* kernel modules */
|
2019-10-02 14:15:59 +03:00
|
|
|
SET_RESCUE, /* /rescue recovery tools */
|
2007-11-12 18:07:33 +03:00
|
|
|
SET_TESTS, /* tests */
|
2006-01-13 01:02:44 +03:00
|
|
|
SET_TEXT_TOOLS, /* text processing tools */
|
|
|
|
|
|
|
|
/* X11 sets */
|
|
|
|
SET_X11_FIRST,
|
|
|
|
SET_X11_BASE, /* X11 base and clients */
|
|
|
|
SET_X11_FONTS, /* X11 fonts */
|
|
|
|
SET_X11_SERVERS, /* X11 servers */
|
|
|
|
SET_X11_PROG, /* X11 programming */
|
|
|
|
SET_X11_ETC, /* X11 config */
|
|
|
|
SET_X11_LAST,
|
|
|
|
|
2011-07-01 00:09:15 +04:00
|
|
|
/* Machine dependent sets */
|
|
|
|
SET_MD_1, /* Machine dependent set */
|
|
|
|
SET_MD_2, /* Machine dependent set */
|
|
|
|
SET_MD_3, /* Machine dependent set */
|
|
|
|
SET_MD_4, /* Machine dependent set */
|
2021-02-01 01:45:46 +03:00
|
|
|
|
2012-01-11 01:02:47 +04:00
|
|
|
/* Source sets */
|
|
|
|
SET_SYSSRC,
|
|
|
|
SET_SRC,
|
|
|
|
SET_SHARESRC,
|
|
|
|
SET_GNUSRC,
|
|
|
|
SET_XSRC,
|
2006-01-13 01:02:44 +03:00
|
|
|
|
2013-03-16 21:10:16 +04:00
|
|
|
/* Debug sets */
|
|
|
|
SET_DEBUG,
|
2013-03-17 02:16:02 +04:00
|
|
|
SET_X11_DEBUG,
|
2013-03-16 21:10:16 +04:00
|
|
|
|
2006-01-13 01:02:44 +03:00
|
|
|
SET_LAST,
|
|
|
|
SET_GROUP, /* Start of submenu */
|
|
|
|
SET_GROUP_END, /* End of submenu */
|
2012-04-07 03:48:53 +04:00
|
|
|
SET_PKGSRC, /* pkgsrc, not counted as regular set */
|
2006-01-13 01:02:44 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/* Initialisers to select sets */
|
|
|
|
/* All kernels */
|
|
|
|
#define SET_KERNEL SET_KERNEL_1, SET_KERNEL_2, SET_KERNEL_3, SET_KERNEL_4, \
|
|
|
|
SET_KERNEL_5, SET_KERNEL_6, SET_KERNEL_7, SET_KERNEL_8
|
2020-10-30 21:47:38 +03:00
|
|
|
#ifdef HAVE_MODULES
|
|
|
|
#define WITH_MODULES SET_MODULES,
|
|
|
|
#else
|
|
|
|
#define WITH_MODULES
|
|
|
|
#endif
|
2006-09-04 06:20:40 +04:00
|
|
|
/* Core system sets */
|
2020-05-19 00:19:34 +03:00
|
|
|
#ifdef HAVE_DTB
|
2020-10-30 21:47:38 +03:00
|
|
|
#define SET_CORE WITH_MODULES SET_BASE, SET_DTB, SET_ETC
|
2020-05-19 00:19:34 +03:00
|
|
|
#else
|
2020-10-30 21:47:38 +03:00
|
|
|
#define SET_CORE WITH_MODULES SET_BASE, SET_ETC
|
2020-05-19 00:19:34 +03:00
|
|
|
#endif
|
2006-01-13 01:02:44 +03:00
|
|
|
/* All system sets */
|
2006-09-04 06:20:40 +04:00
|
|
|
#define SET_SYSTEM SET_CORE, SET_COMPILER, SET_GAMES, \
|
2019-10-02 14:15:59 +03:00
|
|
|
SET_MAN_PAGES, SET_MISC, SET_RESCUE, \
|
|
|
|
SET_TESTS, SET_TEXT_TOOLS
|
2006-01-13 01:02:44 +03:00
|
|
|
/* All X11 sets */
|
|
|
|
#define SET_X11_NOSERVERS SET_X11_BASE, SET_X11_FONTS, SET_X11_PROG, SET_X11_ETC
|
|
|
|
#define SET_X11 SET_X11_NOSERVERS, SET_X11_SERVERS
|
|
|
|
|
2011-07-01 00:09:15 +04:00
|
|
|
/* All machine dependent sets */
|
2006-01-13 01:02:44 +03:00
|
|
|
#define SET_MD SET_MD_1, SET_MD_2, SET_MD_3, SET_MD_4
|
2003-06-12 01:35:35 +04:00
|
|
|
|
2012-01-11 01:02:47 +04:00
|
|
|
/* All source sets */
|
|
|
|
#define SET_SOURCE SET_SYSSRC, SET_SRC, SET_SHARESRC, SET_GNUSRC, SET_XSRC
|
|
|
|
|
2013-03-16 21:10:16 +04:00
|
|
|
/* All debug sets */
|
2013-03-17 02:16:02 +04:00
|
|
|
#define SET_DEBUGGING SET_DEBUG, SET_X11_DEBUG
|
2013-03-16 21:10:16 +04:00
|
|
|
|
2011-02-01 04:42:07 +03:00
|
|
|
/* Set list flags */
|
|
|
|
#define SFLAG_MINIMAL 1
|
|
|
|
#define SFLAG_NOX 2
|
|
|
|
|
1997-09-27 03:02:53 +04:00
|
|
|
/* Round up to the next full cylinder size */
|
2003-06-05 00:05:12 +04:00
|
|
|
#define NUMSEC(size, sizemult, cylsize) \
|
2019-06-12 09:20:17 +03:00
|
|
|
((sizemult) == 1 ? (size) : \
|
2006-10-05 01:27:27 +04:00
|
|
|
roundup((size) * (sizemult), (cylsize)))
|
1997-12-10 07:36:19 +03:00
|
|
|
|
extend sysinst disk handling, some general clean ups, better /etc support
and some sparc64 fixes. details:
- new scripting_{,v}fprintf() that also write to the script log (if open).
- support of creation of LFS filesystems
- standard installs now allow one to choose which file systems to create,
out of the list of /usr, /var, /home, MFS /tmp, and swap. a / is always
created, but the rest all optional. [*]
- new disklabel method: use existing. this requires one to fill in the
mount points (and having at least a "/" is enforced).
- preservation of existing filesystems (at install) is supported.
- rewrote most of make_fstab(): the entire thing is generated from the
bsdlabel now, rather than hard coding / to 'a' and swap to 'b'. create
MFS /tmp if requested.
- if IPv6 support isn't present, don't display any ipv6 messages.
- better rc.conf support
- sparc & sparc64 default to "cylinders" now.
- choosing "standard" instead of "standard with X" de-selects the X pkgs
by default.
- sparc64: don't install bootblocks until we have a complete system, avoids
booting with no /dev/console.
- sparc64: bump STDNEEDMB, it is way low.
[*] i have added default values for DEFVARSIZE & DEFUSRSIZE (this is used
only if /usr and /home are selected) to each port, based on STDNEEDMB. as
such, my guesses might be wrong so port maintainers should look at these.
2001-01-14 05:38:13 +03:00
|
|
|
/* What FS type? */
|
2019-06-12 09:20:17 +03:00
|
|
|
#define PI_ISBSDFS(PI) (PI_FSTYPE(PI) == FS_BSDLFS || \
|
|
|
|
PI_FSTYPE(PI) == FS_BSDFFS)
|
extend sysinst disk handling, some general clean ups, better /etc support
and some sparc64 fixes. details:
- new scripting_{,v}fprintf() that also write to the script log (if open).
- support of creation of LFS filesystems
- standard installs now allow one to choose which file systems to create,
out of the list of /usr, /var, /home, MFS /tmp, and swap. a / is always
created, but the rest all optional. [*]
- new disklabel method: use existing. this requires one to fill in the
mount points (and having at least a "/" is enforced).
- preservation of existing filesystems (at install) is supported.
- rewrote most of make_fstab(): the entire thing is generated from the
bsdlabel now, rather than hard coding / to 'a' and swap to 'b'. create
MFS /tmp if requested.
- if IPv6 support isn't present, don't display any ipv6 messages.
- better rc.conf support
- sparc & sparc64 default to "cylinders" now.
- choosing "standard" instead of "standard with X" de-selects the X pkgs
by default.
- sparc64: don't install bootblocks until we have a complete system, avoids
booting with no /dev/console.
- sparc64: bump STDNEEDMB, it is way low.
[*] i have added default values for DEFVARSIZE & DEFUSRSIZE (this is used
only if /usr and /home are selected) to each port, based on STDNEEDMB. as
such, my guesses might be wrong so port maintainers should look at these.
2001-01-14 05:38:13 +03:00
|
|
|
|
2018-11-11 12:17:10 +03:00
|
|
|
/*
|
|
|
|
* We do not offer CDs or floppies as installation target usually.
|
|
|
|
* Architectures might want to undefine if they want to allow
|
|
|
|
* these devices or redefine if they have unusual CD device names.
|
|
|
|
* Do not define to empty or an empty string, undefine instead.
|
|
|
|
*/
|
2018-11-08 00:20:23 +03:00
|
|
|
#define CD_NAMES "cd*"
|
2018-11-11 12:17:10 +03:00
|
|
|
#define FLOPPY_NAMES "fd*"
|
2011-01-26 13:58:19 +03:00
|
|
|
|
1997-10-29 04:06:42 +03:00
|
|
|
/* Types */
|
2015-05-10 13:14:02 +03:00
|
|
|
|
|
|
|
/* pass a void* argument into a menu and also provide a int return value */
|
|
|
|
typedef struct arg_rv {
|
|
|
|
void *arg;
|
|
|
|
int rv;
|
|
|
|
} arg_rv;
|
|
|
|
|
2019-06-12 09:20:17 +03:00
|
|
|
/*
|
|
|
|
* A minimal argument for menus using string replacements
|
|
|
|
*/
|
|
|
|
typedef struct arg_replace {
|
|
|
|
const char **argv;
|
|
|
|
size_t argc;
|
|
|
|
} arg_replace;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* pass a parameter array (for string replacements) into a menu and provide
|
|
|
|
* an integer return value
|
|
|
|
*/
|
|
|
|
typedef struct arg_rep_int {
|
|
|
|
arg_replace args;
|
|
|
|
int rv;
|
|
|
|
} arg_rep_int;
|
|
|
|
|
1997-10-29 04:06:42 +03:00
|
|
|
typedef struct distinfo {
|
2003-07-25 12:26:21 +04:00
|
|
|
const char *name;
|
2004-04-19 01:34:56 +04:00
|
|
|
uint set;
|
2018-10-06 21:45:37 +03:00
|
|
|
bool force_tgz; /* this set is always in .tgz format */
|
2003-06-12 01:35:35 +04:00
|
|
|
const char *desc;
|
2004-04-19 01:34:56 +04:00
|
|
|
const char *marker_file; /* set assumed installed if exists */
|
1997-10-29 04:06:42 +03:00
|
|
|
} distinfo;
|
1997-09-27 03:02:53 +04:00
|
|
|
|
2014-08-03 20:09:38 +04:00
|
|
|
#define MOUNTLEN 20
|
2019-06-12 09:20:17 +03:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A description of a future partition and its usage.
|
|
|
|
* A list of this is the output of the first stage partition
|
|
|
|
* editor, before it gets transformed into a concrete partition
|
|
|
|
* layout according to the partitioning scheme backend.
|
|
|
|
*/
|
|
|
|
struct part_usage_info {
|
2020-01-16 19:47:19 +03:00
|
|
|
daddr_t size; /* thumb guestimate of size,
|
|
|
|
* [sec if positive, %-of-ram
|
|
|
|
* if TMPFS and negative]
|
|
|
|
*/
|
2019-06-12 09:20:17 +03:00
|
|
|
daddr_t def_size; /* default size */
|
|
|
|
daddr_t limit; /* max size */
|
|
|
|
char mount[MOUNTLEN]; /* where will we mount this? */
|
|
|
|
enum part_type type; /* PT_root/PT_swap/PT_EFI_SYSTEM */
|
|
|
|
|
|
|
|
#define PUIFLAG_EXTEND 1 /* extend this part if free space
|
|
|
|
* is available */
|
|
|
|
#define PUIFLAG_ADD_OUTER 2 /* Add this partition to the outer
|
|
|
|
* partitions (if available) */
|
2019-07-12 21:28:08 +03:00
|
|
|
#define PUIFLG_IS_OUTER 4 /* this is an existing outer one */
|
2019-11-12 19:33:14 +03:00
|
|
|
#define PUIFLG_ADD_INNER 8 /* add outer also to inner */
|
2019-07-12 21:28:08 +03:00
|
|
|
#define PUIFLG_JUST_MOUNTPOINT 16 /* tmpfs of mfs mountpoints */
|
2019-11-12 19:33:14 +03:00
|
|
|
#define PUIFLG_CLONE_PARTS 32 /* clone external partitions */
|
2019-06-12 09:20:17 +03:00
|
|
|
uint flags;
|
|
|
|
struct disk_partitions *parts; /* Where does this partition live?
|
|
|
|
* We currently only support
|
|
|
|
* a single disk, but we plan to
|
|
|
|
* extend that.
|
|
|
|
* Use pm->parts to access
|
|
|
|
* the partitions. */
|
|
|
|
part_id cur_part_id; /* this may change, but we try to
|
|
|
|
* fix it up after all changes */
|
|
|
|
daddr_t cur_start; /* may change during editing, just
|
|
|
|
* used as a unique identifier */
|
|
|
|
uint32_t cur_flags; /* PTI_* flags from disk_part_info */
|
|
|
|
|
|
|
|
#define PUIMNT_ASYNC 0x0001 /* mount -o async */
|
|
|
|
#define PUIMNT_NOATIME 0x0002 /* mount -o noatime */
|
|
|
|
#define PUIMNT_NODEV 0x0004 /* mount -o nodev */
|
|
|
|
#define PUIMNT_NODEVMTIME 0x0008 /* mount -o nodevmtime */
|
|
|
|
#define PUIMNT_NOEXEC 0x0010 /* mount -o noexec */
|
|
|
|
#define PUIMNT_NOSUID 0x0020 /* mount -o nosuid */
|
|
|
|
#define PUIMNT_LOG 0x0040 /* mount -o log */
|
|
|
|
#define PUIMNT_NOAUTO 0x0080 /* "noauto" fstab flag */
|
|
|
|
unsigned int mountflags; /* flags for fstab */
|
|
|
|
#define PUIINST_NEWFS 0x0001 /* need to 'newfs' partition */
|
|
|
|
#define PUIINST_MOUNT 0x0002 /* need to mount partition */
|
|
|
|
#define PUIINST_BOOT 0x0004 /* this is a boot partition */
|
|
|
|
unsigned int instflags; /* installer handling flags */
|
|
|
|
uint fs_type, fs_version; /* e.g. FS_LFS, or FS_BSDFS,
|
|
|
|
* version = 2 for FFSv2 */
|
2020-10-13 20:26:28 +03:00
|
|
|
uint fs_opt1, fs_opt2, fs_opt3; /* FS specific, FFS: block/frag */
|
2019-11-13 21:57:26 +03:00
|
|
|
#ifndef NO_CLONES
|
2019-11-12 19:33:14 +03:00
|
|
|
/*
|
|
|
|
* Only != NULL when PUIFLG_CLONE_PARTS is set, describes the
|
|
|
|
* source partitions to clone here.
|
|
|
|
*/
|
|
|
|
struct selected_partitions *clone_src;
|
|
|
|
/*
|
|
|
|
* If clone_src != NULL, this record corresponds to a single
|
|
|
|
* selected source partition, if clone_ndx is a valid index in clone_src
|
|
|
|
* (>= 0 && <= clone_src->num_sel, or all of them if clone_ndx = ~0U.
|
|
|
|
*/
|
|
|
|
size_t clone_ndx;
|
2019-11-13 21:57:26 +03:00
|
|
|
#endif
|
2019-06-12 09:20:17 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A list of partition suggestions, bundled for editing
|
|
|
|
*/
|
|
|
|
struct partition_usage_set {
|
2020-09-22 19:18:54 +03:00
|
|
|
struct disk_partitions *parts; /* main partition table */
|
|
|
|
size_t num; /* number of infos */
|
2019-06-12 09:20:17 +03:00
|
|
|
struct part_usage_info *infos; /* 0 .. num-1 */
|
2020-09-22 19:18:54 +03:00
|
|
|
struct disk_partitions **write_back;
|
|
|
|
/* partition tables from which we
|
|
|
|
* did delete some partitions and
|
|
|
|
* that need updating, even if
|
|
|
|
* no active partition remains. */
|
|
|
|
size_t num_write_back; /* number of write_back */
|
2019-06-12 09:20:17 +03:00
|
|
|
daddr_t cur_free_space; /* estimate of free sectors */
|
2020-10-09 21:33:00 +03:00
|
|
|
daddr_t reserved_space; /* space we are not allowed to use */
|
2019-06-12 09:20:17 +03:00
|
|
|
menu_ent *menu_opts; /* 0 .. num+N */
|
|
|
|
int menu; /* the menu to edit this */
|
|
|
|
bool ok; /* ok to continue (all fit) */
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A structure we pass around in menus that edit a single partition out
|
|
|
|
* of a partition_usage_set.
|
|
|
|
*/
|
|
|
|
struct single_part_fs_edit {
|
|
|
|
struct partition_usage_set *pset;
|
2020-10-13 20:26:28 +03:00
|
|
|
size_t index, first_custom_attr, offset, mode;
|
2019-06-12 09:20:17 +03:00
|
|
|
part_id id;
|
|
|
|
struct disk_part_info info; /* current partition data */
|
|
|
|
struct part_usage_info *wanted; /* points at our edit data */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* "Backup" of old data, so we can restore previous values
|
|
|
|
* ("undo").
|
|
|
|
*/
|
|
|
|
struct part_usage_info old_usage;
|
|
|
|
struct disk_part_info old_info;
|
|
|
|
|
|
|
|
/* menu return value */
|
|
|
|
int rv;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Description of a full target installation, all partitions and
|
|
|
|
* devices (may be accross several struct pm_devs / disks).
|
|
|
|
*/
|
|
|
|
struct install_partition_desc {
|
|
|
|
size_t num; /* how many entries in infos */
|
|
|
|
struct part_usage_info *infos; /* individual partitions */
|
2021-02-01 01:45:46 +03:00
|
|
|
struct disk_partitions **write_back; /* partition tables from
|
2020-09-22 19:18:54 +03:00
|
|
|
* which we did delete some
|
|
|
|
* partitions and that need
|
|
|
|
* updating, even if no
|
|
|
|
* active partition remains. */
|
|
|
|
size_t num_write_back; /* number of write_back */
|
2019-07-23 21:13:40 +03:00
|
|
|
bool cur_system; /* target is the life system */
|
2008-01-24 02:15:37 +03:00
|
|
|
};
|
2003-06-12 01:35:35 +04:00
|
|
|
|
1997-09-27 03:02:53 +04:00
|
|
|
/* variables */
|
|
|
|
|
2020-04-23 02:43:12 +03:00
|
|
|
extern int debug; /* set by -D option */
|
2003-06-25 19:45:21 +04:00
|
|
|
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char machine[SSTRSIZE];
|
1997-09-27 03:02:53 +04:00
|
|
|
|
2020-04-23 02:43:12 +03:00
|
|
|
extern int ignorerror;
|
|
|
|
extern int ttysig_ignore;
|
|
|
|
extern pid_t ttysig_forward;
|
|
|
|
extern uint sizemult;
|
2019-06-12 09:20:17 +03:00
|
|
|
extern const char *multname;
|
|
|
|
extern const char *err_outofmem;
|
2020-04-23 02:43:12 +03:00
|
|
|
extern int partman_go; /* run extended partition manager */
|
1997-09-27 03:02:53 +04:00
|
|
|
|
2014-08-03 20:09:38 +04:00
|
|
|
/* logging variables */
|
1999-01-21 11:02:17 +03:00
|
|
|
|
2020-04-23 02:43:12 +03:00
|
|
|
extern FILE *logfp;
|
|
|
|
extern FILE *script;
|
1999-01-21 11:02:17 +03:00
|
|
|
|
2014-08-03 20:09:38 +04:00
|
|
|
#define MAX_DISKS 15
|
|
|
|
|
2020-04-23 02:43:12 +03:00
|
|
|
extern daddr_t root_limit; /* BIOS (etc) read limit */
|
2003-06-05 00:05:12 +04:00
|
|
|
|
2020-01-09 16:22:30 +03:00
|
|
|
enum SHRED_T { SHRED_NONE=0, SHRED_ZEROS, SHRED_RANDOM };
|
2014-08-03 20:09:38 +04:00
|
|
|
|
|
|
|
/* All information that is unique for each drive */
|
2020-04-23 02:43:12 +03:00
|
|
|
extern SLIST_HEAD(pm_head_t, pm_devs) pm_head;
|
2019-06-12 09:20:17 +03:00
|
|
|
|
|
|
|
struct pm_devs {
|
|
|
|
/*
|
|
|
|
* If device is blocked (e.g. part of a raid)
|
|
|
|
* this is a pointers to the parent dev
|
|
|
|
*/
|
|
|
|
void *refdev;
|
|
|
|
|
|
|
|
char diskdev[SSTRSIZE]; /* Actual name of the disk. */
|
|
|
|
char diskdev_descr[STRSIZE]; /* e.g. IDENTIFY result */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* What the disk layout should look like.
|
|
|
|
*/
|
|
|
|
struct disk_partitions *parts;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The device does not take a MBR, even if we usually use
|
|
|
|
* MBR master / disklabel secondary partitioning.
|
|
|
|
* Used e.g. for raid* pseudo-disks.
|
|
|
|
*/
|
|
|
|
bool no_mbr; /* userd for raid (etc) */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This device can not be partitioned (in any way).
|
|
|
|
* Used for wedges (dk*) or LVM devices.
|
|
|
|
*/
|
|
|
|
bool no_part;
|
|
|
|
|
2019-07-23 21:13:40 +03:00
|
|
|
/*
|
|
|
|
* This is a pseudo-device representing the currently running
|
|
|
|
* system (i.e. all mounted file systems).
|
|
|
|
*/
|
|
|
|
bool cur_system;
|
|
|
|
|
2020-01-28 00:21:21 +03:00
|
|
|
/* Actual values for current disk geometry - set by find_disks() or
|
|
|
|
* md_get_info()
|
|
|
|
*/
|
|
|
|
uint sectorsize, dlcyl, dlhead, dlsec, dlcylsize, current_cylsize;
|
|
|
|
/*
|
|
|
|
* Total size of the disk - in 'sectorsize' units (!)
|
|
|
|
*/
|
|
|
|
daddr_t dlsize; /* total number of disk sectors */
|
2019-06-12 09:20:17 +03:00
|
|
|
|
2020-01-28 00:21:21 +03:00
|
|
|
/* Area of disk we can allocate, start and size in sectors. */
|
2019-06-12 09:20:17 +03:00
|
|
|
daddr_t ptstart, ptsize;
|
|
|
|
|
|
|
|
/* For some bootblocks we need to know the CHS addressable limit */
|
|
|
|
daddr_t max_chs; /* bcyl * bhead * bsec */
|
|
|
|
|
|
|
|
/* If we have an MBR boot partition, start and size in sectors */
|
|
|
|
daddr_t bootstart, bootsize;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* In extended partitioning: all partitions in parts (number of
|
|
|
|
* entries is parts->num_part) may actually be mounted (temporarily)
|
|
|
|
* somewhere, e.g. to access a vnd device on them. This list has
|
|
|
|
* a pointer to the current mount point (strdup()'d) if mounted,
|
|
|
|
* or NULL if not.
|
|
|
|
*/
|
|
|
|
char **mounted;
|
|
|
|
|
|
|
|
bool unsaved; /* Flag indicating to partman that device need saving */
|
|
|
|
bool found; /* Flag to delete unplugged and unconfigured devices */
|
|
|
|
int blocked; /* Device is busy and cannot be changed */
|
|
|
|
|
|
|
|
SLIST_ENTRY(pm_devs) l;
|
|
|
|
};
|
2020-04-23 02:43:12 +03:00
|
|
|
extern struct pm_devs *pm; /* Pointer to current device with which we work */
|
|
|
|
extern struct pm_devs *pm_new; /* Pointer for next allocating device in find_disks() */
|
2014-08-03 20:09:38 +04:00
|
|
|
|
|
|
|
/* Generic structure for partman */
|
2019-06-12 09:20:17 +03:00
|
|
|
struct part_entry {
|
|
|
|
part_id id;
|
|
|
|
struct disk_partitions *parts;
|
|
|
|
void *dev_ptr;
|
2020-01-09 16:22:30 +03:00
|
|
|
size_t index; /* e.g. if PM_RAID: this is raids[index] */
|
2019-06-12 09:20:17 +03:00
|
|
|
int dev_ptr_delta;
|
|
|
|
char fullname[SSTRSIZE];
|
|
|
|
enum {PM_DISK=1, PM_PART, PM_SPEC,
|
|
|
|
PM_RAID, PM_CGD, PM_VND, PM_LVM, PM_LVMLV} type;
|
|
|
|
};
|
1997-09-27 03:02:53 +04:00
|
|
|
|
1997-11-11 03:43:31 +03:00
|
|
|
/* Relative file name for storing a distribution. */
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char xfer_dir[STRSIZE];
|
|
|
|
extern int clean_xfer_dir;
|
1998-10-25 22:15:04 +03:00
|
|
|
|
2002-06-06 13:53:22 +04:00
|
|
|
#if !defined(SYSINST_FTP_HOST)
|
2003-11-30 17:36:43 +03:00
|
|
|
#define SYSINST_FTP_HOST "ftp.NetBSD.org"
|
2000-03-25 00:56:04 +03:00
|
|
|
#endif
|
|
|
|
|
2018-09-11 11:05:18 +03:00
|
|
|
#if !defined(SYSINST_HTTP_HOST)
|
|
|
|
#define SYSINST_HTTP_HOST "cdn.NetBSD.org"
|
|
|
|
#endif
|
|
|
|
|
2002-06-06 13:53:22 +04:00
|
|
|
#if !defined(SYSINST_FTP_DIR)
|
2018-09-05 15:01:52 +03:00
|
|
|
#if defined(NETBSD_OFFICIAL_RELEASE)
|
2004-06-06 01:18:59 +04:00
|
|
|
#define SYSINST_FTP_DIR "pub/NetBSD/NetBSD-" REL
|
2018-09-05 15:49:55 +03:00
|
|
|
#elif defined(REL_PATH)
|
2018-09-16 12:15:12 +03:00
|
|
|
#define SYSINST_FTP_DIR "pub/NetBSD-daily/" REL_PATH "/latest"
|
2018-09-05 15:01:52 +03:00
|
|
|
#else
|
2018-09-05 15:49:55 +03:00
|
|
|
#define SYSINST_FTP_DIR "pub/NetBSD/NetBSD-" REL
|
2018-09-05 15:01:52 +03:00
|
|
|
#endif
|
2002-06-06 13:53:22 +04:00
|
|
|
#endif
|
2000-03-25 00:56:04 +03:00
|
|
|
|
2018-12-16 14:36:08 +03:00
|
|
|
#if !defined(ARCH_SUBDIR)
|
|
|
|
#define ARCH_SUBDIR MACH
|
|
|
|
#endif
|
|
|
|
#if !defined(PKG_ARCH_SUBDIR)
|
|
|
|
#define PKG_ARCH_SUBDIR MACH
|
|
|
|
#endif
|
|
|
|
|
2012-04-07 03:48:53 +04:00
|
|
|
#if !defined(SYSINST_PKG_HOST)
|
2018-09-08 23:01:19 +03:00
|
|
|
#define SYSINST_PKG_HOST "ftp.NetBSD.org"
|
2012-04-07 03:48:53 +04:00
|
|
|
#endif
|
2018-09-11 11:05:18 +03:00
|
|
|
#if !defined(SYSINST_PKG_HTTP_HOST)
|
|
|
|
#define SYSINST_PKG_HTTP_HOST "cdn.NetBSD.org"
|
|
|
|
#endif
|
2012-04-07 03:48:53 +04:00
|
|
|
|
|
|
|
#if !defined(SYSINST_PKG_DIR)
|
|
|
|
#define SYSINST_PKG_DIR "pub/pkgsrc/packages/NetBSD"
|
|
|
|
#endif
|
|
|
|
|
2018-09-12 16:44:05 +03:00
|
|
|
#if !defined(PKG_SUBDIR)
|
|
|
|
#define PKG_SUBDIR REL
|
|
|
|
#endif
|
|
|
|
|
2012-04-07 03:48:53 +04:00
|
|
|
#if !defined(SYSINST_PKGSRC_HOST)
|
|
|
|
#define SYSINST_PKGSRC_HOST SYSINST_PKG_HOST
|
|
|
|
#endif
|
2018-09-11 11:05:18 +03:00
|
|
|
#if !defined(SYSINST_PKGSRC_HTTP_HOST)
|
|
|
|
#define SYSINST_PKGSRC_HTTP_HOST SYSINST_PKG_HTTP_HOST
|
|
|
|
#endif
|
2012-04-07 03:48:53 +04:00
|
|
|
|
2018-10-06 21:45:37 +03:00
|
|
|
#ifndef SETS_TAR_SUFF
|
|
|
|
#define SETS_TAR_SUFF "tgz"
|
|
|
|
#endif
|
|
|
|
|
2019-11-14 16:58:22 +03:00
|
|
|
#ifdef USING_PAXASTAR
|
|
|
|
#define TAR_EXTRACT_FLAGS "-xhepf"
|
|
|
|
#else
|
2020-02-10 17:55:53 +03:00
|
|
|
#define TAR_EXTRACT_FLAGS "-xpf"
|
2019-11-14 16:58:22 +03:00
|
|
|
#endif
|
|
|
|
|
2012-01-11 01:02:47 +04:00
|
|
|
/* Abs. path we extract binary sets from */
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char ext_dir_bin[STRSIZE];
|
2012-01-11 01:02:47 +04:00
|
|
|
|
|
|
|
/* Abs. path we extract source sets from */
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char ext_dir_src[STRSIZE];
|
2012-01-11 01:02:47 +04:00
|
|
|
|
2012-04-07 03:48:53 +04:00
|
|
|
/* Abs. path we extract pkgsrc from */
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char ext_dir_pkgsrc[STRSIZE];
|
2012-04-07 03:48:53 +04:00
|
|
|
|
2012-01-11 01:02:47 +04:00
|
|
|
/* Place we look for binary sets in all fs types */
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char set_dir_bin[STRSIZE];
|
2004-06-06 01:18:59 +04:00
|
|
|
|
2012-01-11 01:02:47 +04:00
|
|
|
/* Place we look for source sets in all fs types */
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char set_dir_src[STRSIZE];
|
2004-06-06 01:18:59 +04:00
|
|
|
|
2012-04-07 03:48:53 +04:00
|
|
|
/* Place we look for pkgs in all fs types */
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char pkg_dir[STRSIZE];
|
2012-04-07 03:48:53 +04:00
|
|
|
|
|
|
|
/* Place we look for pkgsrc in all fs types */
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char pkgsrc_dir[STRSIZE];
|
2012-04-07 03:48:53 +04:00
|
|
|
|
2013-03-20 02:16:52 +04:00
|
|
|
/* User shell */
|
2020-04-23 02:43:12 +03:00
|
|
|
extern const char *ushell;
|
2013-03-20 02:16:52 +04:00
|
|
|
|
2018-09-11 11:05:18 +03:00
|
|
|
#define XFER_FTP 0
|
|
|
|
#define XFER_HTTP 1
|
|
|
|
#define XFER_MAX XFER_HTTP
|
|
|
|
|
2012-04-07 03:48:53 +04:00
|
|
|
struct ftpinfo {
|
2019-06-12 09:20:17 +03:00
|
|
|
char xfer_host[XFER_MAX+1][STRSIZE];
|
|
|
|
char dir[STRSIZE] ;
|
|
|
|
char user[SSTRSIZE];
|
|
|
|
char pass[STRSIZE];
|
|
|
|
char proxy[STRSIZE];
|
|
|
|
unsigned int xfer; /* XFER_FTP for "ftp" or XFER_HTTP for "http" */
|
2012-04-07 03:48:53 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
/* use the same struct for sets ftp and to build pkgpath */
|
2020-04-23 02:43:12 +03:00
|
|
|
extern struct ftpinfo ftp, pkg, pkgsrc;
|
1997-09-27 03:02:53 +04:00
|
|
|
|
2020-04-23 02:43:12 +03:00
|
|
|
extern int (*fetch_fn)(const char *);
|
|
|
|
extern char nfs_host[STRSIZE];
|
|
|
|
extern char nfs_dir[STRSIZE];
|
2020-11-04 17:29:40 +03:00
|
|
|
extern char entropy_file[PATH_MAX];
|
1997-10-15 08:35:17 +04:00
|
|
|
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char cdrom_dev[SSTRSIZE]; /* Typically "cd0a" */
|
|
|
|
extern char fd_dev[SSTRSIZE]; /* Typically "/dev/fd0a" */
|
|
|
|
extern const char *fd_type; /* "msdos", "ffs" or maybe "ados" */
|
1997-10-20 10:13:25 +04:00
|
|
|
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char localfs_dev[SSTRSIZE];
|
|
|
|
extern char localfs_fs[SSTRSIZE];
|
|
|
|
extern char localfs_dir[STRSIZE];
|
1997-11-06 01:45:53 +03:00
|
|
|
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char targetroot_mnt[SSTRSIZE];
|
1998-02-20 05:33:51 +03:00
|
|
|
|
2020-04-23 02:43:12 +03:00
|
|
|
extern int mnt2_mounted;
|
1997-10-20 10:13:25 +04:00
|
|
|
|
2020-04-23 02:43:12 +03:00
|
|
|
extern char dist_postfix[SSTRSIZE];
|
|
|
|
extern char dist_tgz_postfix[SSTRSIZE];
|
1997-11-25 09:53:07 +03:00
|
|
|
|
1997-09-27 03:02:53 +04:00
|
|
|
/* needed prototypes */
|
2003-06-05 00:05:12 +04:00
|
|
|
void set_menu_numopts(int, int);
|
2014-08-03 20:09:38 +04:00
|
|
|
void remove_color_options(void);
|
2014-08-06 14:03:49 +04:00
|
|
|
void remove_raid_options(void);
|
|
|
|
void remove_lvm_options(void);
|
|
|
|
void remove_cgd_options(void);
|
1997-09-27 03:02:53 +04:00
|
|
|
|
|
|
|
/* Machine dependent functions .... */
|
defs.h:
- Re-order the md_*() definitions so they are in the order called
- Add some comments
- Remove obsolete md_set_no_x() definition
- Remove md_copy_filesystem()
- #if defined(DEBUG) declare backtowin(void) to avoid scattering
externs in various md .c files
mbr.[ch]:
- Add a set_bios_geom_with_mbr_guess() which can be called by all
the non x86 ports rather than copying the same code into arc,
bebox, cobalt, evbmips, evbppc, hpcarm, hpcmips, landisk, ofppc,
prep, sandpoint, and zaurus md.c
install.c:
- Remove now unnecessary call to md_copy_filesystem()
upgrade.c:
- Move move_aout_libs() here, and put under #ifdef AOUT2ELF
- Rather than having *every* md_update call wrefresh(curscr),
wmove(stdscr, 0, 0), wclear(stdscr), and wrefresh(stdscr),
move them here
arch/acorn26/md.c:
- Just include arch/acorn32/md.c, but add a note there warning
about this, and while here add a note to i386/md.c that it
is included by amd64
arch/*/md.c:
- By all means "Vive la difference", but we have 38 pairs of md.[ch],
and they could not even agree on the order in which to list the
md hooks, let alone formatting. Sort the md hooks to match the
(now sane) order in def.sh, and try to normalise the formatting
- Also copy across some function level comments everywhere
- Ensure functions only used inside each md.c are defined as static
- Remove some now unused functions
- Some files had enable_rc_conf in #ifdef DEBUG. Add this to all
- bebox, evbppc and sandpoint were still playing broken games with
copying the booted ramdisk to the target disk, the primary result
of which was just to slow things down and ensure the target system
lost the .profile extracted from the sets. Just kill this.
- For some ports md_update() called endwin(), and in others not.
Take a cure from i386/amd64 and a few other more active ports,
and update everything to match (no endwin())
- In a couple of cases correct port names in comments
- ANSIfy some lingering old style functions
- Consistently use "return 0;" rather than "return (0);"
More of the mbr code should be abstracted, along with the
get_ramsize() / set_swap() logic, but this is (more than)
enough for one day...
sysinst built for all ports but only runtime tested on amd64 & i386
2009-09-19 18:57:27 +04:00
|
|
|
void md_init(void);
|
2011-02-01 04:42:07 +03:00
|
|
|
void md_init_set_status(int); /* SFLAG_foo */
|
defs.h:
- Re-order the md_*() definitions so they are in the order called
- Add some comments
- Remove obsolete md_set_no_x() definition
- Remove md_copy_filesystem()
- #if defined(DEBUG) declare backtowin(void) to avoid scattering
externs in various md .c files
mbr.[ch]:
- Add a set_bios_geom_with_mbr_guess() which can be called by all
the non x86 ports rather than copying the same code into arc,
bebox, cobalt, evbmips, evbppc, hpcarm, hpcmips, landisk, ofppc,
prep, sandpoint, and zaurus md.c
install.c:
- Remove now unnecessary call to md_copy_filesystem()
upgrade.c:
- Move move_aout_libs() here, and put under #ifdef AOUT2ELF
- Rather than having *every* md_update call wrefresh(curscr),
wmove(stdscr, 0, 0), wclear(stdscr), and wrefresh(stdscr),
move them here
arch/acorn26/md.c:
- Just include arch/acorn32/md.c, but add a note there warning
about this, and while here add a note to i386/md.c that it
is included by amd64
arch/*/md.c:
- By all means "Vive la difference", but we have 38 pairs of md.[ch],
and they could not even agree on the order in which to list the
md hooks, let alone formatting. Sort the md hooks to match the
(now sane) order in def.sh, and try to normalise the formatting
- Also copy across some function level comments everywhere
- Ensure functions only used inside each md.c are defined as static
- Remove some now unused functions
- Some files had enable_rc_conf in #ifdef DEBUG. Add this to all
- bebox, evbppc and sandpoint were still playing broken games with
copying the booted ramdisk to the target disk, the primary result
of which was just to slow things down and ensure the target system
lost the .profile extracted from the sets. Just kill this.
- For some ports md_update() called endwin(), and in others not.
Take a cure from i386/amd64 and a few other more active ports,
and update everything to match (no endwin())
- In a couple of cases correct port names in comments
- ANSIfy some lingering old style functions
- Consistently use "return 0;" rather than "return (0);"
More of the mbr code should be abstracted, along with the
get_ramsize() / set_swap() logic, but this is (more than)
enough for one day...
sysinst built for all ports but only runtime tested on amd64 & i386
2009-09-19 18:57:27 +04:00
|
|
|
|
|
|
|
/* MD functions if user selects install - in order called */
|
2019-06-12 09:20:17 +03:00
|
|
|
bool md_get_info(struct install_partition_desc*);
|
2020-10-12 19:14:32 +03:00
|
|
|
/* returns -1 to restart partitioning, 0 for error, 1 for success */
|
|
|
|
int md_make_bsd_partitions(struct install_partition_desc*);
|
2019-06-12 09:20:17 +03:00
|
|
|
bool md_check_partitions(struct install_partition_desc*);
|
|
|
|
#ifdef HAVE_GPT
|
|
|
|
/*
|
|
|
|
* New GPT partitions have been written, update bootloader or remember
|
|
|
|
* data untill needed in md_post_newfs
|
|
|
|
*/
|
|
|
|
bool md_gpt_post_write(struct disk_partitions*, part_id root_id,
|
|
|
|
bool root_is_new, part_id efi_id, bool efi_is_new);
|
|
|
|
#endif
|
|
|
|
/*
|
|
|
|
* md_pre_disklabel and md_post_disklabel may be called
|
|
|
|
* multiple times, for each affected device, with the
|
|
|
|
* "inner" partitions pointer of the relevant partitions
|
|
|
|
* passed.
|
|
|
|
*/
|
|
|
|
bool md_pre_disklabel(struct install_partition_desc*, struct disk_partitions*);
|
|
|
|
bool md_post_disklabel(struct install_partition_desc*, struct disk_partitions*);
|
2019-07-13 20:13:36 +03:00
|
|
|
int md_pre_mount(struct install_partition_desc*, size_t);
|
2019-06-12 09:20:17 +03:00
|
|
|
int md_post_newfs(struct install_partition_desc*);
|
|
|
|
int md_post_extract(struct install_partition_desc*);
|
|
|
|
void md_cleanup_install(struct install_partition_desc*);
|
defs.h:
- Re-order the md_*() definitions so they are in the order called
- Add some comments
- Remove obsolete md_set_no_x() definition
- Remove md_copy_filesystem()
- #if defined(DEBUG) declare backtowin(void) to avoid scattering
externs in various md .c files
mbr.[ch]:
- Add a set_bios_geom_with_mbr_guess() which can be called by all
the non x86 ports rather than copying the same code into arc,
bebox, cobalt, evbmips, evbppc, hpcarm, hpcmips, landisk, ofppc,
prep, sandpoint, and zaurus md.c
install.c:
- Remove now unnecessary call to md_copy_filesystem()
upgrade.c:
- Move move_aout_libs() here, and put under #ifdef AOUT2ELF
- Rather than having *every* md_update call wrefresh(curscr),
wmove(stdscr, 0, 0), wclear(stdscr), and wrefresh(stdscr),
move them here
arch/acorn26/md.c:
- Just include arch/acorn32/md.c, but add a note there warning
about this, and while here add a note to i386/md.c that it
is included by amd64
arch/*/md.c:
- By all means "Vive la difference", but we have 38 pairs of md.[ch],
and they could not even agree on the order in which to list the
md hooks, let alone formatting. Sort the md hooks to match the
(now sane) order in def.sh, and try to normalise the formatting
- Also copy across some function level comments everywhere
- Ensure functions only used inside each md.c are defined as static
- Remove some now unused functions
- Some files had enable_rc_conf in #ifdef DEBUG. Add this to all
- bebox, evbppc and sandpoint were still playing broken games with
copying the booted ramdisk to the target disk, the primary result
of which was just to slow things down and ensure the target system
lost the .profile extracted from the sets. Just kill this.
- For some ports md_update() called endwin(), and in others not.
Take a cure from i386/amd64 and a few other more active ports,
and update everything to match (no endwin())
- In a couple of cases correct port names in comments
- ANSIfy some lingering old style functions
- Consistently use "return 0;" rather than "return (0);"
More of the mbr code should be abstracted, along with the
get_ramsize() / set_swap() logic, but this is (more than)
enough for one day...
sysinst built for all ports but only runtime tested on amd64 & i386
2009-09-19 18:57:27 +04:00
|
|
|
|
|
|
|
/* MD functions if user selects upgrade - in order called */
|
2019-06-12 09:20:17 +03:00
|
|
|
int md_pre_update(struct install_partition_desc*);
|
|
|
|
int md_update(struct install_partition_desc*);
|
defs.h:
- Re-order the md_*() definitions so they are in the order called
- Add some comments
- Remove obsolete md_set_no_x() definition
- Remove md_copy_filesystem()
- #if defined(DEBUG) declare backtowin(void) to avoid scattering
externs in various md .c files
mbr.[ch]:
- Add a set_bios_geom_with_mbr_guess() which can be called by all
the non x86 ports rather than copying the same code into arc,
bebox, cobalt, evbmips, evbppc, hpcarm, hpcmips, landisk, ofppc,
prep, sandpoint, and zaurus md.c
install.c:
- Remove now unnecessary call to md_copy_filesystem()
upgrade.c:
- Move move_aout_libs() here, and put under #ifdef AOUT2ELF
- Rather than having *every* md_update call wrefresh(curscr),
wmove(stdscr, 0, 0), wclear(stdscr), and wrefresh(stdscr),
move them here
arch/acorn26/md.c:
- Just include arch/acorn32/md.c, but add a note there warning
about this, and while here add a note to i386/md.c that it
is included by amd64
arch/*/md.c:
- By all means "Vive la difference", but we have 38 pairs of md.[ch],
and they could not even agree on the order in which to list the
md hooks, let alone formatting. Sort the md hooks to match the
(now sane) order in def.sh, and try to normalise the formatting
- Also copy across some function level comments everywhere
- Ensure functions only used inside each md.c are defined as static
- Remove some now unused functions
- Some files had enable_rc_conf in #ifdef DEBUG. Add this to all
- bebox, evbppc and sandpoint were still playing broken games with
copying the booted ramdisk to the target disk, the primary result
of which was just to slow things down and ensure the target system
lost the .profile extracted from the sets. Just kill this.
- For some ports md_update() called endwin(), and in others not.
Take a cure from i386/amd64 and a few other more active ports,
and update everything to match (no endwin())
- In a couple of cases correct port names in comments
- ANSIfy some lingering old style functions
- Consistently use "return 0;" rather than "return (0);"
More of the mbr code should be abstracted, along with the
get_ramsize() / set_swap() logic, but this is (more than)
enough for one day...
sysinst built for all ports but only runtime tested on amd64 & i386
2009-09-19 18:57:27 +04:00
|
|
|
/* Also calls md_post_extract() */
|
1997-09-27 03:02:53 +04:00
|
|
|
|
1997-12-04 12:05:35 +03:00
|
|
|
/* from main.c */
|
2003-05-19 00:40:09 +04:00
|
|
|
void toplevel(void);
|
1997-12-04 12:05:35 +03:00
|
|
|
|
1997-10-15 08:35:17 +04:00
|
|
|
/* from disks.c */
|
2018-11-08 00:20:23 +03:00
|
|
|
bool get_default_cdrom(char *, size_t);
|
2019-07-23 21:13:40 +03:00
|
|
|
int find_disks(const char *, bool);
|
2018-11-08 23:29:37 +03:00
|
|
|
bool enumerate_disks(void *state,bool (*func)(void *state, const char *dev));
|
2018-11-11 13:06:09 +03:00
|
|
|
bool is_cdrom_device(const char *dev, bool as_target);
|
2018-11-14 05:30:00 +03:00
|
|
|
bool is_bootable_device(const char *dev);
|
|
|
|
bool is_partitionable_device(const char *dev);
|
2019-06-12 09:20:17 +03:00
|
|
|
bool convert_scheme(struct pm_devs *p, bool is_boot_drive, const char **err_msg);
|
2019-11-13 21:57:26 +03:00
|
|
|
|
|
|
|
#ifndef NO_CLONES
|
2019-11-12 19:33:14 +03:00
|
|
|
/* a single partition selected for cloning (etc) */
|
|
|
|
struct selected_partition {
|
|
|
|
struct disk_partitions *parts;
|
|
|
|
part_id id;
|
|
|
|
};
|
|
|
|
struct selected_partitions {
|
|
|
|
struct selected_partition *selection;
|
|
|
|
size_t num_sel;
|
|
|
|
bool with_data; /* partitions and their data selected */
|
|
|
|
bool free_parts; /* caller should free parts */
|
|
|
|
};
|
|
|
|
bool select_partitions(struct selected_partitions *res,
|
|
|
|
const struct disk_partitions *ignore);
|
|
|
|
daddr_t selected_parts_size(struct selected_partitions *);
|
|
|
|
void free_selected_partitions(struct selected_partitions *);
|
|
|
|
|
|
|
|
struct clone_target_menu_data {
|
|
|
|
struct partition_usage_set usage;
|
|
|
|
int res;
|
|
|
|
};
|
|
|
|
|
|
|
|
int clone_target_select(menudesc *m, void *arg);
|
|
|
|
bool clone_partition_data(struct disk_partitions *dest_parts, part_id did,
|
|
|
|
struct disk_partitions *src_parts, part_id sid);
|
2019-11-13 21:57:26 +03:00
|
|
|
#endif
|
2018-11-08 23:29:37 +03:00
|
|
|
|
2003-07-07 16:30:19 +04:00
|
|
|
struct menudesc;
|
2003-05-19 00:40:09 +04:00
|
|
|
void disp_cur_fspart(int, int);
|
2019-06-12 09:20:17 +03:00
|
|
|
int make_filesystems(struct install_partition_desc *);
|
|
|
|
int make_fstab(struct install_partition_desc *);
|
|
|
|
int mount_disks(struct install_partition_desc *);
|
2020-05-12 20:26:43 +03:00
|
|
|
/*
|
|
|
|
* set_swap_if_low_ram and set_swap return -1 on error,
|
|
|
|
* 0 if no swap was added on purpose and
|
|
|
|
* 1 if swap has been added (and needs to be cleared later).
|
|
|
|
*/
|
2019-06-12 09:20:17 +03:00
|
|
|
int set_swap_if_low_ram(struct install_partition_desc *);
|
|
|
|
int set_swap(struct install_partition_desc *);
|
2020-05-12 20:26:43 +03:00
|
|
|
void clear_swap(void);
|
2003-06-16 14:42:47 +04:00
|
|
|
int check_swap(const char *, int);
|
2019-06-12 09:20:17 +03:00
|
|
|
char *bootxx_name(struct install_partition_desc *);
|
2014-08-03 20:09:38 +04:00
|
|
|
int get_dkwedges(struct dkwedge_info **, const char *);
|
1997-09-27 03:02:53 +04:00
|
|
|
|
extend sysinst disk handling, some general clean ups, better /etc support
and some sparc64 fixes. details:
- new scripting_{,v}fprintf() that also write to the script log (if open).
- support of creation of LFS filesystems
- standard installs now allow one to choose which file systems to create,
out of the list of /usr, /var, /home, MFS /tmp, and swap. a / is always
created, but the rest all optional. [*]
- new disklabel method: use existing. this requires one to fill in the
mount points (and having at least a "/" is enforced).
- preservation of existing filesystems (at install) is supported.
- rewrote most of make_fstab(): the entire thing is generated from the
bsdlabel now, rather than hard coding / to 'a' and swap to 'b'. create
MFS /tmp if requested.
- if IPv6 support isn't present, don't display any ipv6 messages.
- better rc.conf support
- sparc & sparc64 default to "cylinders" now.
- choosing "standard" instead of "standard with X" de-selects the X pkgs
by default.
- sparc64: don't install bootblocks until we have a complete system, avoids
booting with no /dev/console.
- sparc64: bump STDNEEDMB, it is way low.
[*] i have added default values for DEFVARSIZE & DEFUSRSIZE (this is used
only if /usr and /home are selected) to each port, based on STDNEEDMB. as
such, my guesses might be wrong so port maintainers should look at these.
2001-01-14 05:38:13 +03:00
|
|
|
/* from disks_lfs.c */
|
2003-05-19 00:40:09 +04:00
|
|
|
int fs_is_lfs(void *);
|
extend sysinst disk handling, some general clean ups, better /etc support
and some sparc64 fixes. details:
- new scripting_{,v}fprintf() that also write to the script log (if open).
- support of creation of LFS filesystems
- standard installs now allow one to choose which file systems to create,
out of the list of /usr, /var, /home, MFS /tmp, and swap. a / is always
created, but the rest all optional. [*]
- new disklabel method: use existing. this requires one to fill in the
mount points (and having at least a "/" is enforced).
- preservation of existing filesystems (at install) is supported.
- rewrote most of make_fstab(): the entire thing is generated from the
bsdlabel now, rather than hard coding / to 'a' and swap to 'b'. create
MFS /tmp if requested.
- if IPv6 support isn't present, don't display any ipv6 messages.
- better rc.conf support
- sparc & sparc64 default to "cylinders" now.
- choosing "standard" instead of "standard with X" de-selects the X pkgs
by default.
- sparc64: don't install bootblocks until we have a complete system, avoids
booting with no /dev/console.
- sparc64: bump STDNEEDMB, it is way low.
[*] i have added default values for DEFVARSIZE & DEFUSRSIZE (this is used
only if /usr and /home are selected) to each port, based on STDNEEDMB. as
such, my guesses might be wrong so port maintainers should look at these.
2001-01-14 05:38:13 +03:00
|
|
|
|
1997-12-04 14:27:56 +03:00
|
|
|
/* from label.c */
|
2019-06-12 09:20:17 +03:00
|
|
|
/*
|
|
|
|
* Bits valid for "flags" in get_last_mounted.
|
|
|
|
* Currently we return the real last mount from FFS, the volume label
|
|
|
|
* from FAT32, and nothing otherwise. The NTFS support is currently
|
|
|
|
* restricted to verify the partition has an NTFS (as some partitioning
|
|
|
|
* schemes do not tell NTFS from FAT).
|
|
|
|
*/
|
|
|
|
#define GLM_LIKELY_FFS 1U
|
|
|
|
#define GLM_MAYBE_FAT32 2U
|
|
|
|
#define GLM_MAYBE_NTFS 4U
|
|
|
|
/*
|
|
|
|
* possible fs_sub_types are currently:
|
|
|
|
* FS_BSDFFS:
|
|
|
|
* 0 unknown
|
|
|
|
* 1 FFSv1
|
|
|
|
* 2 FFSv2
|
|
|
|
* FS_MSDOS:
|
|
|
|
* 0 unknown
|
|
|
|
* else MBR_PTYPE_FAT* for the current FAT variant
|
|
|
|
* FS_NTFS:
|
|
|
|
* 0 unknown
|
|
|
|
* else MBR_PTYPE_NTFS (if valid NTFS was found)
|
|
|
|
*
|
|
|
|
* The fs_type and fs_sub_type pointers may be NULL.
|
|
|
|
*/
|
|
|
|
const char *get_last_mounted(int fd, daddr_t offset, uint *fs_type,
|
|
|
|
uint *fs_sub_type, uint flags);
|
2019-07-26 11:18:47 +03:00
|
|
|
void canonicalize_last_mounted(char*);
|
2020-01-09 16:22:30 +03:00
|
|
|
int edit_and_check_label(struct pm_devs *p, struct partition_usage_set *pset, bool install);
|
2014-08-03 20:09:38 +04:00
|
|
|
int edit_ptn(menudesc *, void *);
|
2019-06-12 09:20:17 +03:00
|
|
|
int checkoverlap(struct disk_partitions *parts);
|
2020-09-29 17:29:56 +03:00
|
|
|
daddr_t getpartsize(struct disk_partitions *parts, daddr_t orig_start,
|
|
|
|
daddr_t partstart, daddr_t defpartsize);
|
2019-06-12 09:20:17 +03:00
|
|
|
daddr_t getpartoff(struct disk_partitions *parts, daddr_t defpartstart);
|
1997-12-04 14:27:56 +03:00
|
|
|
|
1997-10-15 08:35:17 +04:00
|
|
|
/* from install.c */
|
2003-05-19 00:40:09 +04:00
|
|
|
void do_install(void);
|
1997-09-27 03:02:53 +04:00
|
|
|
|
|
|
|
/* from factor.c */
|
2003-05-19 00:40:09 +04:00
|
|
|
void factor(long, long *, int, int *);
|
1997-10-15 08:35:17 +04:00
|
|
|
|
1999-03-31 04:44:48 +04:00
|
|
|
/* from fdisk.c */
|
2003-05-19 00:40:09 +04:00
|
|
|
void get_disk_info(char *);
|
|
|
|
void set_disk_info(char *);
|
1999-03-31 04:44:48 +04:00
|
|
|
|
1997-10-15 08:35:17 +04:00
|
|
|
/* from geom.c */
|
2019-06-22 00:54:39 +03:00
|
|
|
bool disk_ioctl(const char *, unsigned long, void *);
|
|
|
|
bool get_wedge_list(const char *, struct dkwedge_list *);
|
|
|
|
bool get_wedge_info(const char *, struct dkwedge_info *);
|
|
|
|
bool get_disk_geom(const char *, struct disk_geom *);
|
|
|
|
bool get_label_geom(const char *, struct disklabel *);
|
1997-09-27 03:02:53 +04:00
|
|
|
|
|
|
|
/* from net.c */
|
2012-04-07 03:48:53 +04:00
|
|
|
extern int network_up;
|
2014-09-13 04:38:36 +04:00
|
|
|
extern char net_namesvr[STRSIZE];
|
2018-09-11 11:05:18 +03:00
|
|
|
int get_via_ftp(unsigned int);
|
2003-05-19 00:40:09 +04:00
|
|
|
int get_via_nfs(void);
|
|
|
|
int config_network(void);
|
|
|
|
void mnt_net_config(void);
|
2012-04-07 03:48:53 +04:00
|
|
|
void make_url(char *, struct ftpinfo *, const char *);
|
|
|
|
int get_pkgsrc(void);
|
2018-09-11 11:05:18 +03:00
|
|
|
const char *url_proto(unsigned int);
|
1997-09-27 03:02:53 +04:00
|
|
|
|
1997-10-15 08:35:17 +04:00
|
|
|
/* From run.c */
|
2012-01-06 01:22:49 +04:00
|
|
|
int collect(int, char **, const char *, ...) __printflike(3, 4);
|
|
|
|
int run_program(int, const char *, ...) __printflike(2, 3);
|
2003-05-19 00:40:09 +04:00
|
|
|
void do_logging(void);
|
|
|
|
int do_system(const char *);
|
1997-10-15 08:35:17 +04:00
|
|
|
|
|
|
|
/* from upgrade.c */
|
2003-05-19 00:40:09 +04:00
|
|
|
void do_upgrade(void);
|
2019-07-23 19:02:32 +03:00
|
|
|
void do_reinstall_sets(void);
|
2003-07-18 13:44:20 +04:00
|
|
|
void restore_etc(void);
|
1997-09-27 03:02:53 +04:00
|
|
|
|
2019-06-12 09:20:17 +03:00
|
|
|
/* from part_edit.c */
|
|
|
|
int err_msg_win(const char*);
|
|
|
|
const struct disk_partitioning_scheme *select_part_scheme(struct pm_devs *dev,
|
|
|
|
const struct disk_partitioning_scheme *skip, bool bootable,
|
|
|
|
const char *title);
|
2020-10-12 19:14:32 +03:00
|
|
|
/*
|
|
|
|
* return value:
|
|
|
|
* 0 -> abort
|
|
|
|
* 1 -> ok, continue
|
|
|
|
* -1 -> partitions have been deleted, start from scratch
|
|
|
|
*/
|
|
|
|
int edit_outer_parts(struct disk_partitions*);
|
2019-06-12 09:20:17 +03:00
|
|
|
bool parts_use_wholedisk(struct disk_partitions*,
|
|
|
|
size_t add_ext_parts, const struct disk_part_info *ext_parts);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Machine dependent partitioning function, only used when
|
|
|
|
* innern/outer partitioning schemes are in use - this sets
|
|
|
|
* up the outer scheme for maximum NetBSD usage.
|
|
|
|
*/
|
|
|
|
bool md_parts_use_wholedisk(struct disk_partitions*);
|
|
|
|
|
1997-09-27 03:02:53 +04:00
|
|
|
/* from util.c */
|
2019-08-27 17:11:00 +03:00
|
|
|
bool root_is_read_only(void);
|
2019-06-12 09:20:17 +03:00
|
|
|
void get_ptn_alignment(const struct disk_partitions *parts, daddr_t *align, daddr_t *p0off);
|
2019-11-12 19:33:14 +03:00
|
|
|
struct disk_partitions *get_inner_parts(struct disk_partitions *parts);
|
2018-11-19 20:17:43 +03:00
|
|
|
char* str_arg_subst(const char *, size_t, const char **);
|
2018-11-15 13:23:32 +03:00
|
|
|
void msg_display_subst(const char *, size_t, ...);
|
2019-06-12 09:20:17 +03:00
|
|
|
void msg_display_add_subst(const char *, size_t, ...);
|
2015-05-11 16:07:57 +03:00
|
|
|
int ask_yesno(const char *);
|
|
|
|
int ask_noyes(const char *);
|
2019-06-12 09:20:17 +03:00
|
|
|
void hit_enter_to_continue(const char *msg, const char *title);
|
|
|
|
/*
|
|
|
|
* return value:
|
|
|
|
* 0 -> abort
|
|
|
|
* 1 -> re-edit
|
|
|
|
* 2 -> continue installation
|
|
|
|
*/
|
|
|
|
int ask_reedit(const struct disk_partitions *);
|
2003-05-19 00:40:09 +04:00
|
|
|
int dir_exists_p(const char *);
|
|
|
|
int file_exists_p(const char *);
|
|
|
|
int file_mode_match(const char *, unsigned int);
|
2019-06-12 09:20:17 +03:00
|
|
|
uint64_t get_ramsize(void); /* in MB! */
|
2003-05-19 00:40:09 +04:00
|
|
|
void ask_sizemult(int);
|
|
|
|
void run_makedev(void);
|
2011-03-25 01:01:13 +03:00
|
|
|
int boot_media_still_needed(void);
|
2003-05-19 00:40:09 +04:00
|
|
|
int get_via_floppy(void);
|
|
|
|
int get_via_cdrom(void);
|
|
|
|
int get_via_localfs(void);
|
|
|
|
int get_via_localdir(void);
|
|
|
|
void show_cur_distsets(void);
|
|
|
|
void make_ramdisk_dir(const char *);
|
2006-01-13 01:02:44 +03:00
|
|
|
void set_kernel_set(unsigned int);
|
2020-01-21 00:26:35 +03:00
|
|
|
void set_noextract_set(unsigned int);
|
2006-01-13 01:02:44 +03:00
|
|
|
unsigned int get_kernel_set(void);
|
|
|
|
unsigned int set_X11_selected(void);
|
2004-06-06 01:18:59 +04:00
|
|
|
int get_and_unpack_sets(int, msg, msg, msg);
|
2003-05-19 00:40:09 +04:00
|
|
|
int sanity_check(void);
|
|
|
|
int set_timezone(void);
|
2012-01-06 01:22:49 +04:00
|
|
|
void scripting_fprintf(FILE *, const char *, ...) __printflike(2, 3);
|
|
|
|
void scripting_vfprintf(FILE *, const char *, va_list) __printflike(2, 0);
|
2019-06-20 18:56:41 +03:00
|
|
|
void add_rc_conf(const char *, ...) __printflike(1, 2);
|
2012-04-07 03:48:53 +04:00
|
|
|
int del_rc_conf(const char *);
|
2012-01-06 01:22:49 +04:00
|
|
|
void add_sysctl_conf(const char *, ...) __printflike(1, 2);
|
2003-10-20 00:17:31 +04:00
|
|
|
void enable_rc_conf(void);
|
2020-01-28 00:21:21 +03:00
|
|
|
void set_sizemult(daddr_t, uint bps);
|
|
|
|
void set_default_sizemult(const char *disk, daddr_t unit, uint bps);
|
extend sysinst disk handling, some general clean ups, better /etc support
and some sparc64 fixes. details:
- new scripting_{,v}fprintf() that also write to the script log (if open).
- support of creation of LFS filesystems
- standard installs now allow one to choose which file systems to create,
out of the list of /usr, /var, /home, MFS /tmp, and swap. a / is always
created, but the rest all optional. [*]
- new disklabel method: use existing. this requires one to fill in the
mount points (and having at least a "/" is enforced).
- preservation of existing filesystems (at install) is supported.
- rewrote most of make_fstab(): the entire thing is generated from the
bsdlabel now, rather than hard coding / to 'a' and swap to 'b'. create
MFS /tmp if requested.
- if IPv6 support isn't present, don't display any ipv6 messages.
- better rc.conf support
- sparc & sparc64 default to "cylinders" now.
- choosing "standard" instead of "standard with X" de-selects the X pkgs
by default.
- sparc64: don't install bootblocks until we have a complete system, avoids
booting with no /dev/console.
- sparc64: bump STDNEEDMB, it is way low.
[*] i have added default values for DEFVARSIZE & DEFUSRSIZE (this is used
only if /usr and /home are selected) to each port, based on STDNEEDMB. as
such, my guesses might be wrong so port maintainers should look at these.
2001-01-14 05:38:13 +03:00
|
|
|
int check_lfs_progs(void);
|
2006-09-04 06:20:40 +04:00
|
|
|
void init_set_status(int);
|
2003-06-12 01:35:35 +04:00
|
|
|
void customise_sets(void);
|
2003-10-20 00:17:31 +04:00
|
|
|
void umount_mnt2(void);
|
2012-01-11 01:02:47 +04:00
|
|
|
int set_is_source(const char *);
|
|
|
|
const char *set_dir_for_set(const char *);
|
|
|
|
const char *ext_dir_for_set(const char *);
|
2019-06-20 18:56:41 +03:00
|
|
|
void replace(const char *, const char *, ...) __printflike(2, 3);
|
2012-04-07 03:48:53 +04:00
|
|
|
void get_tz_default(void);
|
2020-01-21 00:26:35 +03:00
|
|
|
distinfo* get_set_distinfo(int);
|
2012-04-07 03:48:53 +04:00
|
|
|
int extract_file(distinfo *, int);
|
2020-01-21 00:26:35 +03:00
|
|
|
int extract_file_to(distinfo *dist, int update, const char *dest_dir,
|
|
|
|
const char *extr_pattern, bool do_stats);
|
2014-08-03 20:09:38 +04:00
|
|
|
void do_coloring (unsigned int, unsigned int);
|
|
|
|
int set_menu_select(menudesc *, void *);
|
2014-10-14 20:35:20 +04:00
|
|
|
const char *safectime(time_t *);
|
2018-10-06 21:45:37 +03:00
|
|
|
bool use_tgz_for_set(const char*);
|
|
|
|
const char *set_postfix(const char*);
|
2019-06-12 09:20:17 +03:00
|
|
|
bool usage_set_from_parts(struct partition_usage_set*,
|
|
|
|
struct disk_partitions*);
|
|
|
|
void free_usage_set(struct partition_usage_set*);
|
|
|
|
bool install_desc_from_parts(struct install_partition_desc *,
|
|
|
|
struct disk_partitions*);
|
|
|
|
void free_install_desc(struct install_partition_desc*);
|
2020-01-21 00:26:35 +03:00
|
|
|
bool may_swap_if_not_sdmmc(const char*);
|
2020-11-04 17:29:40 +03:00
|
|
|
bool do_check_entropy(void);
|
1997-11-02 12:41:57 +03:00
|
|
|
|
|
|
|
/* from target.c */
|
defs.h:
- Re-order the md_*() definitions so they are in the order called
- Add some comments
- Remove obsolete md_set_no_x() definition
- Remove md_copy_filesystem()
- #if defined(DEBUG) declare backtowin(void) to avoid scattering
externs in various md .c files
mbr.[ch]:
- Add a set_bios_geom_with_mbr_guess() which can be called by all
the non x86 ports rather than copying the same code into arc,
bebox, cobalt, evbmips, evbppc, hpcarm, hpcmips, landisk, ofppc,
prep, sandpoint, and zaurus md.c
install.c:
- Remove now unnecessary call to md_copy_filesystem()
upgrade.c:
- Move move_aout_libs() here, and put under #ifdef AOUT2ELF
- Rather than having *every* md_update call wrefresh(curscr),
wmove(stdscr, 0, 0), wclear(stdscr), and wrefresh(stdscr),
move them here
arch/acorn26/md.c:
- Just include arch/acorn32/md.c, but add a note there warning
about this, and while here add a note to i386/md.c that it
is included by amd64
arch/*/md.c:
- By all means "Vive la difference", but we have 38 pairs of md.[ch],
and they could not even agree on the order in which to list the
md hooks, let alone formatting. Sort the md hooks to match the
(now sane) order in def.sh, and try to normalise the formatting
- Also copy across some function level comments everywhere
- Ensure functions only used inside each md.c are defined as static
- Remove some now unused functions
- Some files had enable_rc_conf in #ifdef DEBUG. Add this to all
- bebox, evbppc and sandpoint were still playing broken games with
copying the booted ramdisk to the target disk, the primary result
of which was just to slow things down and ensure the target system
lost the .profile extracted from the sets. Just kill this.
- For some ports md_update() called endwin(), and in others not.
Take a cure from i386/amd64 and a few other more active ports,
and update everything to match (no endwin())
- In a couple of cases correct port names in comments
- ANSIfy some lingering old style functions
- Consistently use "return 0;" rather than "return (0);"
More of the mbr code should be abstracted, along with the
get_ramsize() / set_swap() logic, but this is (more than)
enough for one day...
sysinst built for all ports but only runtime tested on amd64 & i386
2009-09-19 18:57:27 +04:00
|
|
|
#if defined(DEBUG) || defined(DEBUG_ROOT)
|
|
|
|
void backtowin(void);
|
|
|
|
#endif
|
2019-07-23 18:23:14 +03:00
|
|
|
bool is_root_part_mount(const char *);
|
2003-05-19 00:40:09 +04:00
|
|
|
const char *concat_paths(const char *, const char *);
|
|
|
|
const char *target_expand(const char *);
|
2019-06-12 09:20:17 +03:00
|
|
|
bool needs_expanding(const char *, size_t);
|
2003-05-19 00:40:09 +04:00
|
|
|
void make_target_dir(const char *);
|
|
|
|
void append_to_target_file(const char *, const char *);
|
|
|
|
void echo_to_target_file(const char *, const char *);
|
|
|
|
void trunc_target_file(const char *);
|
|
|
|
const char *target_prefix(void);
|
|
|
|
int target_chdir(const char *);
|
|
|
|
void target_chdir_or_die(const char *);
|
|
|
|
int target_already_root(void);
|
|
|
|
FILE *target_fopen(const char *, const char *);
|
2003-07-25 12:26:21 +04:00
|
|
|
int target_collect_file(int, char **, const char *);
|
2003-09-27 14:47:17 +04:00
|
|
|
int is_active_rootpart(const char *, int);
|
2003-05-19 00:40:09 +04:00
|
|
|
int cp_to_target(const char *, const char *);
|
|
|
|
void dup_file_into_target(const char *);
|
|
|
|
void mv_within_target_or_die(const char *, const char *);
|
2003-12-28 08:30:47 +03:00
|
|
|
int cp_within_target(const char *, const char *, int);
|
2019-06-12 09:20:17 +03:00
|
|
|
int target_mount(const char *, const char *, const char *);
|
|
|
|
int target_mount_do(const char *, const char *, const char *);
|
2003-05-19 00:40:09 +04:00
|
|
|
int target_test(unsigned int, const char *);
|
|
|
|
int target_dir_exists_p(const char *);
|
|
|
|
int target_file_exists_p(const char *);
|
|
|
|
int target_symlink_exists_p(const char *);
|
|
|
|
void unwind_mounts(void);
|
2012-04-07 03:48:53 +04:00
|
|
|
int target_mounted(void);
|
2019-08-07 13:08:04 +03:00
|
|
|
void umount_root(void);
|
1997-12-04 14:27:56 +03:00
|
|
|
|
2014-08-03 20:09:38 +04:00
|
|
|
/* from partman.c */
|
2018-09-20 15:27:42 +03:00
|
|
|
#ifndef NO_PARTMAN
|
2014-08-03 20:09:38 +04:00
|
|
|
int partman(void);
|
2019-06-12 09:20:17 +03:00
|
|
|
int pm_getrefdev(struct pm_devs *);
|
2018-09-20 15:27:42 +03:00
|
|
|
void update_wedges(const char *);
|
2019-06-12 09:20:17 +03:00
|
|
|
void pm_destroy_all(void);
|
2018-09-20 15:27:42 +03:00
|
|
|
#else
|
|
|
|
static inline int partman(void) { return -1; }
|
2019-06-12 09:20:17 +03:00
|
|
|
static inline int pm_getrefdev(struct pm_devs *x __unused) { return -1; }
|
2018-09-20 15:27:42 +03:00
|
|
|
#define update_wedges(x) __nothing
|
|
|
|
#endif
|
2020-01-09 16:22:30 +03:00
|
|
|
void pmdiskentry_enable(menudesc*, struct part_entry *);
|
2019-06-12 09:20:17 +03:00
|
|
|
int pm_partusage(struct pm_devs *, int, int);
|
|
|
|
void pm_setfstype(struct pm_devs *, part_id, int, int);
|
2020-01-09 16:22:30 +03:00
|
|
|
void pm_set_lvmpv(struct pm_devs *, part_id, bool);
|
|
|
|
bool pm_is_lvmpv(struct pm_devs *, part_id, const struct disk_part_info*);
|
2014-08-03 20:09:38 +04:00
|
|
|
int pm_editpart(int);
|
2019-06-12 09:20:17 +03:00
|
|
|
void pm_rename(struct pm_devs *);
|
2020-01-09 16:22:30 +03:00
|
|
|
void pm_shred(struct part_entry *, int);
|
2019-06-12 09:20:17 +03:00
|
|
|
void pm_umount(struct pm_devs *, int);
|
|
|
|
int pm_unconfigure(struct pm_devs *);
|
2020-01-09 16:22:30 +03:00
|
|
|
int pm_cgd_edit_new(struct pm_devs *pm, part_id id);
|
|
|
|
int pm_cgd_edit_old(struct part_entry *);
|
2019-06-12 09:20:17 +03:00
|
|
|
void pm_wedges_fill(struct pm_devs *);
|
2020-01-09 16:22:30 +03:00
|
|
|
void pm_edit_partitions(struct part_entry *);
|
|
|
|
part_id pm_whole_disk(struct part_entry *, int);
|
|
|
|
struct pm_devs * pm_from_pe(struct part_entry *);
|
|
|
|
bool pm_force_parts(struct pm_devs *);
|
2019-06-12 09:20:17 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Parse a file system position or size in a common way, return
|
|
|
|
* sector count and multiplicator.
|
|
|
|
* If "extend" is supported, things like 120+ will be parsed as
|
|
|
|
* 120 plus "extend this" flag.
|
|
|
|
* Caller needs to init muliplicator upfront to the default value.
|
|
|
|
*/
|
|
|
|
daddr_t parse_disk_pos(
|
|
|
|
const char *, /* in: input string */
|
|
|
|
daddr_t *, /* in/out: multiplicator for return value */
|
2020-01-28 00:21:21 +03:00
|
|
|
daddr_t bps, /* in: sector size in bytes */
|
|
|
|
daddr_t, /* in: cylinder size in sectors */
|
2019-06-12 09:20:17 +03:00
|
|
|
bool *); /* NULL if "extend" is not supported, & of
|
|
|
|
* "extend" flag otherwise */
|
2015-05-09 15:06:31 +03:00
|
|
|
|
|
|
|
/* flags whether to offer the respective options (depending on helper
|
|
|
|
programs available on install media */
|
2019-06-12 09:20:17 +03:00
|
|
|
extern int have_raid, have_vnd, have_cgd, have_lvm, have_gpt, have_dk;
|
2015-05-09 15:06:31 +03:00
|
|
|
/* initialize above variables */
|
|
|
|
void check_available_binaries(void);
|
2014-08-03 20:09:38 +04:00
|
|
|
|
extend sysinst disk handling, some general clean ups, better /etc support
and some sparc64 fixes. details:
- new scripting_{,v}fprintf() that also write to the script log (if open).
- support of creation of LFS filesystems
- standard installs now allow one to choose which file systems to create,
out of the list of /usr, /var, /home, MFS /tmp, and swap. a / is always
created, but the rest all optional. [*]
- new disklabel method: use existing. this requires one to fill in the
mount points (and having at least a "/" is enforced).
- preservation of existing filesystems (at install) is supported.
- rewrote most of make_fstab(): the entire thing is generated from the
bsdlabel now, rather than hard coding / to 'a' and swap to 'b'. create
MFS /tmp if requested.
- if IPv6 support isn't present, don't display any ipv6 messages.
- better rc.conf support
- sparc & sparc64 default to "cylinders" now.
- choosing "standard" instead of "standard with X" de-selects the X pkgs
by default.
- sparc64: don't install bootblocks until we have a complete system, avoids
booting with no /dev/console.
- sparc64: bump STDNEEDMB, it is way low.
[*] i have added default values for DEFVARSIZE & DEFUSRSIZE (this is used
only if /usr and /home are selected) to each port, based on STDNEEDMB. as
such, my guesses might be wrong so port maintainers should look at these.
2001-01-14 05:38:13 +03:00
|
|
|
/* from bsddisklabel.c */
|
2020-10-12 19:14:32 +03:00
|
|
|
/* returns -1 to restart partitioning, 0 for error, 1 for success */
|
|
|
|
int make_bsd_partitions(struct install_partition_desc*);
|
2008-01-24 02:15:37 +03:00
|
|
|
void set_ptn_titles(menudesc *, int, void *);
|
|
|
|
int set_ptn_size(menudesc *, void *);
|
2019-06-12 09:20:17 +03:00
|
|
|
bool get_ptn_sizes(struct partition_usage_set*);
|
|
|
|
bool check_partitions(struct install_partition_desc*);
|
2002-02-04 01:21:55 +03:00
|
|
|
|
|
|
|
/* from aout2elf.c */
|
2003-05-19 00:40:09 +04:00
|
|
|
int move_aout_libs(void);
|
2004-06-12 23:18:24 +04:00
|
|
|
|
|
|
|
#ifdef WSKBD
|
|
|
|
void get_kb_encoding(void);
|
|
|
|
void save_kb_encoding(void);
|
|
|
|
#else
|
|
|
|
#define get_kb_encoding()
|
|
|
|
#define save_kb_encoding()
|
|
|
|
#endif
|
2012-04-07 03:48:53 +04:00
|
|
|
|
|
|
|
/* from configmenu.c */
|
2019-06-12 09:20:17 +03:00
|
|
|
void do_configmenu(struct install_partition_desc*);
|
2012-04-07 03:48:53 +04:00
|
|
|
|
|
|
|
/* from checkrc.c */
|
|
|
|
int check_rcvar(const char *);
|
|
|
|
int check_rcdefault(const char *);
|
2020-04-23 02:43:12 +03:00
|
|
|
extern WINDOW *mainwin;
|
2014-08-03 20:09:38 +04:00
|
|
|
|
2019-06-12 09:20:17 +03:00
|
|
|
/* in menus.mi */
|
|
|
|
void expand_all_option_texts(menudesc *menu, void *arg);
|
|
|
|
void resize_menu_height(menudesc *);
|
|
|
|
|
2003-05-19 00:40:09 +04:00
|
|
|
#endif /* _DEFS_H_ */
|