Wed Apr 22 23:43:12 2020 UTC ()
Don't depend on common symbol definitions.


(joerg)
diff -r1.57 -r1.58 src/usr.sbin/sysinst/defs.h
diff -r1.23 -r1.24 src/usr.sbin/sysinst/main.c
diff -r1.31 -r1.32 src/usr.sbin/sysinst/mbr.c
diff -r1.4 -r1.5 src/usr.sbin/sysinst/mbr.h

cvs diff -r1.57 -r1.58 src/usr.sbin/sysinst/defs.h (expand / switch to unified diff)

--- src/usr.sbin/sysinst/defs.h 2020/03/16 06:48:17 1.57
+++ src/usr.sbin/sysinst/defs.h 2020/04/22 23:43:12 1.58
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: defs.h,v 1.57 2020/03/16 06:48:17 martin Exp $ */ 1/* $NetBSD: defs.h,v 1.58 2020/04/22 23:43:12 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright 1997 Piermont Information Systems Inc. 4 * Copyright 1997 Piermont Information Systems Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Philip A. Nelson for Piermont Information Systems Inc. 7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -350,51 +350,51 @@ struct single_part_fs_edit { @@ -350,51 +350,51 @@ struct single_part_fs_edit {
350 350
351/* 351/*
352 * Description of a full target installation, all partitions and 352 * Description of a full target installation, all partitions and
353 * devices (may be accross several struct pm_devs / disks). 353 * devices (may be accross several struct pm_devs / disks).
354 */ 354 */
355struct install_partition_desc { 355struct install_partition_desc {
356 size_t num; /* how many entries in infos */ 356 size_t num; /* how many entries in infos */
357 struct part_usage_info *infos; /* individual partitions */ 357 struct part_usage_info *infos; /* individual partitions */
358 bool cur_system; /* target is the life system */ 358 bool cur_system; /* target is the life system */
359}; 359};
360 360
361/* variables */ 361/* variables */
362 362
363int debug; /* set by -D option */ 363extern int debug; /* set by -D option */
364 364
365char machine[SSTRSIZE]; 365extern char machine[SSTRSIZE];
366 366
367int ignorerror; 367extern int ignorerror;
368int ttysig_ignore; 368extern int ttysig_ignore;
369pid_t ttysig_forward; 369extern pid_t ttysig_forward;
370uint sizemult; 370extern uint sizemult;
371extern const char *multname; 371extern const char *multname;
372extern const char *err_outofmem; 372extern const char *err_outofmem;
373int partman_go; /* run extended partition manager */ 373extern int partman_go; /* run extended partition manager */
374 374
375/* logging variables */ 375/* logging variables */
376 376
377FILE *logfp; 377extern FILE *logfp;
378FILE *script; 378extern FILE *script;
379 379
380#define MAX_DISKS 15 380#define MAX_DISKS 15
381 381
382daddr_t root_limit; /* BIOS (etc) read limit */ 382extern daddr_t root_limit; /* BIOS (etc) read limit */
383 383
384enum SHRED_T { SHRED_NONE=0, SHRED_ZEROS, SHRED_RANDOM }; 384enum SHRED_T { SHRED_NONE=0, SHRED_ZEROS, SHRED_RANDOM };
385 385
386/* All information that is unique for each drive */ 386/* All information that is unique for each drive */
387SLIST_HEAD(pm_head_t, pm_devs) pm_head; 387extern SLIST_HEAD(pm_head_t, pm_devs) pm_head;
388 388
389struct pm_devs { 389struct pm_devs {
390 /* 390 /*
391 * If device is blocked (e.g. part of a raid) 391 * If device is blocked (e.g. part of a raid)
392 * this is a pointers to the parent dev 392 * this is a pointers to the parent dev
393 */ 393 */
394 void *refdev; 394 void *refdev;
395 395
396 char diskdev[SSTRSIZE]; /* Actual name of the disk. */ 396 char diskdev[SSTRSIZE]; /* Actual name of the disk. */
397 char diskdev_descr[STRSIZE]; /* e.g. IDENTIFY result */ 397 char diskdev_descr[STRSIZE]; /* e.g. IDENTIFY result */
398 398
399 /* 399 /*
400 * What the disk layout should look like. 400 * What the disk layout should look like.
@@ -443,44 +443,44 @@ struct pm_devs { @@ -443,44 +443,44 @@ struct pm_devs {
443 * entries is parts->num_part) may actually be mounted (temporarily) 443 * entries is parts->num_part) may actually be mounted (temporarily)
444 * somewhere, e.g. to access a vnd device on them. This list has 444 * somewhere, e.g. to access a vnd device on them. This list has
445 * a pointer to the current mount point (strdup()'d) if mounted, 445 * a pointer to the current mount point (strdup()'d) if mounted,
446 * or NULL if not. 446 * or NULL if not.
447 */ 447 */
448 char **mounted; 448 char **mounted;
449 449
450 bool unsaved; /* Flag indicating to partman that device need saving */ 450 bool unsaved; /* Flag indicating to partman that device need saving */
451 bool found; /* Flag to delete unplugged and unconfigured devices */ 451 bool found; /* Flag to delete unplugged and unconfigured devices */
452 int blocked; /* Device is busy and cannot be changed */ 452 int blocked; /* Device is busy and cannot be changed */
453 453
454 SLIST_ENTRY(pm_devs) l; 454 SLIST_ENTRY(pm_devs) l;
455}; 455};
456struct pm_devs *pm; /* Pointer to current device with which we work */ 456extern struct pm_devs *pm; /* Pointer to current device with which we work */
457struct pm_devs *pm_new; /* Pointer for next allocating device in find_disks() */ 457extern struct pm_devs *pm_new; /* Pointer for next allocating device in find_disks() */
458 458
459/* Generic structure for partman */ 459/* Generic structure for partman */
460struct part_entry { 460struct part_entry {
461 part_id id; 461 part_id id;
462 struct disk_partitions *parts; 462 struct disk_partitions *parts;
463 void *dev_ptr; 463 void *dev_ptr;
464 size_t index; /* e.g. if PM_RAID: this is raids[index] */ 464 size_t index; /* e.g. if PM_RAID: this is raids[index] */
465 int dev_ptr_delta; 465 int dev_ptr_delta;
466 char fullname[SSTRSIZE]; 466 char fullname[SSTRSIZE];
467 enum {PM_DISK=1, PM_PART, PM_SPEC, 467 enum {PM_DISK=1, PM_PART, PM_SPEC,
468 PM_RAID, PM_CGD, PM_VND, PM_LVM, PM_LVMLV} type; 468 PM_RAID, PM_CGD, PM_VND, PM_LVM, PM_LVMLV} type;
469}; 469};
470 470
471/* Relative file name for storing a distribution. */ 471/* Relative file name for storing a distribution. */
472char xfer_dir[STRSIZE]; 472extern char xfer_dir[STRSIZE];
473int clean_xfer_dir; 473extern int clean_xfer_dir;
474 474
475#if !defined(SYSINST_FTP_HOST) 475#if !defined(SYSINST_FTP_HOST)
476#define SYSINST_FTP_HOST "ftp.NetBSD.org" 476#define SYSINST_FTP_HOST "ftp.NetBSD.org"
477#endif 477#endif
478 478
479#if !defined(SYSINST_HTTP_HOST) 479#if !defined(SYSINST_HTTP_HOST)
480#define SYSINST_HTTP_HOST "cdn.NetBSD.org" 480#define SYSINST_HTTP_HOST "cdn.NetBSD.org"
481#endif 481#endif
482 482
483#if !defined(SYSINST_FTP_DIR) 483#if !defined(SYSINST_FTP_DIR)
484#if defined(NETBSD_OFFICIAL_RELEASE) 484#if defined(NETBSD_OFFICIAL_RELEASE)
485#define SYSINST_FTP_DIR "pub/NetBSD/NetBSD-" REL 485#define SYSINST_FTP_DIR "pub/NetBSD/NetBSD-" REL
486#elif defined(REL_PATH) 486#elif defined(REL_PATH)
@@ -520,83 +520,83 @@ int clean_xfer_dir; @@ -520,83 +520,83 @@ int clean_xfer_dir;
520#endif 520#endif
521 521
522#ifndef SETS_TAR_SUFF 522#ifndef SETS_TAR_SUFF
523#define SETS_TAR_SUFF "tgz" 523#define SETS_TAR_SUFF "tgz"
524#endif 524#endif
525 525
526#ifdef USING_PAXASTAR 526#ifdef USING_PAXASTAR
527#define TAR_EXTRACT_FLAGS "-xhepf" 527#define TAR_EXTRACT_FLAGS "-xhepf"
528#else 528#else
529#define TAR_EXTRACT_FLAGS "-xpf" 529#define TAR_EXTRACT_FLAGS "-xpf"
530#endif 530#endif
531 531
532/* Abs. path we extract binary sets from */ 532/* Abs. path we extract binary sets from */
533char ext_dir_bin[STRSIZE]; 533extern char ext_dir_bin[STRSIZE];
534 534
535/* Abs. path we extract source sets from */ 535/* Abs. path we extract source sets from */
536char ext_dir_src[STRSIZE]; 536extern char ext_dir_src[STRSIZE];
537 537
538/* Abs. path we extract pkgsrc from */ 538/* Abs. path we extract pkgsrc from */
539char ext_dir_pkgsrc[STRSIZE]; 539extern char ext_dir_pkgsrc[STRSIZE];
540 540
541/* Place we look for binary sets in all fs types */ 541/* Place we look for binary sets in all fs types */
542char set_dir_bin[STRSIZE]; 542extern char set_dir_bin[STRSIZE];
543 543
544/* Place we look for source sets in all fs types */ 544/* Place we look for source sets in all fs types */
545char set_dir_src[STRSIZE]; 545extern char set_dir_src[STRSIZE];
546 546
547/* Place we look for pkgs in all fs types */ 547/* Place we look for pkgs in all fs types */
548char pkg_dir[STRSIZE]; 548extern char pkg_dir[STRSIZE];
549 549
550/* Place we look for pkgsrc in all fs types */ 550/* Place we look for pkgsrc in all fs types */
551char pkgsrc_dir[STRSIZE]; 551extern char pkgsrc_dir[STRSIZE];
552 552
553/* User shell */ 553/* User shell */
554const char *ushell; 554extern const char *ushell;
555 555
556#define XFER_FTP 0 556#define XFER_FTP 0
557#define XFER_HTTP 1 557#define XFER_HTTP 1
558#define XFER_MAX XFER_HTTP 558#define XFER_MAX XFER_HTTP
559 559
560struct ftpinfo { 560struct ftpinfo {
561 char xfer_host[XFER_MAX+1][STRSIZE]; 561 char xfer_host[XFER_MAX+1][STRSIZE];
562 char dir[STRSIZE] ; 562 char dir[STRSIZE] ;
563 char user[SSTRSIZE]; 563 char user[SSTRSIZE];
564 char pass[STRSIZE]; 564 char pass[STRSIZE];
565 char proxy[STRSIZE]; 565 char proxy[STRSIZE];
566 unsigned int xfer; /* XFER_FTP for "ftp" or XFER_HTTP for "http" */ 566 unsigned int xfer; /* XFER_FTP for "ftp" or XFER_HTTP for "http" */
567}; 567};
568 568
569/* use the same struct for sets ftp and to build pkgpath */ 569/* use the same struct for sets ftp and to build pkgpath */
570struct ftpinfo ftp, pkg, pkgsrc; 570extern struct ftpinfo ftp, pkg, pkgsrc;
571 571
572int (*fetch_fn)(const char *); 572extern int (*fetch_fn)(const char *);
573char nfs_host[STRSIZE]; 573extern char nfs_host[STRSIZE];
574char nfs_dir[STRSIZE]; 574extern char nfs_dir[STRSIZE];
575 575
576char cdrom_dev[SSTRSIZE]; /* Typically "cd0a" */ 576extern char cdrom_dev[SSTRSIZE]; /* Typically "cd0a" */
577char fd_dev[SSTRSIZE]; /* Typically "/dev/fd0a" */ 577extern char fd_dev[SSTRSIZE]; /* Typically "/dev/fd0a" */
578const char *fd_type; /* "msdos", "ffs" or maybe "ados" */ 578extern const char *fd_type; /* "msdos", "ffs" or maybe "ados" */
579 579
580char localfs_dev[SSTRSIZE]; 580extern char localfs_dev[SSTRSIZE];
581char localfs_fs[SSTRSIZE]; 581extern char localfs_fs[SSTRSIZE];
582char localfs_dir[STRSIZE]; 582extern char localfs_dir[STRSIZE];
583 583
584char targetroot_mnt[SSTRSIZE]; 584extern char targetroot_mnt[SSTRSIZE];
585 585
586int mnt2_mounted; 586extern int mnt2_mounted;
587 587
588char dist_postfix[SSTRSIZE]; 588extern char dist_postfix[SSTRSIZE];
589char dist_tgz_postfix[SSTRSIZE]; 589extern char dist_tgz_postfix[SSTRSIZE];
590 590
591/* needed prototypes */ 591/* needed prototypes */
592void set_menu_numopts(int, int); 592void set_menu_numopts(int, int);
593void remove_color_options(void); 593void remove_color_options(void);
594void remove_raid_options(void); 594void remove_raid_options(void);
595void remove_lvm_options(void); 595void remove_lvm_options(void);
596void remove_cgd_options(void); 596void remove_cgd_options(void);
597 597
598/* Machine dependent functions .... */ 598/* Machine dependent functions .... */
599void md_init(void); 599void md_init(void);
600void md_init_set_status(int); /* SFLAG_foo */ 600void md_init_set_status(int); /* SFLAG_foo */
601 601
602 /* MD functions if user selects install - in order called */ 602 /* MD functions if user selects install - in order called */
@@ -941,20 +941,20 @@ int move_aout_libs(void); @@ -941,20 +941,20 @@ int move_aout_libs(void);
941void get_kb_encoding(void); 941void get_kb_encoding(void);
942void save_kb_encoding(void); 942void save_kb_encoding(void);
943#else 943#else
944#define get_kb_encoding() 944#define get_kb_encoding()
945#define save_kb_encoding() 945#define save_kb_encoding()
946#endif 946#endif
947 947
948/* from configmenu.c */ 948/* from configmenu.c */
949void do_configmenu(struct install_partition_desc*); 949void do_configmenu(struct install_partition_desc*);
950 950
951/* from checkrc.c */ 951/* from checkrc.c */
952int check_rcvar(const char *); 952int check_rcvar(const char *);
953int check_rcdefault(const char *); 953int check_rcdefault(const char *);
954 WINDOW *mainwin; 954extern WINDOW *mainwin;
955 955
956/* in menus.mi */ 956/* in menus.mi */
957void expand_all_option_texts(menudesc *menu, void *arg); 957void expand_all_option_texts(menudesc *menu, void *arg);
958void resize_menu_height(menudesc *); 958void resize_menu_height(menudesc *);
959 959
960#endif /* _DEFS_H_ */ 960#endif /* _DEFS_H_ */

