History log of /netbsd-current/usr.sbin/sysinst/disklabel.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.52 08-Feb-2024 andvar

fix misplaced or missing "e" in words with "ment" ending (argument, implement,
increment, decrement, alignment), in comments, documentation, log messages.


# 1.51 06-Jan-2023 martin

Provide a disklabel specific MD hook MD_DISKLABEL_PART_INDEX_CHECK
to allow MD code to veto specific disklabel partitions for specific
uses, e.g. to make sure a boot partition does not end up as sd0a.
Most architectures won't need this, as the file system type makes
the generic heuristic do the right thing (e.g. move the ESP to wd0e
for x86) - but for some architectures the boot partition uses FFS
and our heuristic fails.


Revision tags: netbsd-10-0-RC4 netbsd-10-0-RC3 netbsd-10-0-RC2 netbsd-10-0-RC1 netbsd-10-base
# 1.50 11-Dec-2022 martin

When generating a script for disklabel(8) do not use the "pretty printed"
file system type names, but the raw ones that disklabel(8) actually
knows about.


# 1.49 24-Jun-2022 tsutsui

Check on-disk disklabel properly even on ports without raw BSD disklabel.

Fixes PR install/56890.


# 1.48 21-Jun-2022 martin

Fix inverted condition in previous and only apply special handling for
the "all of NetBSD" partition when we have an outer MBR label.
Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886.


# 1.47 21-Jun-2022 martin

Fix free space accounting for partition size changes and deletions.
Part of PR 56886.


# 1.46 21-Jun-2022 martin

disklabel_can_add_partition() did not consider additional partitions
(while there still is space in the disklabel). Part of PR 56886.


# 1.45 18-Jun-2022 martin

An unused partition may not be the install target


# 1.44 08-Aug-2021 andvar

s/partion/partition/ s/arrray/array/ in comments.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.43 31-Jan-2021 rillig

sysinst: remove trailing whitespace from *.c *.h

In contrast to the messages files, this whitespace is not significant.


# 1.42 13-Oct-2020 martin

PR 55142: on popular demand bring back expert options to adjust the
number of free inodes, block size and fragment size for FFS and LFS.


# 1.41 12-Oct-2020 martin

PR 55536: when we find existing partition tables and have alternative
formats available, offer to delete partitions and create new ones from
scratch (in some other or the same on-disk format).


# 1.40 03-Oct-2020 martin

PR 55384: detangle pm->ptstart from the "install" flag (selecting a
target partition). Instead introduce a new PTI_INSTALL_TARGET per partition
flag and deal with it in the partitioning backends.

Honour pm->ptstart when allocating new partitions - it is supposed to be
the first sector usable by NetBSD.


# 1.39 29-Sep-2020 martin

Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.


# 1.38 28-Sep-2020 martin

PR 55378: do not assume RAW_PART to be either 2 or 3


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.37 19-Feb-2020 martin

branches: 1.37.4;
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


# 1.36 19-Feb-2020 martin

Use strlcpy in a few places to guarnatee 0-terminated strings


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.51 06-Jan-2023 martin

Provide a disklabel specific MD hook MD_DISKLABEL_PART_INDEX_CHECK
to allow MD code to veto specific disklabel partitions for specific
uses, e.g. to make sure a boot partition does not end up as sd0a.
Most architectures won't need this, as the file system type makes
the generic heuristic do the right thing (e.g. move the ESP to wd0e
for x86) - but for some architectures the boot partition uses FFS
and our heuristic fails.


Revision tags: netbsd-10-base
# 1.50 11-Dec-2022 martin

When generating a script for disklabel(8) do not use the "pretty printed"
file system type names, but the raw ones that disklabel(8) actually
knows about.


# 1.49 24-Jun-2022 tsutsui

Check on-disk disklabel properly even on ports without raw BSD disklabel.

Fixes PR install/56890.


# 1.48 21-Jun-2022 martin

Fix inverted condition in previous and only apply special handling for
the "all of NetBSD" partition when we have an outer MBR label.
Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886.


