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

Annotation of src/usr.sbin/sysinst/defs.h, Revision 1.83

1.83    ! andvar      1: /*     $NetBSD: defs.h,v 1.82 2022/05/18 16:39:03 martin Exp $ */
1.1       dholland    2:
                      3: /*
                      4:  * Copyright 1997 Piermont Information Systems Inc.
                      5:  * All rights reserved.
                      6:  *
                      7:  * Written by Philip A. Nelson for Piermont Information Systems Inc.
                      8:  *
                      9:  * Redistribution and use in source and binary forms, with or without
                     10:  * modification, are permitted provided that the following conditions
                     11:  * are met:
                     12:  * 1. Redistributions of source code must retain the above copyright
                     13:  *    notice, this list of conditions and the following disclaimer.
                     14:  * 2. Redistributions in binary form must reproduce the above copyright
                     15:  *    notice, this list of conditions and the following disclaimer in the
                     16:  *    documentation and/or other materials provided with the distribution.
                     17:  * 3. The name of Piermont Information Systems Inc. may not be used to endorse
                     18:  *    or promote products derived from this software without specific prior
                     19:  *    written permission.
                     20:  *
                     21:  * THIS SOFTWARE IS PROVIDED BY PIERMONT INFORMATION SYSTEMS INC. ``AS IS''
                     22:  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     23:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     24:  * ARE DISCLAIMED. IN NO EVENT SHALL PIERMONT INFORMATION SYSTEMS INC. BE
                     25:  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
                     26:  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
                     27:  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
                     28:  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
                     29:  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
                     30:  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
                     31:  * THE POSSIBILITY OF SUCH DAMAGE.
                     32:  *
                     33:  */
                     34:
                     35: #ifndef _DEFS_H_
                     36: #define _DEFS_H_
                     37:
                     38: /* defs.h -- definitions for use in the sysinst program. */
                     39:
                     40: /* System includes needed for this. */
1.2       martin     41: #include <sys/queue.h>
1.1       dholland   42: #include <sys/types.h>
1.2       martin     43: #include <sys/disk.h>
1.69      martin     44: #include <limits.h>
1.34      martin     45: #include <uuid.h>
1.1       dholland   46:
1.34      martin     47: const char *getfslabelname(uint, uint);
1.1       dholland   48:
                     49: #include "msg_defs.h"
                     50: #include "menu_defs.h"
1.34      martin     51: #include "partitions.h"
1.1       dholland   52:
                     53: #define min(a,b)       ((a) < (b) ? (a) : (b))
                     54: #define max(a,b)       ((a) > (b) ? (a) : (b))
                     55:
                     56: /* constants */
1.34      martin     57: #define MEG (1024UL * 1024UL)
                     58: #define GIG (1024UL * MEG)
                     59: #define STRSIZE                255
                     60: #define        MENUSTRSIZE     80
                     61: #define SSTRSIZE       30
1.79      martin     62: #define        DISKNAMESIZE    24      /* max(strlen("/dev/rsd22c")) */
1.34      martin     63:
1.53      martin     64: /* these are used for different alignment defaults */
1.34      martin     65: #define        HUGE_DISK_SIZE  (daddr_t)(128 * (GIG / 512))
                     66: #define        TINY_DISK_SIZE  (daddr_t)(1800 * (MEG / 512))
                     67:
1.53      martin     68: /*
                     69:  * if a system does not have more ram (in MB) than this, swap will be enabled
                     70:  * very early (as soon as the swap partition has been created)
                     71:  */
1.71      martin     72: #ifdef EXTRACT_NEEDS_BIG_RAM   /* we use an expensive decompressor */
                     73: #define        TINY_RAM_SIZE           256
                     74: #else
1.53      martin     75: #define        TINY_RAM_SIZE           32
1.71      martin     76: #endif
                     77:
1.53      martin     78: /*
                     79:  * if a system has less ram (in MB) than this, we will not create a
                     80:  * tmpfs /tmp by default (to workaround PR misc/54886)
                     81:  */
1.57      martin     82: #define        SMALL_RAM_SIZE          384
1.53      martin     83:
1.34      martin     84: /* helper macros to create unique internal error messages */
                     85: #define STR_NO(STR)    #STR
                     86: #define        TO_STR(NO)      STR_NO(NO)
                     87: #define        INTERNAL_ERROR __FILE__ ":" TO_STR(__LINE__) ": internal error"
1.1       dholland   88:
                     89: /* For run.c: collect() */
                     90: #define T_FILE         0
                     91: #define T_OUTPUT       1
                     92:
                     93: /* Some install status/response values */
                     94: #define        SET_OK          0               /* Set extracted */
                     95: #define        SET_RETRY       1               /* Retry */
                     96: #define        SET_SKIP        2               /* Skip this set */
                     97: #define        SET_SKIP_GROUP  3               /* Skip this set and rest of group */
                     98: #define        SET_ABANDON     4               /* Abandon installation */
                     99: #define        SET_CONTINUE    5               /* Continue (copy from floppy loop) */
                    100:
                    101: /* run_prog flags */
                    102: #define RUN_DISPLAY    0x0001          /* Display program output */
                    103: #define RUN_FATAL      0x0002          /* errors are fatal */
                    104: #define RUN_CHROOT     0x0004          /* chroot to target disk */
                    105: #define RUN_FULLSCREEN 0x0008          /* fullscreen (use with RUN_DISPLAY) */
                    106: #define RUN_SILENT     0x0010          /* Do not show output */
                    107: #define RUN_ERROR_OK   0x0040          /* Don't wait for error confirmation */
                    108: #define RUN_PROGRESS   0x0080          /* Output is just progess test */
                    109: #define RUN_NO_CLEAR   0x0100          /* Leave program output after error */
                    110: #define RUN_XFER_DIR   0x0200          /* cd to xfer_dir in child */
1.81      martin    111: #define        RUN_STDSCR      0x0400          /* run program in standard screen */
1.1       dholland  112:
1.2       martin    113: /* for bsddisklabel.c */
1.66      martin    114: enum layout_type {
1.76      msaitoh   115:        LY_KEEPEXISTING,        /* keep existing partitions */
1.66      martin    116:        LY_OTHERSCHEME,         /* delete all, select new partitioning scheme */
                    117:        LY_SETSIZES,            /* edit sizes */
                    118:        LY_USEDEFAULT,          /* use default sizes */
                    119:        LY_USEFULL,             /* use full disk for NetBSD */
                    120:        LY_ERROR                /* used for "abort" in menu */
                    121: };
                    122:
1.34      martin    123: enum setup_type { SY_NEWRAID, SY_NEWCGD, SY_NEWLVM };
1.2       martin    124:
1.1       dholland  125: /* Installation sets */
                    126: enum {
                    127:     SET_NONE,
                    128:     SET_KERNEL_FIRST,
                    129:     SET_KERNEL_1,      /* Usually GENERIC */
                    130:     SET_KERNEL_2,      /* MD kernel... */
                    131:     SET_KERNEL_3,      /* MD kernel... */
                    132:     SET_KERNEL_4,      /* MD kernel... */
                    133:     SET_KERNEL_5,      /* MD kernel... */
                    134:     SET_KERNEL_6,      /* MD kernel... */
                    135:     SET_KERNEL_7,      /* MD kernel... */
                    136:     SET_KERNEL_8,      /* MD kernel... */
                    137:     SET_KERNEL_9,      /* MD kernel... */
                    138:     SET_KERNEL_LAST,   /* allow 9 kernels */
                    139:
                    140:     /* System sets */
                    141:     SET_BASE,          /* base */
                    142:     SET_ETC,           /* /etc */
                    143:     SET_COMPILER,      /* compiler tools */
1.62      jmcneill  144:     SET_DTB,           /* devicetree hardware descriptions */
1.1       dholland  145:     SET_GAMES,         /* text games */
1.73      maya      146:     SET_GPUFW,         /* GPU firmware files */
1.1       dholland  147:     SET_MAN_PAGES,     /* online manual pages */
                    148:     SET_MISC,          /* miscellaneuous */
                    149:     SET_MODULES,       /* kernel modules */
1.45      maya      150:     SET_RESCUE,                /* /rescue recovery tools */
1.1       dholland  151:     SET_TESTS,         /* tests */
                    152:     SET_TEXT_TOOLS,    /* text processing tools */
                    153:
                    154:     /* X11 sets */
                    155:     SET_X11_FIRST,
                    156:     SET_X11_BASE,      /* X11 base and clients */
                    157:     SET_X11_FONTS,     /* X11 fonts */
                    158:     SET_X11_SERVERS,   /* X11 servers */
                    159:     SET_X11_PROG,      /* X11 programming */
                    160:     SET_X11_ETC,       /* X11 config */
                    161:     SET_X11_LAST,
                    162:
                    163:     /* Machine dependent sets */
                    164:     SET_MD_1,          /* Machine dependent set */
                    165:     SET_MD_2,          /* Machine dependent set */
                    166:     SET_MD_3,          /* Machine dependent set */
                    167:     SET_MD_4,          /* Machine dependent set */
1.70      rillig    168:
1.1       dholland  169:     /* Source sets */
                    170:     SET_SYSSRC,
                    171:     SET_SRC,
                    172:     SET_SHARESRC,
                    173:     SET_GNUSRC,
                    174:     SET_XSRC,
                    175:
                    176:     /* Debug sets */
                    177:     SET_DEBUG,
                    178:     SET_X11_DEBUG,
                    179:
                    180:     SET_LAST,
                    181:     SET_GROUP,         /* Start of submenu */
                    182:     SET_GROUP_END,     /* End of submenu */
                    183:     SET_PKGSRC,                /* pkgsrc, not counted as regular set */
                    184: };
                    185:
                    186: /* Initialisers to select sets */
                    187: /* All kernels */
                    188: #define SET_KERNEL SET_KERNEL_1, SET_KERNEL_2, SET_KERNEL_3, SET_KERNEL_4, \
                    189:                    SET_KERNEL_5, SET_KERNEL_6, SET_KERNEL_7, SET_KERNEL_8
1.68      martin    190: #ifdef HAVE_MODULES
                    191: #define        WITH_MODULES    SET_MODULES,
                    192: #else
                    193: #define        WITH_MODULES
                    194: #endif
1.1       dholland  195: /* Core system sets */
1.62      jmcneill  196: #ifdef HAVE_DTB
1.73      maya      197: #define        WITH_DTB        SET_DTB,
1.62      jmcneill  198: #else
1.73      maya      199: #define        WITH_DTB
1.62      jmcneill  200: #endif
1.74      maya      201: #define SET_CORE WITH_MODULES SET_BASE, WITH_DTB SET_GPUFW, SET_ETC
1.1       dholland  202: /* All system sets */
                    203: #define SET_SYSTEM SET_CORE, SET_COMPILER, SET_GAMES, \
1.45      maya      204:                    SET_MAN_PAGES, SET_MISC, SET_RESCUE, \
                    205:                    SET_TESTS, SET_TEXT_TOOLS
1.1       dholland  206: /* All X11 sets */
                    207: #define SET_X11_NOSERVERS SET_X11_BASE, SET_X11_FONTS, SET_X11_PROG, SET_X11_ETC
                    208: #define SET_X11 SET_X11_NOSERVERS, SET_X11_SERVERS
                    209:
                    210: /* All machine dependent sets */
                    211: #define SET_MD SET_MD_1, SET_MD_2, SET_MD_3, SET_MD_4
                    212:
                    213: /* All source sets */
                    214: #define SET_SOURCE SET_SYSSRC, SET_SRC, SET_SHARESRC, SET_GNUSRC, SET_XSRC
                    215:
                    216: /* All debug sets */
                    217: #define SET_DEBUGGING SET_DEBUG, SET_X11_DEBUG
                    218:
                    219: /* Set list flags */
                    220: #define SFLAG_MINIMAL  1
                    221: #define        SFLAG_NOX       2
                    222:
                    223: /* Round up to the next full cylinder size */
                    224: #define NUMSEC(size, sizemult, cylsize) \
1.34      martin    225:        ((sizemult) == 1 ? (size) : \
1.1       dholland  226:         roundup((size) * (sizemult), (cylsize)))
                    227:
                    228: /* What FS type? */
1.34      martin    229: #define PI_ISBSDFS(PI) (PI_FSTYPE(PI) == FS_BSDLFS || \
                    230:                        PI_FSTYPE(PI) == FS_BSDFFS)
1.1       dholland  231:
1.23      martin    232: /*
                    233:  * We do not offer CDs or floppies as installation target usually.
                    234:  * Architectures might want to undefine if they want to allow
                    235:  * these devices or redefine if they have unusual CD device names.
                    236:  * Do not define to empty or an empty string, undefine instead.
                    237:  */
1.21      martin    238: #define CD_NAMES "cd*"
1.23      martin    239: #define FLOPPY_NAMES "fd*"
1.1       dholland  240:
                    241: /* Types */
1.8       martin    242:
                    243: /* pass a void* argument into a menu and also provide a int return value */
                    244: typedef struct arg_rv {
                    245:        void *arg;
                    246:        int rv;
                    247: } arg_rv;
                    248:
1.34      martin    249: /*
                    250:  * A minimal argument for menus using string replacements
                    251:  */
                    252: typedef struct arg_replace {
                    253:        const char **argv;
                    254:        size_t argc;
                    255: } arg_replace;
                    256:
                    257: /*
                    258:  * pass a parameter array (for string replacements) into a menu and provide
                    259:  * an integer return value
                    260:  */
                    261: typedef struct arg_rep_int {
                    262:        arg_replace args;
                    263:        int rv;
                    264: } arg_rep_int;
                    265:
1.1       dholland  266: typedef struct distinfo {
                    267:        const char      *name;
                    268:        uint            set;
1.20      martin    269:        bool            force_tgz;      /* this set is always in .tgz format */
1.1       dholland  270:        const char      *desc;
                    271:        const char      *marker_file;   /* set assumed installed if exists */
                    272: } distinfo;
                    273:
1.2       martin    274: #define MOUNTLEN 20
1.34      martin    275:
                    276:
                    277: /*
                    278:  * A description of a future partition and its usage.
                    279:  * A list of this is the output of the first stage partition
                    280:  * editor, before it gets transformed into a concrete partition
                    281:  * layout according to the partitioning scheme backend.
                    282:  */
                    283: struct part_usage_info {
1.51      martin    284:        daddr_t size;                   /* thumb guestimate of size,
                    285:                                         * [sec if positive, %-of-ram
                    286:                                         * if TMPFS and negative]
                    287:                                         */
1.34      martin    288:        daddr_t def_size;               /* default size */
                    289:        daddr_t limit;                  /* max size */
                    290:        char    mount[MOUNTLEN];        /* where will we mount this? */
                    291:        enum part_type type;            /* PT_root/PT_swap/PT_EFI_SYSTEM */
                    292:
                    293: #define        PUIFLAG_EXTEND          1       /* extend this part if free space
                    294:                                         * is available */
                    295: #define        PUIFLAG_ADD_OUTER       2       /* Add this partition to the outer
                    296:                                         * partitions (if available) */
1.37      martin    297: #define        PUIFLG_IS_OUTER         4       /* this is an existing outer one */
1.46      martin    298: #define        PUIFLG_ADD_INNER        8       /* add outer also to inner */
1.37      martin    299: #define        PUIFLG_JUST_MOUNTPOINT  16      /* tmpfs of mfs mountpoints */
1.46      martin    300: #define        PUIFLG_CLONE_PARTS      32      /* clone external partitions */
1.34      martin    301:        uint flags;
                    302:        struct disk_partitions *parts;  /* Where does this partition live?
                    303:                                         * We currently only support
                    304:                                         * a single disk, but we plan to
                    305:                                         * extend that.
                    306:                                         * Use pm->parts to access
                    307:                                         * the partitions. */
                    308:        part_id cur_part_id;            /* this may change, but we try to
                    309:                                         * fix it up after all changes */
                    310:        daddr_t cur_start;              /* may change during editing, just
                    311:                                         * used as a unique identifier */
                    312:        uint32_t cur_flags;             /* PTI_* flags from disk_part_info */
                    313:
                    314: #define PUIMNT_ASYNC           0x0001  /* mount -o async */
                    315: #define PUIMNT_NOATIME         0x0002  /* mount -o noatime */
                    316: #define PUIMNT_NODEV           0x0004  /* mount -o nodev */
                    317: #define PUIMNT_NODEVMTIME      0x0008  /* mount -o nodevmtime */
                    318: #define PUIMNT_NOEXEC          0x0010  /* mount -o noexec */
                    319: #define PUIMNT_NOSUID          0x0020  /* mount -o nosuid */
                    320: #define PUIMNT_LOG             0x0040  /* mount -o log */
                    321: #define PUIMNT_NOAUTO          0x0080  /* "noauto" fstab flag */
                    322:        unsigned int mountflags;        /* flags for fstab */
                    323: #define PUIINST_NEWFS  0x0001          /* need to 'newfs' partition */
                    324: #define PUIINST_MOUNT  0x0002          /* need to mount partition */
                    325: #define        PUIINST_BOOT    0x0004          /* this is a boot partition */
                    326:        unsigned int instflags;         /* installer handling flags */
                    327:        uint fs_type, fs_version;       /* e.g. FS_LFS, or FS_BSDFS,
                    328:                                         * version = 2 for FFSv2 */
1.67      martin    329:        uint fs_opt1, fs_opt2, fs_opt3; /* FS specific, FFS: block/frag */
1.47      martin    330: #ifndef        NO_CLONES
1.46      martin    331:        /*
                    332:         * Only != NULL when PUIFLG_CLONE_PARTS is set, describes the
                    333:         * source partitions to clone here.
                    334:         */
                    335:        struct selected_partitions *clone_src;
                    336:        /*
                    337:         * If clone_src != NULL, this record corresponds to a single
                    338:         * selected source partition, if clone_ndx is a valid index in clone_src
                    339:         * (>= 0 && <= clone_src->num_sel, or all of them if clone_ndx = ~0U.
                    340:         */
                    341:        size_t clone_ndx;
1.47      martin    342: #endif
1.34      martin    343: };
                    344:
                    345: /*
                    346:  * A list of partition suggestions, bundled for editing
                    347:  */
                    348: struct partition_usage_set {
1.63      martin    349:        struct disk_partitions *parts;  /* main partition table */
                    350:        size_t num;                     /* number of infos */
1.34      martin    351:        struct part_usage_info *infos;  /* 0 .. num-1 */
1.63      martin    352:        struct disk_partitions **write_back;
                    353:                                        /* partition tables from which we
                    354:                                         * did delete some partitions and
                    355:                                         * that need updating, even if
                    356:                                         * no active partition remains. */
                    357:        size_t num_write_back;          /* number of write_back */
1.34      martin    358:        daddr_t cur_free_space;         /* estimate of free sectors */
1.65      martin    359:        daddr_t reserved_space;         /* space we are not allowed to use */
1.34      martin    360:        menu_ent *menu_opts;            /* 0 .. num+N */
                    361:        int menu;                       /* the menu to edit this */
                    362:        bool ok;                        /* ok to continue (all fit) */
                    363: };
                    364:
                    365: /*
                    366:  * A structure we pass around in menus that edit a single partition out
                    367:  * of a partition_usage_set.
                    368:  */
                    369: struct single_part_fs_edit {
                    370:        struct partition_usage_set *pset;
1.67      martin    371:        size_t index, first_custom_attr, offset, mode;
1.34      martin    372:        part_id id;
                    373:        struct disk_part_info info;     /* current partition data */
                    374:        struct part_usage_info *wanted; /* points at our edit data */
                    375:
                    376:        /*
                    377:         * "Backup" of old data, so we can restore previous values
                    378:         * ("undo").
                    379:         */
                    380:        struct part_usage_info old_usage;
                    381:        struct disk_part_info old_info;
                    382:
                    383:        /* menu return value */
                    384:        int rv;
                    385: };
                    386:
                    387: /*
                    388:  * Description of a full target installation, all partitions and
1.83    ! andvar    389:  * devices (may be across several struct pm_devs / disks).
1.34      martin    390:  */
                    391: struct install_partition_desc {
                    392:        size_t num;                             /* how many entries in infos */
                    393:        struct part_usage_info *infos;          /* individual partitions */
1.70      rillig    394:        struct disk_partitions **write_back;    /* partition tables from
1.63      martin    395:                                                 * which we did delete some
                    396:                                                 * partitions and that need
                    397:                                                 * updating, even if no
                    398:                                                 * active partition remains. */
                    399:        size_t num_write_back;                  /* number of write_back */
1.41      martin    400:        bool cur_system;                        /* target is the life system */
1.1       dholland  401: };
                    402:
                    403: /* variables */
                    404:
1.58      joerg     405: extern int debug;              /* set by -D option */
1.1       dholland  406:
1.58      joerg     407: extern char machine[SSTRSIZE];
1.1       dholland  408:
1.58      joerg     409: extern int ignorerror;
                    410: extern int ttysig_ignore;
                    411: extern pid_t ttysig_forward;
                    412: extern uint sizemult;
1.34      martin    413: extern const char *multname;
                    414: extern const char *err_outofmem;
1.58      joerg     415: extern int partman_go; /* run extended partition manager */
1.1       dholland  416:
1.2       martin    417: /* logging variables */
1.1       dholland  418:
1.58      joerg     419: extern FILE *logfp;
                    420: extern FILE *script;
1.1       dholland  421:
1.2       martin    422: #define MAX_DISKS 15
                    423:
1.58      joerg     424: extern daddr_t root_limit;    /* BIOS (etc) read limit */
1.2       martin    425:
1.50      martin    426: enum SHRED_T { SHRED_NONE=0, SHRED_ZEROS, SHRED_RANDOM };
1.1       dholland  427:
1.2       martin    428: /* All information that is unique for each drive */
1.58      joerg     429: extern SLIST_HEAD(pm_head_t, pm_devs) pm_head;
1.2       martin    430:
1.34      martin    431: struct pm_devs {
                    432:        /*
                    433:         * If device is blocked (e.g. part of a raid)
                    434:         * this is a pointers to the  parent dev
                    435:         */
                    436:        void *refdev;
                    437:
                    438:        char diskdev[SSTRSIZE];         /* Actual name of the disk. */
                    439:        char diskdev_descr[STRSIZE];    /* e.g. IDENTIFY result */
                    440:
                    441:        /*
                    442:         * What the disk layout should look like.
                    443:         */
                    444:        struct disk_partitions *parts;
                    445:
                    446:        /*
                    447:         * The device does not take a MBR, even if we usually use
                    448:         * MBR master / disklabel secondary partitioning.
                    449:         * Used e.g. for raid* pseudo-disks.
                    450:         */
                    451:        bool no_mbr;    /* userd for raid (etc) */
                    452:
                    453:        /*
                    454:         * This device can not be partitioned (in any way).
                    455:         * Used for wedges (dk*) or LVM devices.
                    456:         */
                    457:        bool no_part;
                    458:
1.41      martin    459:        /*
                    460:         * This is a pseudo-device representing the currently running
                    461:         * system (i.e. all mounted file systems).
                    462:         */
                    463:        bool cur_system;
                    464:
1.54      martin    465:        /* Actual values for current disk geometry - set by find_disks() or
                    466:         *  md_get_info()
                    467:         */
                    468:        uint sectorsize, dlcyl, dlhead, dlsec, dlcylsize, current_cylsize;
                    469:        /*
                    470:         * Total size of the disk - in 'sectorsize' units (!)
                    471:         */
                    472:        daddr_t dlsize; /* total number of disk sectors */
1.34      martin    473:
1.54      martin    474:        /* Area of disk we can allocate, start and size in sectors. */
1.34      martin    475:        daddr_t ptstart, ptsize;
                    476:
                    477:        /* For some bootblocks we need to know the CHS addressable limit */
                    478:        daddr_t max_chs;        /* bcyl * bhead * bsec */
                    479:
                    480:        /* If we have an MBR boot partition, start and size in sectors */
                    481:        daddr_t bootstart, bootsize;
                    482:
                    483:        /*
                    484:         * In extended partitioning: all partitions in parts (number of
                    485:         * entries is parts->num_part) may actually be mounted (temporarily)
                    486:         * somewhere, e.g. to access a vnd device on them. This list has
                    487:         * a pointer to the current mount point (strdup()'d) if mounted,
                    488:         * or NULL if not.
                    489:         */
                    490:        char **mounted;
                    491:
                    492:        bool unsaved;   /* Flag indicating to partman that device need saving */
                    493:        bool found;     /* Flag to delete unplugged and unconfigured devices */
                    494:        int blocked;    /* Device is busy and cannot be changed */
                    495:
                    496:        SLIST_ENTRY(pm_devs) l;
                    497: };
1.58      joerg     498: extern struct pm_devs *pm; /* Pointer to current device with which we work */
                    499: extern struct pm_devs *pm_new; /* Pointer for next allocating device in find_disks() */
1.2       martin    500:
                    501: /* Generic structure for partman */
1.34      martin    502: struct part_entry {
                    503:        part_id id;
                    504:        struct disk_partitions *parts;
                    505:        void *dev_ptr;
1.50      martin    506:        size_t index;   /* e.g. if PM_RAID: this is raids[index] */
1.34      martin    507:        int dev_ptr_delta;
                    508:        char fullname[SSTRSIZE];
                    509:        enum {PM_DISK=1, PM_PART, PM_SPEC,
                    510:            PM_RAID, PM_CGD, PM_VND, PM_LVM, PM_LVMLV} type;
                    511: };
1.1       dholland  512:
                    513: /* Relative file name for storing a distribution. */
1.58      joerg     514: extern char xfer_dir[STRSIZE];
                    515: extern int  clean_xfer_dir;
1.1       dholland  516:
                    517: #if !defined(SYSINST_FTP_HOST)
                    518: #define SYSINST_FTP_HOST       "ftp.NetBSD.org"
                    519: #endif
                    520:
1.16      martin    521: #if !defined(SYSINST_HTTP_HOST)
                    522: #define SYSINST_HTTP_HOST      "cdn.NetBSD.org"
                    523: #endif
                    524:
1.1       dholland  525: #if !defined(SYSINST_FTP_DIR)
1.12      martin    526: #if defined(NETBSD_OFFICIAL_RELEASE)
1.1       dholland  527: #define SYSINST_FTP_DIR                "pub/NetBSD/NetBSD-" REL
1.13      martin    528: #elif defined(REL_PATH)
1.18      martin    529: #define SYSINST_FTP_DIR                "pub/NetBSD-daily/" REL_PATH "/latest"
1.12      martin    530: #else
1.13      martin    531: #define SYSINST_FTP_DIR                "pub/NetBSD/NetBSD-" REL
1.12      martin    532: #endif
1.1       dholland  533: #endif
                    534:
1.29      martin    535: #if !defined(ARCH_SUBDIR)
                    536: #define        ARCH_SUBDIR     MACH
                    537: #endif
                    538: #if !defined(PKG_ARCH_SUBDIR)
                    539: #define        PKG_ARCH_SUBDIR MACH
                    540: #endif
                    541:
1.1       dholland  542: #if !defined(SYSINST_PKG_HOST)
1.15      martin    543: #define SYSINST_PKG_HOST       "ftp.NetBSD.org"
1.1       dholland  544: #endif
1.16      martin    545: #if !defined(SYSINST_PKG_HTTP_HOST)
                    546: #define SYSINST_PKG_HTTP_HOST  "cdn.NetBSD.org"
                    547: #endif
1.1       dholland  548:
                    549: #if !defined(SYSINST_PKG_DIR)
                    550: #define SYSINST_PKG_DIR                "pub/pkgsrc/packages/NetBSD"
                    551: #endif
                    552:
1.17      martin    553: #if !defined(PKG_SUBDIR)
                    554: #define        PKG_SUBDIR              REL
                    555: #endif
                    556:
1.1       dholland  557: #if !defined(SYSINST_PKGSRC_HOST)
                    558: #define SYSINST_PKGSRC_HOST    SYSINST_PKG_HOST
                    559: #endif
1.16      martin    560: #if !defined(SYSINST_PKGSRC_HTTP_HOST)
                    561: #define SYSINST_PKGSRC_HTTP_HOST       SYSINST_PKG_HTTP_HOST
                    562: #endif
1.1       dholland  563:
1.20      martin    564: #ifndef SETS_TAR_SUFF
                    565: #define        SETS_TAR_SUFF    "tgz"
                    566: #endif
                    567:
1.48      martin    568: #ifdef USING_PAXASTAR
                    569: #define        TAR_EXTRACT_FLAGS       "-xhepf"
                    570: #else
1.55      martin    571: #define        TAR_EXTRACT_FLAGS       "-xpf"
1.48      martin    572: #endif
                    573:
1.1       dholland  574: /* Abs. path we extract binary sets from */
1.58      joerg     575: extern char ext_dir_bin[STRSIZE];
1.1       dholland  576:
                    577: /* Abs. path we extract source sets from */
1.58      joerg     578: extern char ext_dir_src[STRSIZE];
1.1       dholland  579:
                    580: /* Abs. path we extract pkgsrc from */
1.58      joerg     581: extern char ext_dir_pkgsrc[STRSIZE];
1.1       dholland  582:
                    583: /* Place we look for binary sets in all fs types */
1.58      joerg     584: extern char set_dir_bin[STRSIZE];
1.1       dholland  585:
                    586: /* Place we look for source sets in all fs types */
1.58      joerg     587: extern char set_dir_src[STRSIZE];
1.1       dholland  588:
                    589: /* Place we look for pkgs in all fs types */
1.58      joerg     590: extern char pkg_dir[STRSIZE];
1.1       dholland  591:
                    592: /* Place we look for pkgsrc in all fs types */
1.58      joerg     593: extern char pkgsrc_dir[STRSIZE];
1.1       dholland  594:
                    595: /* User shell */
1.58      joerg     596: extern const char *ushell;
1.1       dholland  597:
1.16      martin    598: #define        XFER_FTP        0
                    599: #define        XFER_HTTP       1
                    600: #define        XFER_MAX        XFER_HTTP
                    601:
1.1       dholland  602: struct ftpinfo {
1.34      martin    603:        char xfer_host[XFER_MAX+1][STRSIZE];
                    604:        char dir[STRSIZE] ;
                    605:        char user[SSTRSIZE];
                    606:        char pass[STRSIZE];
                    607:        char proxy[STRSIZE];
                    608:        unsigned int xfer;      /* XFER_FTP for "ftp" or XFER_HTTP for "http" */
1.1       dholland  609: };
                    610:
                    611: /* use the same struct for sets ftp and to build pkgpath */
1.58      joerg     612: extern struct ftpinfo ftp, pkg, pkgsrc;
1.1       dholland  613:
1.58      joerg     614: extern int (*fetch_fn)(const char *);
                    615: extern char nfs_host[STRSIZE];
                    616: extern char nfs_dir[STRSIZE];
1.69      martin    617: extern char entropy_file[PATH_MAX];
1.1       dholland  618:
1.58      joerg     619: extern char cdrom_dev[SSTRSIZE];               /* Typically "cd0a" */
                    620: extern char fd_dev[SSTRSIZE];                  /* Typically "/dev/fd0a" */
                    621: extern const char *fd_type;                    /* "msdos", "ffs" or maybe "ados" */
1.1       dholland  622:
1.58      joerg     623: extern char localfs_dev[SSTRSIZE];
                    624: extern char localfs_fs[SSTRSIZE];
                    625: extern char localfs_dir[STRSIZE];
1.1       dholland  626:
1.58      joerg     627: extern char targetroot_mnt[SSTRSIZE];
1.1       dholland  628:
1.58      joerg     629: extern int  mnt2_mounted;
1.1       dholland  630:
1.58      joerg     631: extern char dist_postfix[SSTRSIZE];
                    632: extern char dist_tgz_postfix[SSTRSIZE];
1.1       dholland  633:
                    634: /* needed prototypes */
                    635: void set_menu_numopts(int, int);
1.2       martin    636: void remove_color_options(void);
1.75      martin    637: #ifdef CHECK_ENTROPY
                    638: bool do_add_entropy(void);
                    639: size_t entropy_needed(void);
                    640: #endif
1.3       martin    641: void remove_raid_options(void);
                    642: void remove_lvm_options(void);
                    643: void remove_cgd_options(void);
1.1       dholland  644:
                    645: /* Machine dependent functions .... */
                    646: void   md_init(void);
                    647: void   md_init_set_status(int); /* SFLAG_foo */
                    648:
                    649:  /* MD functions if user selects install - in order called */
