diff --git a/distrib/utils/sysinst/arch/acorn26/md.c b/distrib/utils/sysinst/arch/acorn26/md.c index 03ff632a9cdb..7f29e3b42180 100644 --- a/distrib/utils/sysinst/arch/acorn26/md.c +++ b/distrib/utils/sysinst/arch/acorn26/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.18 2006/02/26 10:25:52 dsl Exp $ */ +/* $NetBSD: md.c,v 1.19 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -347,3 +347,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/acorn32/md.c b/distrib/utils/sysinst/arch/acorn32/md.c index 104db0c71915..cc8aee0f062e 100644 --- a/distrib/utils/sysinst/arch/acorn32/md.c +++ b/distrib/utils/sysinst/arch/acorn32/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.19 2006/02/26 10:25:52 dsl Exp $ */ +/* $NetBSD: md.c,v 1.20 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -347,3 +347,9 @@ void md_init(void) { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/amiga/md.c b/distrib/utils/sysinst/arch/amiga/md.c index d61a1cac399e..3ca3893b5dcd 100644 --- a/distrib/utils/sysinst/arch/amiga/md.c +++ b/distrib/utils/sysinst/arch/amiga/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.18 2006/02/26 10:25:52 dsl Exp $ */ +/* $NetBSD: md.c,v 1.19 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -128,3 +128,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/arc/md.c b/distrib/utils/sysinst/arch/arc/md.c index 1fc28f536752..58aed24f5d11 100644 --- a/distrib/utils/sysinst/arch/arc/md.c +++ b/distrib/utils/sysinst/arch/arc/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.26 2006/02/26 10:25:52 dsl Exp $ */ +/* $NetBSD: md.c,v 1.27 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -172,3 +172,21 @@ void md_init(void) { } + +int +md_post_extract(void) +{ + return 0; +} + +int +md_check_mbr(mbr_info_t *mbri) +{ + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + return mbr_use_wholedisk(mbri); +} diff --git a/distrib/utils/sysinst/arch/atari/md.c b/distrib/utils/sysinst/arch/atari/md.c index 887b4591488b..36c78bd5cb81 100644 --- a/distrib/utils/sysinst/arch/atari/md.c +++ b/distrib/utils/sysinst/arch/atari/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.19 2006/02/26 10:25:52 dsl Exp $ */ +/* $NetBSD: md.c,v 1.20 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -155,3 +155,9 @@ void md_init(void) { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/bebox/md.c b/distrib/utils/sysinst/arch/bebox/md.c index 6b542bc0d14f..4eafc6c3b34b 100644 --- a/distrib/utils/sysinst/arch/bebox/md.c +++ b/distrib/utils/sysinst/arch/bebox/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.48 2006/02/26 10:25:52 dsl Exp $ */ +/* $NetBSD: md.c,v 1.49 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -172,3 +172,21 @@ md_bios_info(char *dev) set_bios_geom(cyl, head, sec); return 0; } + +int +md_post_extract(void) +{ + return 0; +} + +int +md_check_mbr(mbr_info_t *mbri) +{ + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + return mbr_use_wholedisk(mbri); +} diff --git a/distrib/utils/sysinst/arch/cats/md.c b/distrib/utils/sysinst/arch/cats/md.c index 2adb5d82f435..98776cbc69bc 100644 --- a/distrib/utils/sysinst/arch/cats/md.c +++ b/distrib/utils/sysinst/arch/cats/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.17 2006/02/26 10:25:52 dsl Exp $ */ +/* $NetBSD: md.c,v 1.18 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -200,3 +200,9 @@ void md_init(void) { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/evbarm/md.c b/distrib/utils/sysinst/arch/evbarm/md.c index e4d4d28ab96e..0f2653f2938f 100644 --- a/distrib/utils/sysinst/arch/evbarm/md.c +++ b/distrib/utils/sysinst/arch/evbarm/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.18 2006/02/26 10:25:53 dsl Exp $ */ +/* $NetBSD: md.c,v 1.19 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -173,3 +173,9 @@ void md_init(void) { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/evbmips/md.c b/distrib/utils/sysinst/arch/evbmips/md.c index 1ee2c1130d73..20409b9ad93d 100644 --- a/distrib/utils/sysinst/arch/evbmips/md.c +++ b/distrib/utils/sysinst/arch/evbmips/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.1 2006/03/30 15:45:42 shige Exp $ */ +/* $NetBSD: md.c,v 1.2 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997,2002 Piermont Information Systems Inc. @@ -173,3 +173,21 @@ md_bios_info(dev) return 0; } + +int +md_post_extract(void) +{ + return 0; +} + +int +md_check_mbr(mbr_info_t *mbri) +{ + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + return mbr_use_wholedisk(mbri); +} diff --git a/distrib/utils/sysinst/arch/evbppc/md.c b/distrib/utils/sysinst/arch/evbppc/md.c index aa6b070018e2..281f2d4b40af 100644 --- a/distrib/utils/sysinst/arch/evbppc/md.c +++ b/distrib/utils/sysinst/arch/evbppc/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.24 2006/02/26 10:25:53 dsl Exp $ */ +/* $NetBSD: md.c,v 1.25 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997,2002 Piermont Information Systems Inc. @@ -177,3 +177,21 @@ md_bios_info(dev) set_bios_geom(cyl, head, sec); return 0; } + +int +md_post_extract(void) +{ + return 0; +} + +int +md_check_mbr(mbr_info_t *mbri) +{ + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + return mbr_use_wholedisk(mbri); +} diff --git a/distrib/utils/sysinst/arch/ews4800mips/md.c b/distrib/utils/sysinst/arch/ews4800mips/md.c index 74fa7a7b3431..eaddf7e8be2d 100644 --- a/distrib/utils/sysinst/arch/ews4800mips/md.c +++ b/distrib/utils/sysinst/arch/ews4800mips/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.2 2006/02/26 10:25:53 dsl Exp $ */ +/* $NetBSD: md.c,v 1.3 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -232,3 +232,9 @@ ews4800mips_sysvbfs_size(void) return (8 * 1024 * 1024) / 512; /* 8MB */ } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/hp300/md.c b/distrib/utils/sysinst/arch/hp300/md.c index 2a25f4c88310..3c2e0fb9c04e 100644 --- a/distrib/utils/sysinst/arch/hp300/md.c +++ b/distrib/utils/sysinst/arch/hp300/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.23 2006/03/21 06:18:29 tsutsui Exp $ */ +/* $NetBSD: md.c,v 1.24 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -260,3 +260,9 @@ hp300_boot_size(void) return i; } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/hp700/md.c b/distrib/utils/sysinst/arch/hp700/md.c index 9f51de1d456c..8532c3cfd049 100644 --- a/distrib/utils/sysinst/arch/hp700/md.c +++ b/distrib/utils/sysinst/arch/hp700/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.3 2006/02/26 10:25:53 dsl Exp $ */ +/* $NetBSD: md.c,v 1.4 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -203,3 +203,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/hpcarm/md.c b/distrib/utils/sysinst/arch/hpcarm/md.c index 2abe98b0541d..85033334ba14 100644 --- a/distrib/utils/sysinst/arch/hpcarm/md.c +++ b/distrib/utils/sysinst/arch/hpcarm/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.2 2006/02/26 10:25:53 dsl Exp $ */ +/* $NetBSD: md.c,v 1.3 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -162,3 +162,21 @@ void md_init(void) { } + +int +md_post_extract(void) +{ + return 0; +} + +int +md_check_mbr(mbr_info_t *mbri) +{ + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + return mbr_use_wholedisk(mbri); +} diff --git a/distrib/utils/sysinst/arch/hpcmips/md.c b/distrib/utils/sysinst/arch/hpcmips/md.c index 4e3a210d9c4d..e4bd385bd17e 100644 --- a/distrib/utils/sysinst/arch/hpcmips/md.c +++ b/distrib/utils/sysinst/arch/hpcmips/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.40 2006/02/26 10:25:53 dsl Exp $ */ +/* $NetBSD: md.c,v 1.41 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -161,3 +161,21 @@ void md_init(void) { } + +int +md_post_extract(void) +{ + return 0; +} + +int +md_check_mbr(mbr_info_t *mbri) +{ + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + return mbr_use_wholedisk(mbri); +} diff --git a/distrib/utils/sysinst/arch/i386/md.c b/distrib/utils/sysinst/arch/i386/md.c index e9a754a51aad..96f524650569 100644 --- a/distrib/utils/sysinst/arch/i386/md.c +++ b/distrib/utils/sysinst/arch/i386/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.110 2006/02/26 10:25:53 dsl Exp $ */ +/* $NetBSD: md.c,v 1.111 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -630,3 +630,21 @@ md_bootxx_name(void) asprintf(&bootxx, "/usr/mdec/bootxx_%s", bootfs); return bootxx; } + +int +md_post_extract(void) +{ + return 0; +} + +int +md_check_mbr(mbr_info_t *mbri) +{ + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + return mbr_use_wholedisk(mbri); +} diff --git a/distrib/utils/sysinst/arch/mac68k/md.c b/distrib/utils/sysinst/arch/mac68k/md.c index d0960a3175b5..ab50300c5921 100644 --- a/distrib/utils/sysinst/arch/mac68k/md.c +++ b/distrib/utils/sysinst/arch/mac68k/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.46 2006/02/26 10:25:53 dsl Exp $ */ +/* $NetBSD: md.c,v 1.47 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1155,3 +1155,9 @@ md_init() */ set_kernel_set(SET_KERNEL_1); } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/macppc/md.c b/distrib/utils/sysinst/arch/macppc/md.c index 54fe6aaaebe1..072f6a89a9f1 100644 --- a/distrib/utils/sysinst/arch/macppc/md.c +++ b/distrib/utils/sysinst/arch/macppc/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.35 2006/02/26 10:25:53 dsl Exp $ */ +/* $NetBSD: md.c,v 1.36 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -188,3 +188,9 @@ void md_init(void) { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/mipsco/md.c b/distrib/utils/sysinst/arch/mipsco/md.c index 17ccda8f445b..226cdef56c2b 100644 --- a/distrib/utils/sysinst/arch/mipsco/md.c +++ b/distrib/utils/sysinst/arch/mipsco/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.12 2006/02/26 10:25:53 dsl Exp $ */ +/* $NetBSD: md.c,v 1.13 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -219,3 +219,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/mvme68k/md.c b/distrib/utils/sysinst/arch/mvme68k/md.c index 9095ee54bc4e..8f9bb26b035f 100644 --- a/distrib/utils/sysinst/arch/mvme68k/md.c +++ b/distrib/utils/sysinst/arch/mvme68k/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.17 2006/02/26 10:25:53 dsl Exp $ */ +/* $NetBSD: md.c,v 1.18 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -247,3 +247,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/news68k/md.c b/distrib/utils/sysinst/arch/news68k/md.c index 36ec6e398f20..61c0eae163b1 100644 --- a/distrib/utils/sysinst/arch/news68k/md.c +++ b/distrib/utils/sysinst/arch/news68k/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.25 2006/03/21 02:06:31 tsutsui Exp $ */ +/* $NetBSD: md.c,v 1.26 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -215,3 +215,9 @@ void md_init(void) { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/newsmips/md.c b/distrib/utils/sysinst/arch/newsmips/md.c index 64586be024cb..e52b7a491824 100644 --- a/distrib/utils/sysinst/arch/newsmips/md.c +++ b/distrib/utils/sysinst/arch/newsmips/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.13 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.14 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -210,3 +210,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/pc532/md.c b/distrib/utils/sysinst/arch/pc532/md.c index 15fe36e6ecba..8ff70157f6fc 100644 --- a/distrib/utils/sysinst/arch/pc532/md.c +++ b/distrib/utils/sysinst/arch/pc532/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.32 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.33 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -129,3 +129,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/playstation2/md.c b/distrib/utils/sysinst/arch/playstation2/md.c index a4b08461ff10..aaa5fe49c9e5 100644 --- a/distrib/utils/sysinst/arch/playstation2/md.c +++ b/distrib/utils/sysinst/arch/playstation2/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.19 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.20 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -162,3 +162,21 @@ md_check_partitions() return (1); } + +int +md_post_extract(void) +{ + return 0; +} + +int +md_check_mbr(mbr_info_t *mbri) +{ + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + return mbr_use_wholedisk(mbri); +} diff --git a/distrib/utils/sysinst/arch/pmax/md.c b/distrib/utils/sysinst/arch/pmax/md.c index a41a2ce3a372..a97a4f175f5b 100644 --- a/distrib/utils/sysinst/arch/pmax/md.c +++ b/distrib/utils/sysinst/arch/pmax/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.58 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.59 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -218,3 +218,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/pmppc/md.c b/distrib/utils/sysinst/arch/pmppc/md.c index a9c3b67d571b..0bb2214827a8 100644 --- a/distrib/utils/sysinst/arch/pmppc/md.c +++ b/distrib/utils/sysinst/arch/pmppc/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.5 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.6 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997,2002 Piermont Information Systems Inc. @@ -177,3 +177,21 @@ md_bios_info(dev) set_bios_geom(cyl, head, sec); return 0; } + +int +md_post_extract(void) +{ + return 0; +} + +int +md_check_mbr(mbr_info_t *mbri) +{ + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + return mbr_use_wholedisk(mbri); +} diff --git a/distrib/utils/sysinst/arch/prep/md.c b/distrib/utils/sysinst/arch/prep/md.c index 8f515d4f4e9e..e8b7e432f1cf 100644 --- a/distrib/utils/sysinst/arch/prep/md.c +++ b/distrib/utils/sysinst/arch/prep/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.22 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.23 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -47,20 +47,89 @@ #include #include "defs.h" -#include "md.h" #include "msg_defs.h" #include "menu_defs.h" +#include "md.h" #include "endian.h" +int prep_nobootfix = 0, prep_rawdevfix = 0, prep_bootpart = PART_BOOT; + +int md_check_mbr(mbr_info_t *mbri) +{ + mbr_info_t *ext; + struct mbr_partition *part; + int i; + + for (ext = mbri; ext; ext = ext->extended) { + part = ext->mbr.mbr_parts; + for (i = 0; i < MBR_PART_COUNT; part++, i++) { + if (part->mbrp_type != MBR_PTYPE_PREP) + continue; + bootstart = part->mbrp_start; + bootsize = part->mbrp_size; + break; + } + } + if (bootsize < (MIN_PREP_BOOT/512)) { + msg_display(MSG_preptoosmall); + msg_display_add(MSG_reeditpart, 0); + process_menu(MENU_yesno, NULL); + if (!yesno) + return 0; + return 1; + } + if (bootstart == 0 || bootsize == 0) { + msg_display(MSG_nopreppart); + msg_display_add(MSG_reeditpart, 0); + process_menu(MENU_yesno, NULL); + if (!yesno) + return 0; + return 1; + } + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + struct mbr_sector *mbrs = &mbri->mbr; + mbr_info_t *ext; + struct mbr_partition *part; + + part = &mbrs->mbr_parts[0]; + /* Set the partition information for full disk usage. */ + while ((ext = mbri->extended)) { + mbri->extended = ext->extended; + free(ext); + } + memset(part, 0, MBR_PART_COUNT * sizeof *part); +#ifdef BOOTSEL + memset(&mbri->mbrb, 0, sizeof mbri->mbrb); +#endif + part[0].mbrp_type = MBR_PTYPE_PREP; + part[0].mbrp_size = PREP_BOOT_SIZE/512; + part[0].mbrp_start = bsec; + part[0].mbrp_flag = MBR_PFLAG_ACTIVE; + + part[1].mbrp_type = MBR_PTYPE_NETBSD; + part[1].mbrp_size = dlsize - (bsec + PREP_BOOT_SIZE/512); + part[1].mbrp_start = bsec + PREP_BOOT_SIZE/512; + part[1].mbrp_flag = 0; + + ptstart = part[1].mbrp_start; + ptsize = part[1].mbrp_size; + bootstart = part[0].mbrp_start; + bootsize = part[0].mbrp_size; + return 1; +} int md_get_info(void) { read_mbr(diskdev, &mbr); - edit_mbr(&mbr); - - return 1; + md_bios_info(diskdev); + return edit_mbr(&mbr); } int @@ -116,7 +185,21 @@ md_make_bsd_partitions(void) int md_check_partitions(void) { - return 1; + int part; + + /* we need to find a boot partition, otherwise we can't write our + * "bootblock". We make the assumption that the user hasn't done + * something stupid, like move it away from the MBR partition. + */ + for (part = PART_A; part < MAXPARTITIONS; part++) + if (bsdlabel[part].pi_fstype == FS_BOOT) { + prep_bootpart = part; + return 1; + } + + msg_display(MSG_prepnobootpart); + process_menu(MENU_ok, NULL); + return 0; } /* Upgrade support */ @@ -143,15 +226,83 @@ md_cleanup_install(void) run_program(0, "rm -f %s", target_expand("/sysinst")); run_program(0, "rm -f %s", target_expand("/.termcap")); run_program(0, "rm -f %s", target_expand("/.profile")); + run_program(0, "rm -f %s", target_expand("/.bootimage")); } int md_pre_update(void) { + struct mbr_partition *part; + mbr_info_t *ext; + int i; + read_mbr(diskdev, &mbr); + /* do a sanity check of the partition table */ + for (ext = &mbr; ext; ext = ext->extended) { + part = ext->mbr.mbr_parts; + for (i = 0; i < MBR_PART_COUNT; part++, i++) { + if (part->mbrp_type != MBR_PTYPE_PREP) + continue; + if (part->mbrp_size < (MIN_PREP_BOOT/512)) { + msg_display(MSG_preptoosmall); + msg_display_add(MSG_prepnobootpart, 0); + process_menu(MENU_yesno, NULL); + if (!yesno) + return 0; + prep_nobootfix = 1; + } + if (part->mbrp_start == 0) + prep_rawdevfix = 1; + } + } + if (md_check_partitions() == 0) + prep_nobootfix = 1; return 1; } +int +md_bios_info(char *dev) +{ + int cyl, head, sec; + + msg_display(MSG_nobiosgeom, dlcyl, dlhead, dlsec); + if (guess_biosgeom_from_mbr(&mbr, &cyl, &head, &sec) >= 0) + msg_display_add(MSG_biosguess, cyl, head, sec); + set_bios_geom(cyl, head, sec); + return 0; +} + +int +md_post_extract(void) +{ + char rawdev[100], bootpart[100], bootloader[100]; + + /* if we can't make it bootable, just punt */ + if (prep_nobootfix) + return 0; + + process_menu(MENU_prepconsole, NULL); + if (yesno == 1) + snprintf(bootloader, 100, "/usr/mdec/boot_com0"); + else + snprintf(bootloader, 100, "/usr/mdec/boot"); + + snprintf(rawdev, 100, "/dev/r%s%c", diskdev, 'a' + getrawpartition()); + snprintf(bootpart, 100, "/dev/r%s%c", diskdev, 'a' + prep_bootpart); + if (prep_rawdevfix) + run_program(RUN_DISPLAY|RUN_CHROOT, + "/usr/mdec/mkbootimage -b %s -k /netbsd " + "-r %s /.bootimage", bootloader, rawdev); + else + run_program(RUN_DISPLAY|RUN_CHROOT, + "/usr/mdec/mkbootimage -s -b %s -k /netbsd /.bootimage", + bootloader); + run_program(RUN_DISPLAY|RUN_CHROOT, "/bin/dd if=/.bootimage of=%s " + "bs=512", bootpart); + + return 0; +} + void md_init(void) { diff --git a/distrib/utils/sysinst/arch/prep/md.h b/distrib/utils/sysinst/arch/prep/md.h index acede5a8ab21..006c2c0d9089 100644 --- a/distrib/utils/sysinst/arch/prep/md.h +++ b/distrib/utils/sysinst/arch/prep/md.h @@ -1,4 +1,4 @@ -/* $NetBSD: md.h,v 1.14 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.h,v 1.15 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -49,14 +49,18 @@ #include "mbr.h" /* constants and defines */ +#define PREP_BOOT_SIZE 5017600 /* 5MB boot partition */ +#define MIN_PREP_BOOT 2097152 /* 2MB absoule minimum */ #define PART_ROOT PART_A #define PART_SWAP PART_B #define PART_RAW PART_C -#define PART_USR PART_D /* Can be after PART_FIRST_FREE */ -#define PART_FIRST_FREE PART_E +#define PART_BSD PART_D +#define PART_BOOT PART_E +#define PART_USR PART_F /* Can be after PART_FIRST_FREE */ +#define PART_FIRST_FREE PART_G #define DEFSWAPRAM 32 /* Assume at least this RAM for swap calc */ -#define DEFROOTSIZE 24 /* Default root size */ +#define DEFROOTSIZE 32 /* Default root size */ #define DEFVARSIZE 32 /* Default /var size, if created */ #define DEFUSRSIZE 128 /* Default /usr size, if /home */ #define XNEEDMB 39 /* Extra megs for full X installation */ diff --git a/distrib/utils/sysinst/arch/prep/menus.md.en b/distrib/utils/sysinst/arch/prep/menus.md.en index d25fdd3ef46b..6429179cadcd 100644 --- a/distrib/utils/sysinst/arch/prep/menus.md.en +++ b/distrib/utils/sysinst/arch/prep/menus.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.en,v 1.10 2003/06/12 10:51:42 dsl Exp $ */ +/* $NetBSD: menus.md.en,v 1.11 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -38,3 +38,6 @@ /* Menu definitions for sysinst. prep version, machine dependent. */ +menu prepconsole, title "Select console device", y=-10; + option "com0 (S1)", exit, action { yesno = 1; }; + option "VGA", exit, action { yesno = 0; }; diff --git a/distrib/utils/sysinst/arch/prep/menus.md.es b/distrib/utils/sysinst/arch/prep/menus.md.es index 693184826c4e..ef4eba354175 100644 --- a/distrib/utils/sysinst/arch/prep/menus.md.es +++ b/distrib/utils/sysinst/arch/prep/menus.md.es @@ -1,4 +1,4 @@ -/* $NetBSD: menus.md.es,v 1.1 2005/08/26 15:44:44 xtraeme Exp $ */ +/* $NetBSD: menus.md.es,v 1.2 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -38,3 +38,6 @@ /* Menu definitions for sysinst. prep version, machine dependent. */ +menu prepconsole, title "Select console device", y=-10; + option "COM0 (S1)", exit, action { yesno = 1; }; + option "VGA", exit, action { yesno = 0; }; diff --git a/distrib/utils/sysinst/arch/prep/menus.md.pl b/distrib/utils/sysinst/arch/prep/menus.md.pl index 5f1fb144458c..b8e2f98a199c 100644 --- a/distrib/utils/sysinst/arch/prep/menus.md.pl +++ b/distrib/utils/sysinst/arch/prep/menus.md.pl @@ -1,6 +1,4 @@ -/* $NetBSD: menus.md.pl,v 1.9 2003/06/12 10:51:42 dsl Exp $ */ -/* Based on english version: */ -/* NetBSD: menus.md.en,v 1.2 2001/11/29 23:21:01 thorpej Exp */ +/* $NetBSD: menus.md.pl,v 1.10 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -40,3 +38,6 @@ /* Menu definitions for sysinst. prep version, machine dependent. */ +menu prepconsole, title "Select console device", y=-10; + option "COM0 (S1)", exit, action { yesno = 1; }; + option "VGA", exit, action { yesno = 0; }; diff --git a/distrib/utils/sysinst/arch/prep/msg.md.de b/distrib/utils/sysinst/arch/prep/msg.md.de index 5a68913fb63e..f0be48aeaea2 100644 --- a/distrib/utils/sysinst/arch/prep/msg.md.de +++ b/distrib/utils/sysinst/arch/prep/msg.md.de @@ -1,4 +1,4 @@ -/* $NetBSD: msg.md.de,v 1.3 2004/10/21 12:14:22 martin Exp $ */ +/* $NetBSD: msg.md.de,v 1.4 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -62,3 +62,14 @@ booten. Sind Sie sicher, da message set_kernel_1 {Kernel (GENERIC)} + +message nopreppart +{There is no PReP boot partition in the MBR partition table.} + +message preptoosmall +{The PReP boot partition is too small. It needs to be at least 2MB in size, +however a size of at least 5MB is reccomended.} + +message prepnobootpart +{There is no boot partition in the disklabel. The boot partition should +match the PReP boot partition you set up in the MBR partition table.} diff --git a/distrib/utils/sysinst/arch/prep/msg.md.en b/distrib/utils/sysinst/arch/prep/msg.md.en index ac9ef7c3bdf4..5698e39f60b5 100644 --- a/distrib/utils/sysinst/arch/prep/msg.md.en +++ b/distrib/utils/sysinst/arch/prep/msg.md.en @@ -1,4 +1,4 @@ -/* $NetBSD: msg.md.en,v 1.8 2003/06/12 10:51:42 dsl Exp $ */ +/* $NetBSD: msg.md.en,v 1.9 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -62,3 +62,14 @@ sure you that you want to do this? message set_kernel_1 {Kernel (GENERIC)} + +message nopreppart +{There is no PReP boot partition in the MBR partition table.} + +message preptoosmall +{The PReP boot partition is too small. It needs to be at least 2MB in size, +however a size of at least 5MB is reccomended.} + +message prepnobootpart +{There is no boot partition in the disklabel. The boot partition should +match the PReP boot partition you set up in the MBR partition table.} diff --git a/distrib/utils/sysinst/arch/prep/msg.md.es b/distrib/utils/sysinst/arch/prep/msg.md.es index be81c0483aba..15a23632e0fb 100644 --- a/distrib/utils/sysinst/arch/prep/msg.md.es +++ b/distrib/utils/sysinst/arch/prep/msg.md.es @@ -1,4 +1,4 @@ -/* $NetBSD: msg.md.es,v 1.2 2005/08/26 16:32:32 xtraeme Exp $ */ +/* $NetBSD: msg.md.es,v 1.3 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -63,3 +63,14 @@ Puede que no sea posible iniciar desde ahi. message set_kernel_1 {Núcleo (GENERIC)} + +message nopreppart +{There is no PReP boot partition in the MBR partition table.} + +message preptoosmall +{The PReP boot partition is too small. It needs to be at least 2MB in size, +however a size of at least 5MB is reccomended.} + +message prepnobootpart +{There is no boot partition in the disklabel. The boot partition should +match the PReP boot partition you set up in the MBR partition table.} diff --git a/distrib/utils/sysinst/arch/prep/msg.md.pl b/distrib/utils/sysinst/arch/prep/msg.md.pl index e2d8016adc28..7bb993858d77 100644 --- a/distrib/utils/sysinst/arch/prep/msg.md.pl +++ b/distrib/utils/sysinst/arch/prep/msg.md.pl @@ -1,4 +1,4 @@ -/* $NetBSD: msg.md.pl,v 1.8 2003/06/12 10:51:42 dsl Exp $ */ +/* $NetBSD: msg.md.pl,v 1.9 2006/04/05 16:55:06 garbled Exp $ */ /* Based on english version: */ /* NetBSD: msg.md.en,v 1.1 2001/01/16 16:54:01 nonaka Exp */ @@ -65,3 +65,13 @@ chcesz to zrobic? message set_kernel_1 {Kernel (GENERIC)} +message nopreppart +{There is no PReP boot partition in the MBR partition table.} + +message preptoosmall +{The PReP boot partition is too small. It needs to be at least 2MB in size, +however a size of at least 5MB is reccomended.} + +message prepnobootpart +{There is no boot partition in the disklabel. The boot partition should +match the PReP boot partition you set up in the MBR partition table.} diff --git a/distrib/utils/sysinst/arch/sandpoint/md.c b/distrib/utils/sysinst/arch/sandpoint/md.c index 2564629f7e6b..b2edad4188b9 100644 --- a/distrib/utils/sysinst/arch/sandpoint/md.c +++ b/distrib/utils/sysinst/arch/sandpoint/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.25 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.26 2006/04/05 16:55:06 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -176,3 +176,21 @@ md_bios_info(char *dev) set_bios_geom(cyl, head, sec); return 0; } + +int +md_post_extract(void) +{ + return 0; +} + +int +md_check_mbr(mbr_info_t *mbri) +{ + return 2; +} + +int +md_mbr_use_wholedisk(mbr_info_t *mbri) +{ + return mbr_use_wholedisk(mbri); +} diff --git a/distrib/utils/sysinst/arch/sgimips/md.c b/distrib/utils/sysinst/arch/sgimips/md.c index 257336142fe9..f28905a056ed 100644 --- a/distrib/utils/sysinst/arch/sgimips/md.c +++ b/distrib/utils/sysinst/arch/sgimips/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.20 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.21 2006/04/05 16:55:07 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -208,3 +208,9 @@ md_init() else if (strstr(instsys.version, "(GENERIC32_IP12)")) set_kernel_set(SET_KERNEL_3); } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/shark/md.c b/distrib/utils/sysinst/arch/shark/md.c index b179ba380d5d..00d92471f393 100644 --- a/distrib/utils/sysinst/arch/shark/md.c +++ b/distrib/utils/sysinst/arch/shark/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.18 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.19 2006/04/05 16:55:07 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -174,3 +174,9 @@ void md_init(void) { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/sparc/md.c b/distrib/utils/sysinst/arch/sparc/md.c index c5fdf7305d98..99437d605337 100644 --- a/distrib/utils/sysinst/arch/sparc/md.c +++ b/distrib/utils/sysinst/arch/sparc/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.44 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.45 2006/04/05 16:55:07 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -206,3 +206,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/sparc64/md.c b/distrib/utils/sysinst/arch/sparc64/md.c index 2cb873525fce..fe67a81c29ce 100644 --- a/distrib/utils/sysinst/arch/sparc64/md.c +++ b/distrib/utils/sysinst/arch/sparc64/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.19 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.20 2006/04/05 16:55:07 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -205,3 +205,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/vax/md.c b/distrib/utils/sysinst/arch/vax/md.c index b58f2afa335f..664bf104e876 100644 --- a/distrib/utils/sysinst/arch/vax/md.c +++ b/distrib/utils/sysinst/arch/vax/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.30 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.31 2006/04/05 16:55:07 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -203,3 +203,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/arch/x68k/md.c b/distrib/utils/sysinst/arch/x68k/md.c index 80236ee319e2..f7dbb343c6d9 100644 --- a/distrib/utils/sysinst/arch/x68k/md.c +++ b/distrib/utils/sysinst/arch/x68k/md.c @@ -1,4 +1,4 @@ -/* $NetBSD: md.c,v 1.32 2006/02/26 10:25:54 dsl Exp $ */ +/* $NetBSD: md.c,v 1.33 2006/04/05 16:55:07 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -337,3 +337,9 @@ void md_init() { } + +int +md_post_extract(void) +{ + return 0; +} diff --git a/distrib/utils/sysinst/bsddisklabel.c b/distrib/utils/sysinst/bsddisklabel.c index de4646264645..172d24efc6e2 100644 --- a/distrib/utils/sysinst/bsddisklabel.c +++ b/distrib/utils/sysinst/bsddisklabel.c @@ -1,4 +1,4 @@ -/* $NetBSD: bsddisklabel.c,v 1.39 2006/01/12 22:02:44 dsl Exp $ */ +/* $NetBSD: bsddisklabel.c,v 1.40 2006/04/05 16:55:01 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -600,7 +600,13 @@ make_bsd_partitions(void) bsdlabel[PART_BOOT].pi_offset = ptstart; partstart += i; #endif -#endif +#elif defined(PART_BOOT) + if (bootsize != 0) { + bsdlabel[PART_BOOT].pi_fstype = FS_BOOT; + bsdlabel[PART_BOOT].pi_size = bootsize; + bsdlabel[PART_BOOT].pi_offset = bootstart; + } +#endif /* PART_BOOT w/o BOOT_SIZE */ #if defined(PART_SYSVBFS) && defined(SYSVBFS_SIZE) bsdlabel[PART_SYSVBFS].pi_offset = partstart; diff --git a/distrib/utils/sysinst/defs.h b/distrib/utils/sysinst/defs.h index 8039993233bc..244c23844a7a 100644 --- a/distrib/utils/sysinst/defs.h +++ b/distrib/utils/sysinst/defs.h @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.128 2006/02/26 10:25:52 dsl Exp $ */ +/* $NetBSD: defs.h,v 1.129 2006/04/05 16:55:01 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -221,7 +221,9 @@ int rootpart; /* partition we install into */ const char *disktype; /* ST506, SCSI, ... */ /* Area of disk we can allocate, start and size in disk sectors. */ -int ptstart, ptsize; +int ptstart, ptsize; +/* If we have an MBR boot partition, start and size in sectors */ +int bootstart, bootsize; /* Actual values for current disk - set by find_disks() or md_get_info() */ int sectorsize; @@ -300,6 +302,7 @@ int md_post_newfs(void); int md_pre_disklabel(void); int md_pre_update(void); int md_update(void); +int md_post_extract(void); void md_init(void); void md_set_no_x(void); diff --git a/distrib/utils/sysinst/install.c b/distrib/utils/sysinst/install.c index e530eb8e2197..5d2de958d4ff 100644 --- a/distrib/utils/sysinst/install.c +++ b/distrib/utils/sysinst/install.c @@ -1,4 +1,4 @@ -/* $NetBSD: install.c,v 1.41 2005/07/09 14:56:23 xtraeme Exp $ */ +/* $NetBSD: install.c,v 1.42 2006/04/05 16:55:01 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -121,6 +121,9 @@ do_install(void) MSG_extractcomplete, MSG_abortinst) != 0) return; + if (md_post_extract() != 0) + return; + set_timezone(); set_crypt_type(); diff --git a/distrib/utils/sysinst/mbr.c b/distrib/utils/sysinst/mbr.c index ddb4afb10570..e4910a6202ef 100644 --- a/distrib/utils/sysinst/mbr.c +++ b/distrib/utils/sysinst/mbr.c @@ -1,4 +1,4 @@ -/* $NetBSD: mbr.c,v 1.71 2005/11/05 09:58:32 dsl Exp $ */ +/* $NetBSD: mbr.c,v 1.72 2006/04/05 16:55:01 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -106,6 +106,7 @@ struct part_id { {MBR_PTYPE_FAT32L, "Windows FAT32, LBA"}, {MBR_PTYPE_NTFSVOL, "NTFS volume set"}, {MBR_PTYPE_NTFS, "NTFS"}, + {MBR_PTYPE_PREP, "PReP Boot"}, #ifdef MBR_PTYPE_SOLARIS {MBR_PTYPE_SOLARIS, "Solaris"}, #endif @@ -1205,6 +1206,33 @@ set_mbr_header(menudesc *m, void *arg) m->numopts = op - opts; } +int +mbr_use_wholedisk(mbr_info_t *mbri) +{ + struct mbr_sector *mbrs = &mbri->mbr; + mbr_info_t *ext; + struct mbr_partition *part; + + part = &mbrs->mbr_parts[0]; + /* Set the partition information for full disk usage. */ + while ((ext = mbri->extended)) { + mbri->extended = ext->extended; + free(ext); + } + memset(part, 0, MBR_PART_COUNT * sizeof *part); +#ifdef BOOTSEL + memset(&mbri->mbrb, 0, sizeof mbri->mbrb); +#endif + part[0].mbrp_type = MBR_PTYPE_NETBSD; + part[0].mbrp_size = dlsize - bsec; + part[0].mbrp_start = bsec; + part[0].mbrp_flag = MBR_PFLAG_ACTIVE; + + ptstart = bsec; + ptsize = dlsize - bsec; + return 1; +} + /* * Let user change incore Master Boot Record partitions via menu. */ @@ -1251,24 +1279,7 @@ edit_mbr(mbr_info_t *mbri) return 0; } } - - /* Set the partition information for full disk usage. */ - while ((ext = mbri->extended)) { - mbri->extended = ext->extended; - free(ext); - } - memset(part, 0, MBR_PART_COUNT * sizeof *part); -#ifdef BOOTSEL - memset(&mbri->mbrb, 0, sizeof mbri->mbrb); -#endif - part[0].mbrp_type = MBR_PTYPE_NETBSD; - part[0].mbrp_size = dlsize - bsec; - part[0].mbrp_start = bsec; - part[0].mbrp_flag = MBR_PFLAG_ACTIVE; - - ptstart = bsec; - ptsize = dlsize - bsec; - return 1; + return(md_mbr_use_wholedisk(mbri)); } mbr_menu = new_menu(NULL, NULL, 16, 0, -1, 15, 70, @@ -1335,6 +1346,15 @@ edit_mbr(mbr_info_t *mbri) if (yesno) continue; } + /* the md_check_mbr function has 3 ret codes to deal with + * the different possible states. 0, 1, >1 + */ + j = md_check_mbr(mbri); + if (j == 0) + return 0; + if (j == 1) + continue; + break; } diff --git a/distrib/utils/sysinst/mbr.h b/distrib/utils/sysinst/mbr.h index df4fa5669200..45ce5746b777 100644 --- a/distrib/utils/sysinst/mbr.h +++ b/distrib/utils/sysinst/mbr.h @@ -1,4 +1,4 @@ -/* $NetBSD: mbr.h,v 1.21 2004/07/17 19:36:59 dsl Exp $ */ +/* $NetBSD: mbr.h,v 1.22 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997, 1988 Piermont Information Systems Inc. @@ -105,6 +105,7 @@ int check_geom(void); /* primitive geometry sanity-check */ void disp_cur_part(struct mbr_partition *, int, int); int edit_mbr(mbr_info_t *); +int mbr_use_wholedisk(mbr_info_t *); int partsoverlap(struct mbr_partition *, int, int); /* from mbr.c */ @@ -128,4 +129,8 @@ void edit_bootsel_default_disk(int); void configure_bootsel(void); #endif +/* Machine dependant mbr functions */ +int md_mbr_use_wholedisk(mbr_info_t *mbri); +int md_check_mbr(mbr_info_t *mbri); + #endif diff --git a/distrib/utils/sysinst/upgrade.c b/distrib/utils/sysinst/upgrade.c index 0a81f39dbe01..6448679296b8 100644 --- a/distrib/utils/sysinst/upgrade.c +++ b/distrib/utils/sysinst/upgrade.c @@ -1,4 +1,4 @@ -/* $NetBSD: upgrade.c,v 1.48 2004/06/05 21:19:00 dsl Exp $ */ +/* $NetBSD: upgrade.c,v 1.49 2006/04/05 16:55:05 garbled Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -93,6 +93,9 @@ do_upgrade(void) MSG_upgrcomplete, MSG_abortupgr) != 0) return; + if (!md_post_extract() == 0) + return; + merge_X(); sanity_check();