History log of /netbsd-current/usr.sbin/sysinst/bsddisklabel.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.72 06-Jan-2023 martin

When matching real partitions to "wanted" install descriptions, skip
all types of special partitions (like raw disk, or the MBR container
partition for the NetBSD part of the disk).
The start of the partition is no unique identifier if we include these
in the matching (e.g. boot partition and raw partition may both start
at sector 0).


# 1.71 27-Dec-2022 martin

PR 57132: when calculation additional space available for the "expanded"
partition (typically /) do not forget the reserved space (that might
be required for the system/bootloader/other MD stuff).


# 1.70 16-Dec-2022 martin

Switch back to FFSv2ea as default for new installations


Revision tags: netbsd-10-base
# 1.69 15-Dec-2022 martin

branches: 1.69.2;
Add an (expert) option to manually edit partitions, inspired by PR 57100.


# 1.68 15-Dec-2022 martin

Temporarily back out rev 1.66 and switch the default FFS type back to
FFSv2 (w/o ea) for the upcoming netbsd-10 branch.


# 1.67 09-Dec-2022 martin

A little less (confusing) magic: adjust the size of / when adding /usr
only if / has not beenn manually resized.


# 1.66 30-Nov-2022 martin

Switch the default FFS type from FFSv2 to FFSv2ea - we want extended
attribute support to be exercised and tested.

If you want to share a new installed disk with older NetBSD
installations or (read only) with other OSes you need to explicitly set
the FS type to FFSv2 now.


# 1.65 30-Nov-2022 martin

Add support for FFSv2ea in the partition type menus (internally setting
fs version to 3 for this, where 2 is FFSv2 and 1 is FFSv1)


# 1.64 16-Jun-2022 tsutsui

Fix pasto.


# 1.63 28-May-2022 andvar

fix various typos, mainly in comments.


# 1.62 22-May-2022 andvar

fix various small typos, mainly in comments.


# 1.61 04-May-2022 andvar

s/entires/entries/


# 1.60 16-Apr-2022 andvar

fix various typos in comments and log messages.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.71 27-Dec-2022 martin

PR 57132: when calculation additional space available for the "expanded"
partition (typically /) do not forget the reserved space (that might
be required for the system/bootloader/other MD stuff).


# 1.70 16-Dec-2022 martin

Switch back to FFSv2ea as default for new installations


Revision tags: netbsd-10-base
# 1.69 15-Dec-2022 martin

Add an (expert) option to manually edit partitions, inspired by PR 57100.


# 1.68 15-Dec-2022 martin

Temporarily back out rev 1.66 and switch the default FFS type back to
FFSv2 (w/o ea) for the upcoming netbsd-10 branch.


# 1.67 09-Dec-2022 martin

A little less (confusing) magic: adjust the size of / when adding /usr
only if / has not beenn manually resized.


# 1.66 30-Nov-2022 martin

Switch the default FFS type from FFSv2 to FFSv2ea - we want extended
attribute support to be exercised and tested.

If you want to share a new installed disk with older NetBSD
installations or (read only) with other OSes you need to explicitly set
the FS type to FFSv2 now.


# 1.65 30-Nov-2022 martin

Add support for FFSv2ea in the partition type menus (internally setting
fs version to 3 for this, where 2 is FFSv2 and 1 is FFSv1)


# 1.64 16-Jun-2022 tsutsui

Fix pasto.


# 1.63 28-May-2022 andvar

fix various typos, mainly in comments.


# 1.62 22-May-2022 andvar

fix various small typos, mainly in comments.


# 1.61 04-May-2022 andvar

s/entires/entries/


# 1.60 16-Apr-2022 andvar

fix various typos in comments and log messages.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.70 16-Dec-2022 martin

Switch back to FFSv2ea as default for new installations


Revision tags: netbsd-10-base
# 1.69 15-Dec-2022 martin

Add an (expert) option to manually edit partitions, inspired by PR 57100.


# 1.68 15-Dec-2022 martin

Temporarily back out rev 1.66 and switch the default FFS type back to
FFSv2 (w/o ea) for the upcoming netbsd-10 branch.


# 1.67 09-Dec-2022 martin

A little less (confusing) magic: adjust the size of / when adding /usr
only if / has not beenn manually resized.


# 1.66 30-Nov-2022 martin

Switch the default FFS type from FFSv2 to FFSv2ea - we want extended
attribute support to be exercised and tested.

If you want to share a new installed disk with older NetBSD
installations or (read only) with other OSes you need to explicitly set
the FS type to FFSv2 now.


# 1.65 30-Nov-2022 martin