cvs diff -r1.23 -r1.24 src/usr.sbin/sysinst/main.c (expand / switch to unified diff)

--- src/usr.sbin/sysinst/main.c 2020/03/04 11:15:06 1.23
+++ src/usr.sbin/sysinst/main.c 2020/04/22 23:43:12 1.24
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: main.c,v 1.23 2020/03/04 11:15:06 martin Exp $ */ 1/* $NetBSD: main.c,v 1.24 2020/04/22 23:43:12 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright 1997 Piermont Information Systems Inc. 4 * Copyright 1997 Piermont Information Systems Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Philip A. Nelson for Piermont Information Systems Inc. 7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -42,26 +42,65 @@ @@ -42,26 +42,65 @@
42#include <signal.h> 42#include <signal.h>
43#include <curses.h> 43#include <curses.h>
44#include <unistd.h> 44#include <unistd.h>
45#include <fcntl.h> 45#include <fcntl.h>
46#include <dirent.h> 46#include <dirent.h>
47#include <locale.h> 47#include <locale.h>
48 48
49#include "defs.h" 49#include "defs.h"
50#include "md.h" 50#include "md.h"
51#include "msg_defs.h" 51#include "msg_defs.h"
52#include "menu_defs.h" 52#include "menu_defs.h"
53#include "txtwalk.h" 53#include "txtwalk.h"
54 54
 55int debug;
 56char machine[SSTRSIZE];
 57int ignorerror;
 58int ttysig_ignore;
 59pid_t ttysig_forward;
 60uint sizemult;
 61int partman_go;
 62FILE *logfp;
 63FILE *script;
 64daddr_t root_limit;
 65struct pm_head_t pm_head;
 66struct pm_devs *pm;
 67struct pm_devs *pm_new;
 68char xfer_dir[STRSIZE];
 69int clean_xfer_dir;
 70char ext_dir_bin[STRSIZE];
 71char ext_dir_src[STRSIZE];
 72char ext_dir_pkgsrc[STRSIZE];
 73char set_dir_bin[STRSIZE];
 74char set_dir_src[STRSIZE];
 75char pkg_dir[STRSIZE];
 76char pkgsrc_dir[STRSIZE];
 77const char *ushell;
 78struct ftpinfo ftp, pkg, pkgsrc;
 79int (*fetch_fn)(const char *);
 80char nfs_host[STRSIZE];
 81char nfs_dir[STRSIZE];
 82char cdrom_dev[SSTRSIZE];
 83char fd_dev[SSTRSIZE];
 84const char *fd_type;
 85char localfs_dev[SSTRSIZE];
 86char localfs_fs[SSTRSIZE];
 87char localfs_dir[STRSIZE];
 88char targetroot_mnt[SSTRSIZE];
 89int mnt2_mounted;
 90char dist_postfix[SSTRSIZE];
 91char dist_tgz_postfix[SSTRSIZE];
 92WINDOW *mainwin;
 93
55static void select_language(void); 94static void select_language(void);
56__dead static void usage(void); 95__dead static void usage(void);
57__dead static void miscsighandler(int); 96__dead static void miscsighandler(int);
58static void ttysighandler(int); 97static void ttysighandler(int);
59static void cleanup(void); 98static void cleanup(void);
60static void process_f_flag(char *); 99static void process_f_flag(char *);
61 100
62static int exit_cleanly = 0; /* Did we finish nicely? */ 101static int exit_cleanly = 0; /* Did we finish nicely? */
63FILE *logfp; /* log file */ 102FILE *logfp; /* log file */
64FILE *script; /* script file */ 103FILE *script; /* script file */
65 104
66const char *multname; 105const char *multname;
67const char *err_outofmem; 106const char *err_outofmem;