1.34      martin    650: bool   md_get_info(struct install_partition_desc*);
1.66      martin    651: /* returns -1 to restart partitioning, 0 for error, 1 for success */
                    652: int    md_make_bsd_partitions(struct install_partition_desc*);
1.34      martin    653: bool   md_check_partitions(struct install_partition_desc*);
                    654: #ifdef HAVE_GPT
                    655: /*
                    656:  * New GPT partitions have been written, update bootloader or remember
                    657:  * data untill needed in md_post_newfs
                    658:  */
                    659: bool   md_gpt_post_write(struct disk_partitions*, part_id root_id,
                    660:            bool root_is_new, part_id efi_id, bool efi_is_new);
                    661: #endif
                    662: /*
                    663:  * md_pre_disklabel and md_post_disklabel may be called
                    664:  * multiple times, for each affected device, with the
                    665:  * "inner" partitions pointer of the relevant partitions
                    666:  * passed.
                    667:  */
                    668: bool   md_pre_disklabel(struct install_partition_desc*, struct disk_partitions*);
                    669: bool   md_post_disklabel(struct install_partition_desc*, struct disk_partitions*);
1.38      martin    670: int    md_pre_mount(struct install_partition_desc*, size_t);
1.34      martin    671: int    md_post_newfs(struct install_partition_desc*);
1.78      martin    672: int    md_post_extract(struct install_partition_desc*, bool upgrade);
1.34      martin    673: void   md_cleanup_install(struct install_partition_desc*);
1.1       dholland  674:
                    675:  /* MD functions if user selects upgrade - in order called */
1.34      martin    676: int    md_pre_update(struct install_partition_desc*);
                    677: int    md_update(struct install_partition_desc*);
1.1       dholland  678: /* Also calls md_post_extract() */
                    679:
                    680: /* from main.c */
                    681: void   toplevel(void);
                    682:
                    683: /* from disks.c */
1.21      martin    684: bool   get_default_cdrom(char *, size_t);
1.41      martin    685: int    find_disks(const char *, bool);
1.22      martin    686: bool enumerate_disks(void *state,bool (*func)(void *state, const char *dev));
1.24      martin    687: bool is_cdrom_device(const char *dev, bool as_target);
1.25      martin    688: bool is_bootable_device(const char *dev);
                    689: bool is_partitionable_device(const char *dev);
1.34      martin    690: bool convert_scheme(struct pm_devs *p, bool is_boot_drive, const char **err_msg);
1.47      martin    691:
                    692: #ifndef        NO_CLONES
1.46      martin    693: /* a single partition selected for cloning (etc) */
                    694: struct selected_partition {
                    695:        struct disk_partitions *parts;
                    696:        part_id id;
                    697: };
                    698: struct selected_partitions {
                    699:        struct selected_partition *selection;
                    700:        size_t num_sel;
                    701:        bool with_data;         /* partitions and their data selected */
                    702:        bool free_parts;        /* caller should free parts */
                    703: };
                    704: bool select_partitions(struct selected_partitions *res,
                    705:     const struct disk_partitions *ignore);
                    706: daddr_t        selected_parts_size(struct selected_partitions *);
                    707: void   free_selected_partitions(struct selected_partitions *);
                    708:
                    709: struct clone_target_menu_data {
                    710:        struct partition_usage_set usage;
                    711:        int res;
                    712: };
                    713:
                    714: int    clone_target_select(menudesc *m, void *arg);
                    715: bool   clone_partition_data(struct disk_partitions *dest_parts, part_id did,
                    716:        struct disk_partitions *src_parts, part_id sid);
1.47      martin    717: #endif
1.22      martin    718:
1.1       dholland  719: struct menudesc;
                    720: void   disp_cur_fspart(int, int);
1.34      martin    721: int    make_filesystems(struct install_partition_desc *);
                    722: int    make_fstab(struct install_partition_desc *);
                    723: int    mount_disks(struct install_partition_desc *);
1.72      martin    724: void   set_swap_if_low_ram(struct install_partition_desc *);
                    725: void   set_swap(struct install_partition_desc *);
1.61      martin    726: void   clear_swap(void);
1.1       dholland  727: int    check_swap(const char *, int);
1.34      martin    728: char *bootxx_name(struct install_partition_desc *);
1.2       martin    729: int get_dkwedges(struct dkwedge_info **, const char *);
1.1       dholland  730:
                    731: /* from disks_lfs.c */
                    732: int    fs_is_lfs(void *);
                    733:
                    734: /* from label.c */
1.34      martin    735: /*
                    736:  * Bits valid for "flags" in get_last_mounted.
                    737:  * Currently we return the real last mount from FFS, the volume label
                    738:  * from FAT32, and nothing otherwise. The NTFS support is currently
                    739:  * restricted to verify the partition has an NTFS (as some partitioning
                    740:  * schemes do not tell NTFS from FAT).
                    741:  */
                    742: #define GLM_LIKELY_FFS         1U
                    743: #define        GLM_MAYBE_FAT32         2U
                    744: #define        GLM_MAYBE_NTFS          4U
                    745: /*
                    746:  * possible fs_sub_types are currently:
                    747:  *  FS_BSDFFS:
                    748:  *     0       unknown
                    749:  *     1       FFSv1
                    750:  *     2       FFSv2
                    751:  * FS_MSDOS:
                    752:  *     0       unknown
                    753:  *     else    MBR_PTYPE_FAT* for the current FAT variant
                    754:  * FS_NTFS:
                    755:  *     0       unknown
                    756:  *     else    MBR_PTYPE_NTFS (if valid NTFS was found)
                    757:  *
                    758:  * The fs_type and fs_sub_type pointers may be NULL.
                    759:  */
                    760: const char *get_last_mounted(int fd, daddr_t offset, uint *fs_type,
                    761:      uint *fs_sub_type, uint flags);
1.42      martin    762: void   canonicalize_last_mounted(char*);
1.50      martin    763: int    edit_and_check_label(struct pm_devs *p, struct partition_usage_set *pset, bool install);
1.2       martin    764: int edit_ptn(menudesc *, void *);
1.34      martin    765: int checkoverlap(struct disk_partitions *parts);
1.64      martin    766: daddr_t getpartsize(struct disk_partitions *parts, daddr_t orig_start,
                    767:     daddr_t partstart, daddr_t defpartsize);
1.34      martin    768: daddr_t getpartoff(struct disk_partitions *parts, daddr_t defpartstart);
1.1       dholland  769:
                    770: /* from install.c */
                    771: void   do_install(void);
                    772:
                    773: /* from factor.c */
                    774: void   factor(long, long *, int, int *);
                    775:
                    776: /* from fdisk.c */
                    777: void   get_disk_info(char *);
                    778: void   set_disk_info(char *);
                    779:
                    780: /* from geom.c */