Add support for FFSv2ea in the partition type menus (internally setting
fs version to 3 for this, where 2 is FFSv2 and 1 is FFSv1)


# 1.64 16-Jun-2022 tsutsui

Fix pasto.


# 1.63 28-May-2022 andvar

fix various typos, mainly in comments.


# 1.62 22-May-2022 andvar

fix various small typos, mainly in comments.


# 1.61 04-May-2022 andvar

s/entires/entries/


# 1.60 16-Apr-2022 andvar

fix various typos in comments and log messages.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.70 16-Dec-2022 martin

Switch back to FFSv2ea as default for new installations


Revision tags: netbsd-10-base
# 1.69 15-Dec-2022 martin

Add an (expert) option to manually edit partitions, inspired by PR 57100.


# 1.68 15-Dec-2022 martin

Temporarily back out rev 1.66 and switch the default FFS type back to
FFSv2 (w/o ea) for the upcoming netbsd-10 branch.


# 1.67 09-Dec-2022 martin

A little less (confusing) magic: adjust the size of / when adding /usr
only if / has not beenn manually resized.


# 1.66 30-Nov-2022 martin

Switch the default FFS type from FFSv2 to FFSv2ea - we want extended
attribute support to be exercised and tested.

If you want to share a new installed disk with older NetBSD
installations or (read only) with other OSes you need to explicitly set
the FS type to FFSv2 now.


# 1.65 30-Nov-2022 martin

Add support for FFSv2ea in the partition type menus (internally setting
fs version to 3 for this, where 2 is FFSv2 and 1 is FFSv1)


# 1.64 16-Jun-2022 tsutsui

Fix pasto.


# 1.63 28-May-2022 andvar

fix various typos, mainly in comments.


# 1.62 22-May-2022 andvar

fix various small typos, mainly in comments.


# 1.61 04-May-2022 andvar

s/entires/entries/


# 1.60 16-Apr-2022 andvar

fix various typos in comments and log messages.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.67 09-Dec-2022 martin

A little less (confusing) magic: adjust the size of / when adding /usr
only if / has not beenn manually resized.


# 1.66 30-Nov-2022 martin

Switch the default FFS type from FFSv2 to FFSv2ea - we want extended
attribute support to be exercised and tested.

If you want to share a new installed disk with older NetBSD
installations or (read only) with other OSes you need to explicitly set
the FS type to FFSv2 now.


# 1.65 30-Nov-2022 martin

Add support for FFSv2ea in the partition type menus (internally setting
fs version to 3 for this, where 2 is FFSv2 and 1 is FFSv1)


# 1.64 16-Jun-2022 tsutsui

Fix pasto.


# 1.63 28-May-2022 andvar

fix various typos, mainly in comments.


# 1.62 22-May-2022 andvar

fix various small typos, mainly in comments.


# 1.61 04-May-2022 andvar

s/entires/entries/


# 1.60 16-Apr-2022 andvar

fix various typos in comments and log messages.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.66 30-Nov-2022 martin

Switch the default FFS type from FFSv2 to FFSv2ea - we want extended
attribute support to be exercised and tested.

If you want to share a new installed disk with older NetBSD
installations or (read only) with other OSes you need to explicitly set
the FS type to FFSv2 now.


# 1.65 30-Nov-2022 martin

Add support for FFSv2ea in the partition type menus (internally setting
fs version to 3 for this, where 2 is FFSv2 and 1 is FFSv1)


# 1.64 16-Jun-2022 tsutsui

Fix pasto.


# 1.63 28-May-2022 andvar

fix various typos, mainly in comments.


# 1.62 22-May-2022 andvar

fix various small typos, mainly in comments.


# 1.61 04-May-2022 andvar

s/entires/entries/


# 1.60 16-Apr-2022 andvar

fix various typos in comments and log messages.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.64 16-Jun-2022 tsutsui

Fix pasto.


# 1.63 28-May-2022 andvar

fix various typos, mainly in comments.


# 1.62 22-May-2022 andvar

fix various small typos, mainly in comments.


# 1.61 04-May-2022 andvar

s/entires/entries/


# 1.60 16-Apr-2022 andvar

fix various typos in comments and log messages.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.63 28-May-2022 andvar

fix various typos, mainly in comments.


# 1.62 22-May-2022 andvar

fix various small typos, mainly in comments.


# 1.61 04-May-2022 andvar

s/entires/entries/


# 1.60 16-Apr-2022 andvar

fix various typos in comments and log messages.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.62 22-May-2022 andvar

fix various small typos, mainly in comments.


# 1.61 04-May-2022 andvar

s/entires/entries/


# 1.60 16-Apr-2022 andvar

