In the new world order disks may come without any partitioning scheme

attached - so the user may have to select one.
This commit is contained in:
martin 2019-06-13 09:36:54 +00:00
parent 8d1487086a
commit e11b8d25a8
14 changed files with 334 additions and 14 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.5 2019/06/12 06:20:18 martin Exp $ */ /* $NetBSD: md.c,v 1.6 2019/06/13 09:36:54 martin Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -65,6 +65,29 @@ md_init_set_status(int flags)
bool bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.3 2019/06/12 06:20:19 martin Exp $ */ /* $NetBSD: md.c,v 1.4 2019/06/13 09:36:54 martin Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -58,6 +58,29 @@ md_init_set_status(int flags)
bool bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.5 2019/06/12 06:20:19 martin Exp $ */ /* $NetBSD: md.c,v 1.6 2019/06/13 09:36:54 martin Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -65,6 +65,29 @@ md_init_set_status(int flags)
bool bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.6 2019/06/12 06:20:19 martin Exp $ */ /* $NetBSD: md.c,v 1.7 2019/06/13 09:36:54 martin Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -73,6 +73,28 @@ bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
if (boardtype == BOARD_TYPE_RPI) if (boardtype == BOARD_TYPE_RPI)
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.3 2019/06/12 06:20:19 martin Exp $ */ /* $NetBSD: md.c,v 1.4 2019/06/13 09:36:55 martin Exp $ */
/* /*
* Copyright 1997,2002 Piermont Information Systems Inc. * Copyright 1997,2002 Piermont Information Systems Inc.
@ -58,6 +58,29 @@ md_init_set_status(int flags)
bool bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.3 2019/06/12 06:20:19 martin Exp $ */ /* $NetBSD: md.c,v 1.4 2019/06/13 09:36:55 martin Exp $ */
/* /*
* Copyright 1997,2002 Piermont Information Systems Inc. * Copyright 1997,2002 Piermont Information Systems Inc.
@ -58,6 +58,29 @@ md_init_set_status(int flags)
bool bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.3 2019/06/12 06:20:20 martin Exp $ */ /* $NetBSD: md.c,v 1.4 2019/06/13 09:36:55 martin Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -87,6 +87,29 @@ md_init_set_status(int flags)
bool bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.3 2019/06/12 06:20:20 martin Exp $ */ /* $NetBSD: md.c,v 1.4 2019/06/13 09:36:55 martin Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -61,6 +61,29 @@ md_init_set_status(int flags)
bool bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.4 2019/06/12 06:20:20 martin Exp $ */ /* $NetBSD: md.c,v 1.5 2019/06/13 09:36:55 martin Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -63,6 +63,28 @@ bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.5 2019/06/12 06:20:21 martin Exp $ */ /* $NetBSD: md.c,v 1.6 2019/06/13 09:36:55 martin Exp $ */
/* /*
* Copyright 1997,2002 Piermont Information Systems Inc. * Copyright 1997,2002 Piermont Information Systems Inc.
@ -58,6 +58,29 @@ md_init_set_status(int flags)
bool bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.4 2019/06/12 06:20:22 martin Exp $ */ /* $NetBSD: md.c,v 1.5 2019/06/13 09:36:55 martin Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -79,6 +79,29 @@ md_get_info(struct install_partition_desc *install)
if (check_rdb()) if (check_rdb())
return true; return true;
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.5 2019/06/12 06:20:22 martin Exp $ */ /* $NetBSD: md.c,v 1.6 2019/06/13 09:36:55 martin Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -63,6 +63,29 @@ md_init_set_status(int flags)
bool bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.3 2019/06/12 06:20:22 martin Exp $ */ /* $NetBSD: md.c,v 1.4 2019/06/13 09:36:56 martin Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -92,6 +92,29 @@ md_init_set_status(int flags)
bool bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: md.c,v 1.3 2019/06/12 06:20:23 martin Exp $ */ /* $NetBSD: md.c,v 1.4 2019/06/13 09:36:56 martin Exp $ */
/* /*
* Copyright 1997 Piermont Information Systems Inc. * Copyright 1997 Piermont Information Systems Inc.
@ -72,6 +72,29 @@ md_init_set_status(int flags)
bool bool
md_get_info(struct install_partition_desc *install) md_get_info(struct install_partition_desc *install)
{ {
if (pm->no_mbr || pm->no_part)
return true;
if (pm->parts == NULL) {
const struct disk_partitioning_scheme *ps =
select_part_scheme(pm, NULL, true, NULL);
if (!ps)
return true;
struct disk_partitions *parts =
(*ps->create_new_for_disk)(pm->diskdev,
0, pm->dlsize, pm->dlsize, true);
if (!parts)
return false;
pm->parts = parts;
if (ps->size_limit > 0 && pm->dlsize > ps->size_limit)
pm->dlsize = ps->size_limit;
}
return set_bios_geom_with_mbr_guess(pm->parts); return set_bios_geom_with_mbr_guess(pm->parts);
} }