1.36      christos  781: bool   disk_ioctl(const char *, unsigned long, void *);
                    782: bool   get_wedge_list(const char *, struct dkwedge_list *);
                    783: bool   get_wedge_info(const char *, struct dkwedge_info *);
                    784: bool   get_disk_geom(const char *, struct disk_geom *);
                    785: bool   get_label_geom(const char *, struct disklabel *);
1.1       dholland  786:
                    787: /* from net.c */
                    788: extern int network_up;
1.4       roy       789: extern char net_namesvr[STRSIZE];
1.16      martin    790: int    get_via_ftp(unsigned int);
1.1       dholland  791: int    get_via_nfs(void);
1.82      martin    792: int    config_network(int force);
1.1       dholland  793: void   mnt_net_config(void);
                    794: void   make_url(char *, struct ftpinfo *, const char *);
                    795: int    get_pkgsrc(void);
1.16      martin    796: const char *url_proto(unsigned int);
1.1       dholland  797:
                    798: /* From run.c */
                    799: int    collect(int, char **, const char *, ...) __printflike(3, 4);
                    800: int    run_program(int, const char *, ...) __printflike(2, 3);
                    801: void   do_logging(void);
                    802: int    do_system(const char *);
                    803:
                    804: /* from upgrade.c */
                    805: void   do_upgrade(void);
1.40      martin    806: void   do_reinstall_sets(void);
1.1       dholland  807: void   restore_etc(void);
                    808:
1.34      martin    809: /* from part_edit.c */
                    810: int    err_msg_win(const char*);
                    811: const struct disk_partitioning_scheme *select_part_scheme(struct pm_devs *dev,
                    812:     const struct disk_partitioning_scheme *skip, bool bootable,
                    813:     const char *title);
1.66      martin    814: /*
                    815:  * return value:
                    816:  *  0 -> abort
                    817:  *  1 -> ok, continue
                    818:  *  -1 -> partitions have been deleted, start from scratch
                    819: */
                    820: int    edit_outer_parts(struct disk_partitions*);
1.34      martin    821: bool   parts_use_wholedisk(struct disk_partitions*,
                    822:             size_t add_ext_parts, const struct disk_part_info *ext_parts);
                    823:
                    824: /*
                    825:  * Machine dependent partitioning function, only used when
                    826:  * innern/outer partitioning schemes are in use - this sets
                    827:  * up the outer scheme for maximum NetBSD usage.
                    828:  */
                    829: bool   md_parts_use_wholedisk(struct disk_partitions*);
                    830:
1.1       dholland  831: /* from util.c */
1.44      martin    832: bool   root_is_read_only(void);
1.34      martin    833: void   get_ptn_alignment(const struct disk_partitions *parts, daddr_t *align, daddr_t *p0off);
1.46      martin    834: struct disk_partitions *get_inner_parts(struct disk_partitions *parts);
1.27      martin    835: char*  str_arg_subst(const char *, size_t, const char **);
1.26      martin    836: void   msg_display_subst(const char *, size_t, ...);
1.34      martin    837: void   msg_display_add_subst(const char *, size_t, ...);
1.9       martin    838: int    ask_yesno(const char *);
                    839: int    ask_noyes(const char *);
1.34      martin    840: void   hit_enter_to_continue(const char *msg, const char *title);
                    841: /*
                    842:  * return value:
                    843:  *  0 -> abort
                    844:  *  1 -> re-edit
                    845:  *  2 -> continue installation
                    846: */
                    847: int    ask_reedit(const struct disk_partitions *);
1.1       dholland  848: int    dir_exists_p(const char *);
                    849: int    file_exists_p(const char *);
                    850: int    file_mode_match(const char *, unsigned int);
1.34      martin    851: uint64_t       get_ramsize(void);      /* in MB! */
1.1       dholland  852: void   ask_sizemult(int);
                    853: void   run_makedev(void);
                    854: int    boot_media_still_needed(void);
                    855: int    get_via_floppy(void);
                    856: int    get_via_cdrom(void);
                    857: int    get_via_localfs(void);
                    858: int    get_via_localdir(void);
                    859: void   show_cur_distsets(void);
                    860: void   make_ramdisk_dir(const char *);
                    861: void    set_kernel_set(unsigned int);
1.52      martin    862: void    set_noextract_set(unsigned int);
1.1       dholland  863: unsigned int    get_kernel_set(void);
                    864: unsigned int    set_X11_selected(void);
                    865: int    get_and_unpack_sets(int, msg, msg, msg);
                    866: int    sanity_check(void);
                    867: int    set_timezone(void);
                    868: void   scripting_fprintf(FILE *, const char *, ...) __printflike(2, 3);
                    869: void   scripting_vfprintf(FILE *, const char *, va_list) __printflike(2, 0);
1.35      christos  870: void   add_rc_conf(const char *, ...) __printflike(1, 2);
1.1       dholland  871: int    del_rc_conf(const char *);
                    872: void   add_sysctl_conf(const char *, ...) __printflike(1, 2);
                    873: void   enable_rc_conf(void);
1.54      martin    874: void   set_sizemult(daddr_t, uint bps);
                    875: void   set_default_sizemult(const char *disk, daddr_t unit, uint bps);
1.1       dholland  876: int    check_lfs_progs(void);
                    877: void   init_set_status(int);
                    878: void   customise_sets(void);
                    879: void   umount_mnt2(void);
                    880: int    set_is_source(const char *);
                    881: const char *set_dir_for_set(const char *);
                    882: const char *ext_dir_for_set(const char *);
1.35      christos  883: void   replace(const char *, const char *, ...) __printflike(2, 3);
1.1       dholland  884: void   get_tz_default(void);
1.52      martin    885: distinfo*      get_set_distinfo(int);
1.1       dholland  886: int    extract_file(distinfo *, int);
1.52      martin    887: int extract_file_to(distinfo *dist, int update, const char *dest_dir,
                    888:     const char *extr_pattern, bool do_stats);
1.2       martin    889: void   do_coloring (unsigned int, unsigned int);
                    890: int set_menu_select(menudesc *, void *);
1.5       christos  891: const char *safectime(time_t *);
1.20      martin    892: bool   use_tgz_for_set(const char*);
                    893: const char *set_postfix(const char*);
1.34      martin    894: bool   usage_set_from_parts(struct partition_usage_set*,
                    895:            struct disk_partitions*);
                    896: void   free_usage_set(struct partition_usage_set*);
                    897: bool   install_desc_from_parts(struct install_partition_desc *,
                    898:            struct disk_partitions*);
                    899: void   free_install_desc(struct install_partition_desc*);