# 1.47 21-Jun-2022 martin

Fix free space accounting for partition size changes and deletions.
Part of PR 56886.


# 1.46 21-Jun-2022 martin

disklabel_can_add_partition() did not consider additional partitions
(while there still is space in the disklabel). Part of PR 56886.


# 1.45 18-Jun-2022 martin

An unused partition may not be the install target


# 1.44 08-Aug-2021 andvar

s/partion/partition/ s/arrray/array/ in comments.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.43 31-Jan-2021 rillig

sysinst: remove trailing whitespace from *.c *.h

In contrast to the messages files, this whitespace is not significant.


# 1.42 13-Oct-2020 martin

PR 55142: on popular demand bring back expert options to adjust the
number of free inodes, block size and fragment size for FFS and LFS.


# 1.41 12-Oct-2020 martin

PR 55536: when we find existing partition tables and have alternative
formats available, offer to delete partitions and create new ones from
scratch (in some other or the same on-disk format).


# 1.40 03-Oct-2020 martin

PR 55384: detangle pm->ptstart from the "install" flag (selecting a
target partition). Instead introduce a new PTI_INSTALL_TARGET per partition
flag and deal with it in the partitioning backends.

Honour pm->ptstart when allocating new partitions - it is supposed to be
the first sector usable by NetBSD.


# 1.39 29-Sep-2020 martin

Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.


# 1.38 28-Sep-2020 martin

PR 55378: do not assume RAW_PART to be either 2 or 3


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.37 19-Feb-2020 martin

branches: 1.37.4;
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


# 1.36 19-Feb-2020 martin

Use strlcpy in a few places to guarnatee 0-terminated strings


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.50 11-Dec-2022 martin

When generating a script for disklabel(8) do not use the "pretty printed"
file system type names, but the raw ones that disklabel(8) actually
knows about.


# 1.49 24-Jun-2022 tsutsui

Check on-disk disklabel properly even on ports without raw BSD disklabel.

Fixes PR install/56890.


# 1.48 21-Jun-2022 martin

Fix inverted condition in previous and only apply special handling for
the "all of NetBSD" partition when we have an outer MBR label.
Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886.


# 1.47 21-Jun-2022 martin

Fix free space accounting for partition size changes and deletions.
Part of PR 56886.


# 1.46 21-Jun-2022 martin

disklabel_can_add_partition() did not consider additional partitions
(while there still is space in the disklabel). Part of PR 56886.


# 1.45 18-Jun-2022 martin

An unused partition may not be the install target


# 1.44 08-Aug-2021 andvar

s/partion/partition/ s/arrray/array/ in comments.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.43 31-Jan-2021 rillig

sysinst: remove trailing whitespace from *.c *.h

In contrast to the messages files, this whitespace is not significant.


# 1.42 13-Oct-2020 martin

PR 55142: on popular demand bring back expert options to adjust the
number of free inodes, block size and fragment size for FFS and LFS.


# 1.41 12-Oct-2020 martin

PR 55536: when we find existing partition tables and have alternative
formats available, offer to delete partitions and create new ones from
scratch (in some other or the same on-disk format).


# 1.40 03-Oct-2020 martin

PR 55384: detangle pm->ptstart from the "install" flag (selecting a
target partition). Instead introduce a new PTI_INSTALL_TARGET per partition
flag and deal with it in the partitioning backends.

Honour pm->ptstart when allocating new partitions - it is supposed to be
the first sector usable by NetBSD.


# 1.39 29-Sep-2020 martin

Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.


# 1.38 28-Sep-2020 martin

PR 55378: do not assume RAW_PART to be either 2 or 3


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.37 19-Feb-2020 martin

branches: 1.37.4;
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


# 1.36 19-Feb-2020 martin

Use strlcpy in a few places to guarnatee 0-terminated strings


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.49 24-Jun-2022 tsutsui

Check on-disk disklabel properly even on ports without raw BSD disklabel.

Fixes PR install/56890.


# 1.48 21-Jun-2022 martin

