Rather big update to sysinst, in order to get it working on the prep port.
1) Add an md_post_extract() function. This function is called after extracting the sets, and allows the arch to do something at that time. In the case of prep, it is much easier to install the bootcode after all the sets are extracted, so we do it in md_post_extract(). Added empty md_post_extract() functions to all other arches so they compile. 2) Add md_mbr_use_wholedisk() and md_check_mbr(). In edit_mbr() I have split off the code that uses the whole disk for NetBSD, into the mbr_use_wholedisk() function. On most ports that use mbr.c, I made md_mbr_use_wholedisk() just call that and return. On prep we create the magical prep boot partition here. The md_check_mbr() function allows the arch to add additional checks after the user had manually edited the MBR to make sure the choices he made allow NetBSD to function. Added a dummy routine to all mbr.c using arches. 3) Added code to bsdlabel.c to create a partition of type boot if PART_BOOT is defined, but BOOT_SIZE is not defined. Also added two more globals "bootsize" and "bootstart" which must be seeded in order to do so. This is done on prep in md_check_mbr(). 4) Added MBR_PTYPE_PREP to the list of MBR partitions. 5) Made the prep port actually install sanely. It now creates a prep boot partition, labels it correctly, installs all the sets, and then runs mkbootimage and dd's the bootimage into the prep partition. The result is a prep installer that creates a bootable NetBSD installation automatically. 6) Edited the prep menus and messages files to add new labels. In the case of the translated files, I just added the words in english for someone to translate later. I tried to xcompile a few arches to make sure I didn't break anything, but I could have missed something. Please let me know if I have broken your arch in any way. I'll watch the autobuilds for the next few days too. For all ports other than prep there should be no functional changes at all.
This commit is contained in:
parent
f8b2282138
commit
85af130714
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -347,3 +347,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -347,3 +347,9 @@ void
|
|||||||
md_init(void)
|
md_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -128,3 +128,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -172,3 +172,21 @@ void
|
|||||||
md_init(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);
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -155,3 +155,9 @@ void
|
|||||||
md_init(void)
|
md_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -172,3 +172,21 @@ md_bios_info(char *dev)
|
|||||||
set_bios_geom(cyl, head, sec);
|
set_bios_geom(cyl, head, sec);
|
||||||
return 0;
|
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);
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -200,3 +200,9 @@ void
|
|||||||
md_init(void)
|
md_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -173,3 +173,9 @@ void
|
|||||||
md_init(void)
|
md_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997,2002 Piermont Information Systems Inc.
|
||||||
@ -173,3 +173,21 @@ md_bios_info(dev)
|
|||||||
|
|
||||||
return 0;
|
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);
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997,2002 Piermont Information Systems Inc.
|
||||||
@ -177,3 +177,21 @@ md_bios_info(dev)
|
|||||||
set_bios_geom(cyl, head, sec);
|
set_bios_geom(cyl, head, sec);
|
||||||
return 0;
|
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);
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -232,3 +232,9 @@ ews4800mips_sysvbfs_size(void)
|
|||||||
|
|
||||||
return (8 * 1024 * 1024) / 512; /* 8MB */
|
return (8 * 1024 * 1024) / 512; /* 8MB */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -260,3 +260,9 @@ hp300_boot_size(void)
|
|||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -203,3 +203,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -162,3 +162,21 @@ void
|
|||||||
md_init(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);
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -161,3 +161,21 @@ void
|
|||||||
md_init(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);
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -630,3 +630,21 @@ md_bootxx_name(void)
|
|||||||
asprintf(&bootxx, "/usr/mdec/bootxx_%s", bootfs);
|
asprintf(&bootxx, "/usr/mdec/bootxx_%s", bootfs);
|
||||||
return bootxx;
|
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);
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -1155,3 +1155,9 @@ md_init()
|
|||||||
*/
|
*/
|
||||||
set_kernel_set(SET_KERNEL_1);
|
set_kernel_set(SET_KERNEL_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -188,3 +188,9 @@ void
|
|||||||
md_init(void)
|
md_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -219,3 +219,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -247,3 +247,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -215,3 +215,9 @@ void
|
|||||||
md_init(void)
|
md_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -210,3 +210,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -129,3 +129,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -162,3 +162,21 @@ md_check_partitions()
|
|||||||
|
|
||||||
return (1);
|
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);
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -218,3 +218,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997,2002 Piermont Information Systems Inc.
|
||||||
@ -177,3 +177,21 @@ md_bios_info(dev)
|
|||||||
set_bios_geom(cyl, head, sec);
|
set_bios_geom(cyl, head, sec);
|
||||||
return 0;
|
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);
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -47,20 +47,89 @@
|
|||||||
#include <machine/cpu.h>
|
#include <machine/cpu.h>
|
||||||
|
|
||||||
#include "defs.h"
|
#include "defs.h"
|
||||||
#include "md.h"
|
|
||||||
#include "msg_defs.h"
|
#include "msg_defs.h"
|
||||||
#include "menu_defs.h"
|
#include "menu_defs.h"
|
||||||
|
#include "md.h"
|
||||||
#include "endian.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
|
int
|
||||||
md_get_info(void)
|
md_get_info(void)
|
||||||
{
|
{
|
||||||
|
|
||||||
read_mbr(diskdev, &mbr);
|
read_mbr(diskdev, &mbr);
|
||||||
edit_mbr(&mbr);
|
md_bios_info(diskdev);
|
||||||
|
return edit_mbr(&mbr);
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
@ -116,7 +185,21 @@ md_make_bsd_partitions(void)
|
|||||||
int
|
int
|
||||||
md_check_partitions(void)
|
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 */
|
/* 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("/sysinst"));
|
||||||
run_program(0, "rm -f %s", target_expand("/.termcap"));
|
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("/.profile"));
|
||||||
|
run_program(0, "rm -f %s", target_expand("/.bootimage"));
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
md_pre_update(void)
|
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;
|
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
|
void
|
||||||
md_init(void)
|
md_init(void)
|
||||||
{
|
{
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -49,14 +49,18 @@
|
|||||||
#include "mbr.h"
|
#include "mbr.h"
|
||||||
|
|
||||||
/* constants and defines */
|
/* 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_ROOT PART_A
|
||||||
#define PART_SWAP PART_B
|
#define PART_SWAP PART_B
|
||||||
#define PART_RAW PART_C
|
#define PART_RAW PART_C
|
||||||
#define PART_USR PART_D /* Can be after PART_FIRST_FREE */
|
#define PART_BSD PART_D
|
||||||
#define PART_FIRST_FREE PART_E
|
#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 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 DEFVARSIZE 32 /* Default /var size, if created */
|
||||||
#define DEFUSRSIZE 128 /* Default /usr size, if /home */
|
#define DEFUSRSIZE 128 /* Default /usr size, if /home */
|
||||||
#define XNEEDMB 39 /* Extra megs for full X installation */
|
#define XNEEDMB 39 /* Extra megs for full X installation */
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -38,3 +38,6 @@
|
|||||||
|
|
||||||
/* Menu definitions for sysinst. prep version, machine dependent. */
|
/* 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; };
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -38,3 +38,6 @@
|
|||||||
|
|
||||||
/* Menu definitions for sysinst. prep version, machine dependent. */
|
/* 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; };
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
/* $NetBSD: menus.md.pl,v 1.9 2003/06/12 10:51:42 dsl Exp $ */
|
/* $NetBSD: menus.md.pl,v 1.10 2006/04/05 16:55:06 garbled Exp $ */
|
||||||
/* Based on english version: */
|
|
||||||
/* NetBSD: menus.md.en,v 1.2 2001/11/29 23:21:01 thorpej Exp */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 1997 Piermont Information Systems Inc.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -40,3 +38,6 @@
|
|||||||
|
|
||||||
/* Menu definitions for sysinst. prep version, machine dependent. */
|
/* 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; };
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -62,3 +62,14 @@ booten. Sind Sie sicher, da
|
|||||||
|
|
||||||
message set_kernel_1
|
message set_kernel_1
|
||||||
{Kernel (GENERIC)}
|
{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.}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -62,3 +62,14 @@ sure you that you want to do this?
|
|||||||
|
|
||||||
message set_kernel_1
|
message set_kernel_1
|
||||||
{Kernel (GENERIC)}
|
{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.}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -63,3 +63,14 @@ Puede que no sea posible iniciar desde ahi.
|
|||||||
|
|
||||||
message set_kernel_1
|
message set_kernel_1
|
||||||
{Núcleo (GENERIC)}
|
{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.}
|
||||||
|
@ -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: */
|
/* Based on english version: */
|
||||||
/* NetBSD: msg.md.en,v 1.1 2001/01/16 16:54:01 nonaka Exp */
|
/* 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
|
message set_kernel_1
|
||||||
{Kernel (GENERIC)}
|
{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.}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -176,3 +176,21 @@ md_bios_info(char *dev)
|
|||||||
set_bios_geom(cyl, head, sec);
|
set_bios_geom(cyl, head, sec);
|
||||||
return 0;
|
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);
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -208,3 +208,9 @@ md_init()
|
|||||||
else if (strstr(instsys.version, "(GENERIC32_IP12)"))
|
else if (strstr(instsys.version, "(GENERIC32_IP12)"))
|
||||||
set_kernel_set(SET_KERNEL_3);
|
set_kernel_set(SET_KERNEL_3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -174,3 +174,9 @@ void
|
|||||||
md_init(void)
|
md_init(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -206,3 +206,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -205,3 +205,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -203,3 +203,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -337,3 +337,9 @@ void
|
|||||||
md_init()
|
md_init()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
md_post_extract(void)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -600,7 +600,13 @@ make_bsd_partitions(void)
|
|||||||
bsdlabel[PART_BOOT].pi_offset = ptstart;
|
bsdlabel[PART_BOOT].pi_offset = ptstart;
|
||||||
partstart += i;
|
partstart += i;
|
||||||
#endif
|
#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)
|
#if defined(PART_SYSVBFS) && defined(SYSVBFS_SIZE)
|
||||||
bsdlabel[PART_SYSVBFS].pi_offset = partstart;
|
bsdlabel[PART_SYSVBFS].pi_offset = partstart;
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -221,7 +221,9 @@ int rootpart; /* partition we install into */
|
|||||||
const char *disktype; /* ST506, SCSI, ... */
|
const char *disktype; /* ST506, SCSI, ... */
|
||||||
|
|
||||||
/* Area of disk we can allocate, start and size in disk sectors. */
|
/* 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() */
|
/* Actual values for current disk - set by find_disks() or md_get_info() */
|
||||||
int sectorsize;
|
int sectorsize;
|
||||||
@ -300,6 +302,7 @@ int md_post_newfs(void);
|
|||||||
int md_pre_disklabel(void);
|
int md_pre_disklabel(void);
|
||||||
int md_pre_update(void);
|
int md_pre_update(void);
|
||||||
int md_update(void);
|
int md_update(void);
|
||||||
|
int md_post_extract(void);
|
||||||
void md_init(void);
|
void md_init(void);
|
||||||
void md_set_no_x(void);
|
void md_set_no_x(void);
|
||||||
|
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -121,6 +121,9 @@ do_install(void)
|
|||||||
MSG_extractcomplete, MSG_abortinst) != 0)
|
MSG_extractcomplete, MSG_abortinst) != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (md_post_extract() != 0)
|
||||||
|
return;
|
||||||
|
|
||||||
set_timezone();
|
set_timezone();
|
||||||
|
|
||||||
set_crypt_type();
|
set_crypt_type();
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -106,6 +106,7 @@ struct part_id {
|
|||||||
{MBR_PTYPE_FAT32L, "Windows FAT32, LBA"},
|
{MBR_PTYPE_FAT32L, "Windows FAT32, LBA"},
|
||||||
{MBR_PTYPE_NTFSVOL, "NTFS volume set"},
|
{MBR_PTYPE_NTFSVOL, "NTFS volume set"},
|
||||||
{MBR_PTYPE_NTFS, "NTFS"},
|
{MBR_PTYPE_NTFS, "NTFS"},
|
||||||
|
{MBR_PTYPE_PREP, "PReP Boot"},
|
||||||
#ifdef MBR_PTYPE_SOLARIS
|
#ifdef MBR_PTYPE_SOLARIS
|
||||||
{MBR_PTYPE_SOLARIS, "Solaris"},
|
{MBR_PTYPE_SOLARIS, "Solaris"},
|
||||||
#endif
|
#endif
|
||||||
@ -1205,6 +1206,33 @@ set_mbr_header(menudesc *m, void *arg)
|
|||||||
m->numopts = op - opts;
|
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.
|
* Let user change incore Master Boot Record partitions via menu.
|
||||||
*/
|
*/
|
||||||
@ -1251,24 +1279,7 @@ edit_mbr(mbr_info_t *mbri)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return(md_mbr_use_wholedisk(mbri));
|
||||||
/* 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mbr_menu = new_menu(NULL, NULL, 16, 0, -1, 15, 70,
|
mbr_menu = new_menu(NULL, NULL, 16, 0, -1, 15, 70,
|
||||||
@ -1335,6 +1346,15 @@ edit_mbr(mbr_info_t *mbri)
|
|||||||
if (yesno)
|
if (yesno)
|
||||||
continue;
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
* 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);
|
void disp_cur_part(struct mbr_partition *, int, int);
|
||||||
int edit_mbr(mbr_info_t *);
|
int edit_mbr(mbr_info_t *);
|
||||||
|
int mbr_use_wholedisk(mbr_info_t *);
|
||||||
int partsoverlap(struct mbr_partition *, int, int);
|
int partsoverlap(struct mbr_partition *, int, int);
|
||||||
|
|
||||||
/* from mbr.c */
|
/* from mbr.c */
|
||||||
@ -128,4 +129,8 @@ void edit_bootsel_default_disk(int);
|
|||||||
void configure_bootsel(void);
|
void configure_bootsel(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Machine dependant mbr functions */
|
||||||
|
int md_mbr_use_wholedisk(mbr_info_t *mbri);
|
||||||
|
int md_check_mbr(mbr_info_t *mbri);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -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.
|
* Copyright 1997 Piermont Information Systems Inc.
|
||||||
@ -93,6 +93,9 @@ do_upgrade(void)
|
|||||||
MSG_upgrcomplete, MSG_abortupgr) != 0)
|
MSG_upgrcomplete, MSG_abortupgr) != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!md_post_extract() == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
merge_X();
|
merge_X();
|
||||||
|
|
||||||
sanity_check();
|
sanity_check();
|
||||||
|
Loading…
Reference in New Issue
Block a user