fix various typos in comments and log messages.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.61 04-May-2022 andvar

s/entires/entries/


# 1.60 16-Apr-2022 andvar

fix various typos in comments and log messages.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.60 16-Apr-2022 andvar

fix various typos in comments and log messages.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.59 20-Jul-2021 martin

PR 56303: do not borrow from the default swap allocation if we are in
tiny ram conditions and will need to enable swap early.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.58 13-Feb-2021 martin

PR 55991: when extending the marked partition (typically: the NetBSD root
partition) round the new size up to current alignment.

This may lead to a slightly smaller than initialy planned last partition
(depending on order added) if the disk size is odd or the partitioning
scheme needs some internal space (like GPT) - but it avoids gaps elsewhere
due to alignement.

Ideally we would pin all other partitions in a first pass and then let
the partitioning backend pick the full available size for the extended
partition, but this should be good enough.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.57 31-Jan-2021 rillig

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

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


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.56 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.55 13-Oct-2020 martin

Ooops, part of previous was not meant to be included yet


# 1.54 13-Oct-2020 martin

Before forcing MBR partitions into our disklabel, make sure they are not
there yet - could happen in various paths when reusing existing partitions
(or parts of that) - previously we would blindly duplicate identical
partitions.


# 1.53 12-Oct-2020 martin

Minor fix to previous: fix condition when we offer the partition type
switch - it makes sense even if the disk is partitioned but has no valid
partitions.


# 1.52 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.51 12-Oct-2020 martin

Previously we abused pm->ptstart / pm->ptsize to pass the bounds of the
NetBSD outer partition to the inner partition editor - but now this is
not a valid assumption any more, so explicitly fix the bounds if an
outer partition exists.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.50 09-Oct-2020 martin

When MD code requests a reserved area (at the start of the disk)
make sure to properly account for the "lost" space during all calculations
and especially when expanding the main partition to fill the disk.

Avoid using the global "pm" or a passed device descriptons when we are
passing disk limits explicitly anyway.

Simplify/fix a few rounding calculations.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.49 05-Oct-2020 martin

Add a heuristic to detect and properly mark EFI system partitions
when re-using pre-existing partitions.


# 1.48 04-Oct-2020 martin

When merging existing partitions with desired target system layout
information, only force the "mount" flag if the existing partitions
has a valid mount point.


# 1.47 04-Oct-2020 martin

If we have no explicitly marke target root partition, make sure to set
the proper flag on the implicit one.


# 1.46 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.45 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.44 28-Sep-2020 martin

PR 55377: mark boot partitions in the partition size display, as suggested
by Izumi Tsutsui (minor modifications + all bugs by me)


# 1.43 22-Sep-2020 martin

Keep a list of all partition tables from which we have deleted partitions
and make sure we update those partition tables when writing partitions,
even if no install related partition remains on them.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.42 12-May-2020 martin

Minor tweak to previous: when forcing a /usr partition just to have an
arbitrary extendable partition, still use its default size initially.


# 1.41 11-May-2020 martin

When extending a partition (to fill the total disk size) do respect
size limits.
Do not suggest a size limited partition for extension by default.


# 1.40 11-May-2020 martin

Redo the root-size-limit check again after we grew the root partition
for kernel dumps. Auto-enable the /usr partition if it overflows.
For all non-root partitions, default to FFSv2.


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

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.39 06-Feb-2020 martin

Only a single partition can ever have the "extend" flag (grow to available
size).


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.38 27-Jan-2020 martin

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


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.37 24-Jan-2020 martin

Factor out all RAM size thresholds as defines to avoid magic numbers.
To work around PR misc/54886 bump the threshold for a tmpfs /tmp mount
up to 256 MB.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.36 20-Jan-2020 martin

First try to bring evbarm installation closer to current reality.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.35 16-Jan-2020 martin

Fix /tmp tmpfs handling and on machines with enough RAM default to
creating a /tmp tmpfs with 25% of ram size limit. Suggested by ad@.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.34 09-Jan-2020 martin

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


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.33 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.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.32 08-Dec-2019 martin

PR install/54745: fix confusion about absolut and NetBSD-partition
relative offsets.


Revision tags: phil-wifi-20191119
# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.31 13-Nov-2019 martin

Make cloning support optional, so we can save some space on very small
install media.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.30 12-Nov-2019 martin

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


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.29 25-Oct-2019 martin

Honor the "no_mbr" flag (used especially for raid and xbd devices)


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.28 21-Oct-2019 martin

Skip unwanted (zero sized) partitions.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.27 28-Aug-2019 martin