Fix inverted condition in previous and only apply special handling for
the "all of NetBSD" partition when we have an outer MBR label.
Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886.


# 1.47 21-Jun-2022 martin

Fix free space accounting for partition size changes and deletions.
Part of PR 56886.


# 1.46 21-Jun-2022 martin

disklabel_can_add_partition() did not consider additional partitions
(while there still is space in the disklabel). Part of PR 56886.


# 1.45 18-Jun-2022 martin

An unused partition may not be the install target


# 1.44 08-Aug-2021 andvar

s/partion/partition/ s/arrray/array/ in comments.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.43 31-Jan-2021 rillig

sysinst: remove trailing whitespace from *.c *.h

In contrast to the messages files, this whitespace is not significant.


# 1.42 13-Oct-2020 martin

PR 55142: on popular demand bring back expert options to adjust the
number of free inodes, block size and fragment size for FFS and LFS.


# 1.41 12-Oct-2020 martin

PR 55536: when we find existing partition tables and have alternative
formats available, offer to delete partitions and create new ones from
scratch (in some other or the same on-disk format).


# 1.40 03-Oct-2020 martin

PR 55384: detangle pm->ptstart from the "install" flag (selecting a
target partition). Instead introduce a new PTI_INSTALL_TARGET per partition
flag and deal with it in the partitioning backends.

Honour pm->ptstart when allocating new partitions - it is supposed to be
the first sector usable by NetBSD.


# 1.39 29-Sep-2020 martin

Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.


# 1.38 28-Sep-2020 martin

PR 55378: do not assume RAW_PART to be either 2 or 3


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.37 19-Feb-2020 martin

branches: 1.37.4;
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


# 1.36 19-Feb-2020 martin

Use strlcpy in a few places to guarnatee 0-terminated strings


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.48 21-Jun-2022 martin

Fix inverted condition in previous and only apply special handling for
the "all of NetBSD" partition when we have an outer MBR label.
Pointed out by Izumi Tsutsui. Hopefully the last fix needed for PR 56886.


# 1.47 21-Jun-2022 martin

Fix free space accounting for partition size changes and deletions.
Part of PR 56886.


# 1.46 21-Jun-2022 martin

disklabel_can_add_partition() did not consider additional partitions
(while there still is space in the disklabel). Part of PR 56886.


# 1.45 18-Jun-2022 martin

An unused partition may not be the install target


# 1.44 08-Aug-2021 andvar

s/partion/partition/ s/arrray/array/ in comments.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.43 31-Jan-2021 rillig

sysinst: remove trailing whitespace from *.c *.h

In contrast to the messages files, this whitespace is not significant.


# 1.42 13-Oct-2020 martin

PR 55142: on popular demand bring back expert options to adjust the
number of free inodes, block size and fragment size for FFS and LFS.


# 1.41 12-Oct-2020 martin

PR 55536: when we find existing partition tables and have alternative
formats available, offer to delete partitions and create new ones from
scratch (in some other or the same on-disk format).


# 1.40 03-Oct-2020 martin

PR 55384: detangle pm->ptstart from the "install" flag (selecting a
target partition). Instead introduce a new PTI_INSTALL_TARGET per partition
flag and deal with it in the partitioning backends.

Honour pm->ptstart when allocating new partitions - it is supposed to be
the first sector usable by NetBSD.


# 1.39 29-Sep-2020 martin

Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.


# 1.38 28-Sep-2020 martin

PR 55378: do not assume RAW_PART to be either 2 or 3


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.37 19-Feb-2020 martin

branches: 1.37.4;
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


# 1.36 19-Feb-2020 martin

Use strlcpy in a few places to guarnatee 0-terminated strings


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.45 18-Jun-2022 martin

An unused partition may not be the install target


# 1.44 08-Aug-2021 andvar

s/partion/partition/ s/arrray/array/ in comments.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.43 31-Jan-2021 rillig

sysinst: remove trailing whitespace from *.c *.h

In contrast to the messages files, this whitespace is not significant.


# 1.42 13-Oct-2020 martin