1.52      martin    900: bool   may_swap_if_not_sdmmc(const char*);
1.1       dholland  901:
                    902: /* from target.c */
                    903: #if defined(DEBUG)  || defined(DEBUG_ROOT)
                    904: void   backtowin(void);
                    905: #endif
1.39      martin    906: bool   is_root_part_mount(const char *);
1.1       dholland  907: const  char *concat_paths(const char *, const char *);
                    908: const  char *target_expand(const char *);
1.34      martin    909: bool   needs_expanding(const char *, size_t);
1.1       dholland  910: void   make_target_dir(const char *);
                    911: void   append_to_target_file(const char *, const char *);
                    912: void   echo_to_target_file(const char *, const char *);
                    913: void   trunc_target_file(const char *);
                    914: const  char *target_prefix(void);
                    915: int    target_chdir(const char *);
                    916: void   target_chdir_or_die(const char *);
                    917: int    target_already_root(void);
                    918: FILE   *target_fopen(const char *, const char *);
                    919: int    target_collect_file(int, char **, const char *);
                    920: int    is_active_rootpart(const char *, int);
                    921: int    cp_to_target(const char *, const char *);
                    922: void   dup_file_into_target(const char *);
                    923: void   mv_within_target_or_die(const char *, const char *);
                    924: int    cp_within_target(const char *, const char *, int);
1.34      martin    925: int    target_mount(const char *, const char *, const char *);
1.80      martin    926: int    target_unmount(const char *);
1.34      martin    927: int    target_mount_do(const char *, const char *, const char *);
1.1       dholland  928: int    target_test(unsigned int, const char *);
                    929: int    target_dir_exists_p(const char *);
                    930: int    target_file_exists_p(const char *);
                    931: int    target_symlink_exists_p(const char *);
                    932: void   unwind_mounts(void);
1.77      martin    933: void   register_post_umount_delwedge(const char *disk, const char *wedge);
1.1       dholland  934: int    target_mounted(void);
1.43      martin    935: void   umount_root(void);
1.1       dholland  936:
1.2       martin    937: /* from partman.c */
1.19      rin       938: #ifndef NO_PARTMAN
1.2       martin    939: int partman(void);
1.34      martin    940: int pm_getrefdev(struct pm_devs *);
1.19      rin       941: void update_wedges(const char *);
1.34      martin    942: void pm_destroy_all(void);
1.19      rin       943: #else
                    944: static inline int partman(void) { return -1; }
1.34      martin    945: static inline int pm_getrefdev(struct pm_devs *x __unused) { return -1; }
1.19      rin       946: #define update_wedges(x) __nothing
                    947: #endif
1.50      martin    948: void pmdiskentry_enable(menudesc*, struct part_entry *);
1.34      martin    949: int pm_partusage(struct pm_devs *, int, int);
                    950: void pm_setfstype(struct pm_devs *, part_id, int, int);
1.50      martin    951: void pm_set_lvmpv(struct pm_devs *, part_id, bool);
                    952: bool pm_is_lvmpv(struct pm_devs *, part_id, const struct disk_part_info*);
1.2       martin    953: int pm_editpart(int);
1.34      martin    954: void pm_rename(struct pm_devs *);
1.50      martin    955: void pm_shred(struct part_entry *, int);
1.34      martin    956: void pm_umount(struct pm_devs *, int);
                    957: int pm_unconfigure(struct pm_devs *);
1.50      martin    958: int pm_cgd_edit_new(struct pm_devs *pm, part_id id);
                    959: int pm_cgd_edit_old(struct part_entry *);
1.34      martin    960: void pm_wedges_fill(struct pm_devs *);
1.50      martin    961: void pm_edit_partitions(struct part_entry *);
                    962: part_id pm_whole_disk(struct part_entry *, int);
                    963: struct pm_devs * pm_from_pe(struct part_entry *);
                    964: bool pm_force_parts(struct pm_devs *);
1.34      martin    965:
                    966: /*
                    967:  * Parse a file system position or size in a common way, return
                    968:  * sector count and multiplicator.
                    969:  * If "extend" is supported, things like 120+ will be parsed as
                    970:  * 120 plus "extend this" flag.
                    971:  * Caller needs to init muliplicator upfront to the default value.
                    972:  */
                    973: daddr_t parse_disk_pos(
                    974:        const char *,   /* in: input string */
                    975:        daddr_t *,      /* in/out: multiplicator for return value */
1.54      martin    976:        daddr_t bps,    /* in: sector size in bytes */
                    977:        daddr_t,        /* in: cylinder size in sectors */
1.34      martin    978:        bool *);        /* NULL if "extend" is not supported, & of
                    979:                         * "extend" flag otherwise */
1.7       martin    980:
                    981: /* flags whether to offer the respective options (depending on helper
                    982:    programs available on install media */
1.34      martin    983: extern int have_raid, have_vnd, have_cgd, have_lvm, have_gpt, have_dk;
1.7       martin    984: /* initialize above variables */
                    985: void check_available_binaries(void);
1.2       martin    986:
1.1       dholland  987: /* from bsddisklabel.c */
1.66      martin    988: /* returns -1 to restart partitioning, 0 for error, 1 for success */
                    989: int    make_bsd_partitions(struct install_partition_desc*);
1.1       dholland  990: void   set_ptn_titles(menudesc *, int, void *);
                    991: int    set_ptn_size(menudesc *, void *);
1.34      martin    992: bool   get_ptn_sizes(struct partition_usage_set*);
                    993: bool   check_partitions(struct install_partition_desc*);
1.1       dholland  994:
                    995: /* from aout2elf.c */
                    996: int move_aout_libs(void);
                    997:
                    998: #ifdef WSKBD
                    999: void   get_kb_encoding(void);
                   1000: void   save_kb_encoding(void);
                   1001: #else
                   1002: #define        get_kb_encoding()
                   1003: #define        save_kb_encoding()
                   1004: #endif
                   1005:
                   1006: /* from configmenu.c */
1.34      martin   1007: void   do_configmenu(struct install_partition_desc*);
1.81      martin   1008: void   root_pw_setup(void);
1.1       dholland 1009:
                   1010: /* from checkrc.c */
                   1011: int    check_rcvar(const char *);
                   1012: int    check_rcdefault(const char *);
1.58      joerg    1013: extern WINDOW *mainwin;
1.2       martin   1014:
1.34      martin   1015: /* in menus.mi */
                   1016: void expand_all_option_texts(menudesc *menu, void *arg);
                   1017: void resize_menu_height(menudesc *);
                   1018:
1.1       dholland 1019: #endif /* _DEFS_H_ */

CVSweb <webmaster@jp.NetBSD.org>