Remove dead (#if 0) code.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.26 01-Aug-2019 martin

If we can not fit a planned partition, retry with a bit more slope
in size.


# 1.25 01-Aug-2019 martin

PR 54423: complete initialization of install info for user defined partitions


# 1.24 01-Aug-2019 martin

PR 54423: fix handling of user defined partitions


Revision tags: netbsd-9-base
# 1.23 28-Jul-2019 martin

branches: 1.23.2;
If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.23 28-Jul-2019 martin

If available, show additional names of foreign partitions in the
size menu. Makes installing on machines with other OSes installed
a lot less confusing.


# 1.22 28-Jul-2019 martin

When merging existing partitions into the planned installation partitions,
keep the separation between the original planned partitions and the
pre-exiting partitions.
Also do not call found partitions "outer" if they are not (but could be)


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.21 15-Jul-2019 martin

Don't overwrite the filesystem type unconditionally with the FFSv1 or v2
setup for an architectures default - now we have /tmp on tmpfs back.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.20 14-Jul-2019 martin

Don't force mounting of newfs'd partitions.
Provide MD hooks for setups where we do not need any bootblocks.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.19 12-Jul-2019 martin

When adding non-disklabel boot partitions (or similar), distinguish between
ones we need to add to the outer (MBR) partitions, or copy over to the
inner (disklabel) partitions.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.18 09-Jul-2019 martin

When we are going to create (and populate) a new boot partition, we should
newfs and mount it.

Fix arguments to the MD_PART_DEFAULTS macro and invoke it a bit earlier
(before we shift things around).


# 1.17 09-Jul-2019 martin

When checking for existing NetBSD partitions skip extended MBR and disklabel
raw partitions.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.16 22-Jun-2019 christos

no need to initialize fields that are already 0.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.15 20-Jun-2019 martin

Avoid creating a (tiny) swap partition by default on overall too small
disks.


# 1.14 20-Jun-2019 christos

mount is an array and can't be NULL (rin)


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.13 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.


# 1.12 15-Jun-2019 martin

When setting up a "use whole disk" single outer partition, force an
empty set of inner partitions immediately,

This avoids reading old (stale) partitions (e.g. disklabel that
survived cleaning and re-creating the MBR with the MBR NetBSD partition
starting at the same offset) later.


# 1.11 13-Jun-2019 martin

When merging existing partitions into our install description, mark
them as to-be-mounted.


# 1.10 13-Jun-2019 martin

Do not use dynamic size adjustments on install descriptions based
on existing partitions - we need to keep them fixed to not confuse
free space calculation.


# 1.9 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.


Revision tags: phil-wifi-20190609
# 1.8 12-Feb-2019 martin

Backout previous snprintf nonsense, instead STFU gcc 7's most
useless warning ever.


# 1.7 11-Feb-2019 martin

Fix a few off by one (in both directions) in previous, pointed out by mrg.
Avoid open coding snprintf return value checking and introduce a
helper functions that always ensures string termination instead,
suggested by christos.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.6 20-Nov-2018 martin

Convert all static menu struct initializiations to C99 name initializer
format - prerequisite for an upcoming evil hack (tm).
No functional change intended.


# 1.5 15-Nov-2018 martin

Make use of the new positional parameters to better describe the first
partitioning step. Remove size limits/hints encoded in the translations
and replace them by values from the code.


Revision tags: pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.4 03-Jun-2018 martin

branches: 1.4.2;
Add an option to install onto a pre-configured wedge.
Greatly simmplifies (U)EFI setups (but does not fully automate them yet).


Revision tags: pgoyette-compat-0521
# 1.3 18-May-2018 joerg

deconst -> __UNCONST, the former involves UB with NULL arithmetic.


Revision tags: netbsd-7-2-RELEASE pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 tls-maxphys-base netbsd-7-base tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2; 1.2.6; 1.2.20; 1.2.26;
(Finally) merge a slightly modified version of the 2012 GSoC results
from Eugene Lozovoy: add extended partitioning options to sysinst.
Still needs some testing and polishing, but it now is possible to use GPT
or to create a RAID set from scratch and install onto it.


# 1.1 26-Jul-2014 dholland

Move sysinst sources to usr.sbin.

This commit only physically moves the sources - there are no other
changes, to maximize the probability that this will be treated as a
rename if we ever do manage to migrate away from CVS.

Moving sysinst has been discussed on and off for years and has two
goals: making it easier to work on sysinst, and also making sysinst
available on running systems for use installing chroots and VM images
and other such things. None of the latter is possible yet, but as they
say, one thing at a time.

Doing this now was approved in an impromptu fashion by mrg, riz,
riastradh, me, and groo.