PR 55142: on popular demand bring back expert options to adjust the
number of free inodes, block size and fragment size for FFS and LFS.


# 1.41 12-Oct-2020 martin

PR 55536: when we find existing partition tables and have alternative
formats available, offer to delete partitions and create new ones from
scratch (in some other or the same on-disk format).


# 1.40 03-Oct-2020 martin

PR 55384: detangle pm->ptstart from the "install" flag (selecting a
target partition). Instead introduce a new PTI_INSTALL_TARGET per partition
flag and deal with it in the partitioning backends.

Honour pm->ptstart when allocating new partitions - it is supposed to be
the first sector usable by NetBSD.


# 1.39 29-Sep-2020 martin

Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.


# 1.38 28-Sep-2020 martin

PR 55378: do not assume RAW_PART to be either 2 or 3


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.37 19-Feb-2020 martin

branches: 1.37.4;
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


# 1.36 19-Feb-2020 martin

Use strlcpy in a few places to guarnatee 0-terminated strings


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.44 08-Aug-2021 andvar

s/partion/partition/ s/arrray/array/ in comments.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.43 31-Jan-2021 rillig

sysinst: remove trailing whitespace from *.c *.h

In contrast to the messages files, this whitespace is not significant.


# 1.42 13-Oct-2020 martin

PR 55142: on popular demand bring back expert options to adjust the
number of free inodes, block size and fragment size for FFS and LFS.


# 1.41 12-Oct-2020 martin

PR 55536: when we find existing partition tables and have alternative
formats available, offer to delete partitions and create new ones from
scratch (in some other or the same on-disk format).


# 1.40 03-Oct-2020 martin

PR 55384: detangle pm->ptstart from the "install" flag (selecting a
target partition). Instead introduce a new PTI_INSTALL_TARGET per partition
flag and deal with it in the partitioning backends.

Honour pm->ptstart when allocating new partitions - it is supposed to be
the first sector usable by NetBSD.


# 1.39 29-Sep-2020 martin

Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.


# 1.38 28-Sep-2020 martin

PR 55378: do not assume RAW_PART to be either 2 or 3


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.37 19-Feb-2020 martin

branches: 1.37.4;
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


# 1.36 19-Feb-2020 martin

Use strlcpy in a few places to guarnatee 0-terminated strings


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.43 31-Jan-2021 rillig

sysinst: remove trailing whitespace from *.c *.h

In contrast to the messages files, this whitespace is not significant.


# 1.42 13-Oct-2020 martin

PR 55142: on popular demand bring back expert options to adjust the
number of free inodes, block size and fragment size for FFS and LFS.


# 1.41 12-Oct-2020 martin

PR 55536: when we find existing partition tables and have alternative
formats available, offer to delete partitions and create new ones from
scratch (in some other or the same on-disk format).


# 1.40 03-Oct-2020 martin

PR 55384: detangle pm->ptstart from the "install" flag (selecting a
target partition). Instead introduce a new PTI_INSTALL_TARGET per partition
flag and deal with it in the partitioning backends.

Honour pm->ptstart when allocating new partitions - it is supposed to be
the first sector usable by NetBSD.


# 1.39 29-Sep-2020 martin

Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.


# 1.38 28-Sep-2020 martin

PR 55378: do not assume RAW_PART to be either 2 or 3


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.37 19-Feb-2020 martin

branches: 1.37.4;
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


# 1.36 19-Feb-2020 martin

Use strlcpy in a few places to guarnatee 0-terminated strings


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.42 13-Oct-2020 martin

PR 55142: on popular demand bring back expert options to adjust the
number of free inodes, block size and fragment size for FFS and LFS.


# 1.41 12-Oct-2020 martin

PR 55536: when we find existing partition tables and have alternative
formats available, offer to delete partitions and create new ones from
scratch (in some other or the same on-disk format).


# 1.40 03-Oct-2020 martin

PR 55384: detangle pm->ptstart from the "install" flag (selecting a
target partition). Instead introduce a new PTI_INSTALL_TARGET per partition
flag and deal with it in the partitioning backends.