cvs diff -r1.31 -r1.32 src/usr.sbin/sysinst/mbr.c (expand / switch to unified diff)

--- src/usr.sbin/sysinst/mbr.c 2020/02/06 18:07:22 1.31
+++ src/usr.sbin/sysinst/mbr.c 2020/04/22 23:43:12 1.32
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mbr.c,v 1.31 2020/02/06 18:07:22 martin Exp $ */ 1/* $NetBSD: mbr.c,v 1.32 2020/04/22 23:43:12 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright 1997 Piermont Information Systems Inc. 4 * Copyright 1997 Piermont Information Systems Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Philip A. Nelson for Piermont Information Systems Inc. 7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -134,27 +134,27 @@ struct mbr_disk_partitions { @@ -134,27 +134,27 @@ struct mbr_disk_partitions {
134 mbr_info_t mbr; 134 mbr_info_t mbr;
135 uint ptn_alignment, ptn_0_offset, ext_ptn_alignment, 135 uint ptn_alignment, ptn_0_offset, ext_ptn_alignment,
136 geo_sec, geo_head, geo_cyl; 136 geo_sec, geo_head, geo_cyl;
137}; 137};
138 138
139const struct disk_partitioning_scheme mbr_parts; 139const struct disk_partitioning_scheme mbr_parts;
140 140
141static size_t known_part_types = 0, last_added_part_type = 0; 141static size_t known_part_types = 0, last_added_part_type = 0;
142static const size_t first_part_type = MBR_PTYPE_NETBSD; 142static const size_t first_part_type = MBR_PTYPE_NETBSD;
143 143
144/* all partition types (we are lucky, only a fixed number is possible) */ 144/* all partition types (we are lucky, only a fixed number is possible) */
145struct mbr_part_type_info mbr_gen_type_desc[256]; 145struct mbr_part_type_info mbr_gen_type_desc[256];
146 146
147const struct disk_partitioning_scheme disklabel_parts; 147extern const struct disk_partitioning_scheme disklabel_parts;
148 148
149static void convert_mbr_chs(int, int, int, uint8_t *, uint8_t *, 149static void convert_mbr_chs(int, int, int, uint8_t *, uint8_t *,
150 uint8_t *, uint32_t); 150 uint8_t *, uint32_t);
151 151
152static part_id mbr_add_part(struct disk_partitions *arg, 152static part_id mbr_add_part(struct disk_partitions *arg,
153 const struct disk_part_info *info, const char **errmsg); 153 const struct disk_part_info *info, const char **errmsg);
154 154
155static size_t mbr_get_free_spaces(const struct disk_partitions *arg, 155static size_t mbr_get_free_spaces(const struct disk_partitions *arg,
156 struct disk_part_free_space *result, size_t max_num_result, 156 struct disk_part_free_space *result, size_t max_num_result,
157 daddr_t min_size, daddr_t align, daddr_t lower_bound, daddr_t ignore); 157 daddr_t min_size, daddr_t align, daddr_t lower_bound, daddr_t ignore);
158 158
159static size_t mbr_type_from_gen_desc(const struct part_type_desc *desc); 159static size_t mbr_type_from_gen_desc(const struct part_type_desc *desc);
160 160