Honour pm->ptstart when allocating new partitions - it is supposed to be
the first sector usable by NetBSD.


# 1.39 29-Sep-2020 martin

Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.


# 1.38 28-Sep-2020 martin

PR 55378: do not assume RAW_PART to be either 2 or 3


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.37 19-Feb-2020 martin

branches: 1.37.4;
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


# 1.36 19-Feb-2020 martin

Use strlcpy in a few places to guarnatee 0-terminated strings


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.40 03-Oct-2020 martin

PR 55384: detangle pm->ptstart from the "install" flag (selecting a
target partition). Instead introduce a new PTI_INSTALL_TARGET per partition
flag and deal with it in the partitioning backends.

Honour pm->ptstart when allocating new partitions - it is supposed to be
the first sector usable by NetBSD.


# 1.39 29-Sep-2020 martin

Apply patch provided by Izumi Tsutsui in PR 55382: make ext2 partitions
show up in the outer (MBR) partition table, needed for example on Cobalt
where firmware boots from that partition.


# 1.38 28-Sep-2020 martin

PR 55378: do not assume RAW_PART to be either 2 or 3


Revision tags: phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406
# 1.37 19-Feb-2020 martin

branches: 1.37.4;
Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


# 1.36 19-Feb-2020 martin

Use strlcpy in a few places to guarnatee 0-terminated strings


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.37 19-Feb-2020 martin

Rever previous: the d_packname in struct disklabel is not NUL terminated.
Disable the warning instead.


# 1.36 19-Feb-2020 martin

Use strlcpy in a few places to guarnatee 0-terminated strings


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.35 06-Feb-2020 martin

Remove a bogus assert: when reading disklabel partitions and the outer
(MBR) partitioning has changed, but the changes have not yet been written
back to disk, we need to ignore the kernels idea of the disklabel and
instead continue with an empty one.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.34 27-Jan-2020 martin

Fix support for non-512-byte/sector disks again after I broke it when
introducing the abstract partition backends.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.33 21-Jan-2020 martin

Deal with even stranger fictious empty disklabels (PR kern/54882).


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.32 21-Jan-2020 mrg

hide disklabel_non_bootable() under NO_DISKLABEL_BOOT like the usage.

should fix most builds.


# 1.31 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.30 15-Jan-2020 martin

Add a method to query the partitioning schemes "internal idea" of a
cylinder size - whatever that means in the real world.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.29 10-Jan-2020 martin

Move the LABELSECTOR check and make it FS type specific - some partition
types (FFS, RAID) are allowed to overlap with the LABELSECTOR.


# 1.28 09-Jan-2020 martin

Finish conversion of extended partitioning parts to new abstract
backend interface. XXX still could use a lot of polishing.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.27 15-Dec-2019 martin

Do not show disklabel command invocation by default (only if there are
errors).


# 1.26 15-Dec-2019 martin

Reject (what we consider) empty/invalid fake disklabels no matter whether
we have other partitioning schemes available or not.


# 1.25 14-Dec-2019 martin

Pass proper track size when initializing the default alignment - this is
important with sunlabels.


# 1.24 14-Dec-2019 martin

If a fictious label has no RAW_PART assume there is no valid disk label.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.23 13-Dec-2019 martin

When finding (paritioning scheme native) partition types for file systems
from our install description, pass the partition type (not only the file
system type). Sometimes (e.g. EFI boot partition on GPT) the filesystem
type (MSDOS) is not a unique selector.


# 1.22 13-Dec-2019 martin

When trying to tell a fictious but empty label from a real one, skip
partition a if it has the same start and size as the raw partition.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.21 12-Dec-2019 martin

Fix inverted comparison


# 1.20 12-Dec-2019 martin

Fix DISKLABEL_NO_ONDISK_VERIFY (accidently disabled in previous)


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.19 12-Dec-2019 martin

Fix detection of existing disklabels in the case when we only have
the disklabel partitioning scheme available.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.18 09-Dec-2019 martin

PR install/54582: allow MD code to disable on-disk presence verification
of "real" disklabels. Auto-enable this (at run time) when there is no other
partitioning scheme but disklabel configured.
Hard-coded enable this for x68k to allow using kernel based translations
for native Human68k partitions.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.17 07-Dec-2019 martin

Relax restrictions on packnames, as disklabel(8) does not do full decoding
for the tag field.
Fix quoting of command args.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.16 06-Dec-2019 martin

Sanitize disk type and packname a bit more - when using existing disklabel
partitions we might run into trouble later when filing this label (unescaped)
in disktab format otherwise.


Revision tags: phil-wifi-20191119
# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.15 12-Nov-2019 martin

Add options to the various partitioning stages that allow cloning of
alien partitions (optionally including data).


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.14 21-Oct-2019 martin

When translating (internal) indices to device names, properly deal with
gaps in partition allocations (e.g. no swap partition).


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.13 14-Aug-2019 martin

Fix some "partition index" (as used in the abstract interface)
versus disklabel "partition letter" confusion.


# 1.12 14-Aug-2019 martin

On architectures that usually do MBR/disklabel, nevertheless deal with
pure/plain disklabel disks, and explicitly offer this as partitioning
option when bootability is not a concern.


# 1.11 07-Aug-2019 martin

Support upgrade of systems using NAME= syntax in /etc/fstab.

Make supported file system types dynamic - instead of hardcoding the
available types at compile time, check for available newfs_* helper
binaries in the actual install environment at runtime.


Revision tags: netbsd-9-base
# 1.10 26-Jul-2019 martin

branches: 1.10.2;
Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.10 26-Jul-2019 martin

Strip trailing / from last mounted strings.
No idea how they happen, but for cgd root (init.root = "/altroot")
they have been reported to exist.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.9 21-Jul-2019 martin

When changing the user geometry, do not alter the disklabel internal
geometry information. On drives only capable of doing CHS addressing,
we rely on this data.


# 1.8 21-Jul-2019 martin

Reintroduce scripting for writing the disklabel


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.7 12-Jul-2019 martin

Implement add_outer_partition (to allow access to partitions outside
the NetBSD disklabel part)


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.6 10-Jul-2019 martin

When deleting all partitions (e.g. before we use the default partition
sizes) do not kill the geometry information in the internal disklabel
copy.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.5 25-Jun-2019 martin

Assert that the label data is valid before invoking disklabel(8)


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.4 20-Jun-2019 martin

Avoid architecture specific ifdefs in main code, move to MD macros.


# 1.3 20-Jun-2019 martin

Disklabel partitions may start at the beginning of the disk (or the
NetBSD partition).


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.2 13-Jun-2019 martin

Fix unitialized variable


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.


# 1.1 12-Jun-2019 martin

Rework internal data structures and "interfaces to user interface" functions
to get rid of all disklabel assumptions.

Previously (even for GPT partitioning) struct disklabel was used, which
obviously breaks large disk setups. Also many MD parts and parts of the
user interface assumed (a) a struct disklabel is used internally to
store partitioning information and (b) partitions are named 'a' ... $MAXPART.

Get rid of this and replace it with a quite abstract interface that should
be able to deal with all variants in partition storage:

- partitions are stored in a (partly abstract) struct disk_partitions
and most parts of it are only accessed via accessor functions provided
by a "partitioning scheme".

- implement partitioning schemes for MBR, disklabel and GPT (with likely
RDB [amiga] and Apple Partition Map [mac*] to follow soon)

- partitioning schemes may be cascaded, e.g. on x86 when using MBR as
"outer partitions", we have disklabel as "inner partitions".

- all user interface goes via accessor functions in the partitioning scheme,
some of which return pointers to special user interface descriptors
(e.g. to allow editing partition flags, which are scheme specific)

Overall the user interface changes (in this initial step) are minimal but
noticable. A new Anita is needed for automatic test setups - many thanks
to Andreas Gustafsson for lots of early testing and a new Anita version,
and to Manuel Bouyer for cooperation and tests of the Anita release.

This work was sponsored by The NetBSD Foundation, Inc.