cvs diff -r1.4 -r1.5 src/usr.sbin/sysinst/mbr.h (expand / switch to unified diff)

--- src/usr.sbin/sysinst/mbr.h 2019/11/12 16:33:14 1.4
+++ src/usr.sbin/sysinst/mbr.h 2020/04/22 23:43:12 1.5
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mbr.h,v 1.4 2019/11/12 16:33:14 martin Exp $ */ 1/* $NetBSD: mbr.h,v 1.5 2020/04/22 23:43:12 joerg Exp $ */
2 2
3/* 3/*
4 * Copyright 1997, 1988 Piermont Information Systems Inc. 4 * Copyright 1997, 1988 Piermont Information Systems Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Philip A. Nelson for Piermont Information Systems Inc. 7 * Written by Philip A. Nelson for Piermont Information Systems Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -66,27 +66,27 @@ struct mbr_info_t { @@ -66,27 +66,27 @@ struct mbr_info_t {
66 uint sector; /* where we read this from */ 66 uint sector; /* where we read this from */
67 mbr_info_t *extended; /* next in extended partition list */ 67 mbr_info_t *extended; /* next in extended partition list */
68 const char *last_mounted[MBR_PART_COUNT]; 68 const char *last_mounted[MBR_PART_COUNT];
69 uint fs_type[MBR_PART_COUNT], fs_sub_type[MBR_PART_COUNT]; 69 uint fs_type[MBR_PART_COUNT], fs_sub_type[MBR_PART_COUNT];
70#ifdef BOOTSEL 70#ifdef BOOTSEL
71 /* only in first item... */ 71 /* only in first item... */
72 uint bootsec; /* start sector of bootmenu default */ 72 uint bootsec; /* start sector of bootmenu default */
73#endif 73#endif
74 /* for temporary access */ 74 /* for temporary access */
75 char wedge[MBR_PART_COUNT][MBR_DEV_LEN]; 75 char wedge[MBR_PART_COUNT][MBR_DEV_LEN];
76}; 76};
77 77
78#ifdef BOOTSEL 78#ifdef BOOTSEL
79struct mbr_bootsel *mbs; 79extern struct mbr_bootsel *mbs;
80 80
81 /* sync with src/sbin/fdisk/fdisk.c */ 81 /* sync with src/sbin/fdisk/fdisk.c */
82#define DEFAULT_BOOTDIR "/usr/mdec" 82#define DEFAULT_BOOTDIR "/usr/mdec"
83#define DEFAULT_BOOTCODE "mbr" 83#define DEFAULT_BOOTCODE "mbr"
84#define DEFAULT_BOOTSELCODE "mbr_bootsel" 84#define DEFAULT_BOOTSELCODE "mbr_bootsel"
85#define DEFAULT_BOOTEXTCODE "mbr_ext" 85#define DEFAULT_BOOTEXTCODE "mbr_ext"
86 86
87/* Scan values for the various keys we use, as returned by the BIOS */ 87/* Scan values for the various keys we use, as returned by the BIOS */
88#define SCAN_ENTER 0x1c 88#define SCAN_ENTER 0x1c
89#define SCAN_F1 0x3b 89#define SCAN_F1 0x3b
90#define SCAN_1 0x2 90#define SCAN_1 0x2
91 91
92#endif /* BOOTSEL */ 92#endif /* BOOTSEL */