History log of /netbsd-current/usr.sbin/sysinst/arch/i386/md.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.35 10-Feb-2022 martin

x86: fix previous: in the UEFI case copy the bootloaders from install
media during initial installation, but use the (by then: updated)
files from the target disk for system upgrades.


# 1.34 29-Jan-2022 martin

When upgrading, update the boot code post extraction from
the updated target file system.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.33 23-Oct-2020 martin

Do not force bootselector MBR code for installs with only a single named
partition.


# 1.32 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.31 10-Oct-2020 martin

Remove more pm->ptstart abuse - calculate values localy where needed
instead.


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

PR install/54934: always use -f on the installboot invocation. We come
here post-newfs (and maybe should have dd'd zeros to the start of the
disk before newfs instead).


# 1.29 27-Jan-2020 martin

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


# 1.28 09-Jan-2020 martin

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


# 1.27 13-Dec-2019 martin

Remove bogus assert.


Revision tags: phil-wifi-20191119
# 1.26 18-Nov-2019 martin

Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


# 1.25 18-Nov-2019 martin

Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


# 1.24 16-Nov-2019 martin

On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


# 1.23 16-Nov-2019 martin

knf style adjustments


# 1.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 29-Jan-2022 martin

When upgrading, update the boot code post extraction from
the updated target file system.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.33 23-Oct-2020 martin

Do not force bootselector MBR code for installs with only a single named
partition.


# 1.32 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.31 10-Oct-2020 martin

Remove more pm->ptstart abuse - calculate values localy where needed
instead.


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

PR install/54934: always use -f on the installboot invocation. We come
here post-newfs (and maybe should have dd'd zeros to the start of the
disk before newfs instead).


# 1.29 27-Jan-2020 martin

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


# 1.28 09-Jan-2020 martin

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


# 1.27 13-Dec-2019 martin

Remove bogus assert.


Revision tags: phil-wifi-20191119
# 1.26 18-Nov-2019 martin

Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


# 1.25 18-Nov-2019 martin

Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


# 1.24 16-Nov-2019 martin

On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


# 1.23 16-Nov-2019 martin

knf style adjustments


# 1.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 23-Oct-2020 martin

Do not force bootselector MBR code for installs with only a single named
partition.


# 1.32 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.31 10-Oct-2020 martin

Remove more pm->ptstart abuse - calculate values localy where needed
instead.


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

PR install/54934: always use -f on the installboot invocation. We come
here post-newfs (and maybe should have dd'd zeros to the start of the
disk before newfs instead).


# 1.29 27-Jan-2020 martin

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


# 1.28 09-Jan-2020 martin

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


# 1.27 13-Dec-2019 martin

Remove bogus assert.


Revision tags: phil-wifi-20191119
# 1.26 18-Nov-2019 martin

Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


# 1.25 18-Nov-2019 martin

Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


# 1.24 16-Nov-2019 martin

On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


# 1.23 16-Nov-2019 martin

knf style adjustments


# 1.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 10-Oct-2020 martin

Remove more pm->ptstart abuse - calculate values localy where needed
instead.


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

PR install/54934: always use -f on the installboot invocation. We come
here post-newfs (and maybe should have dd'd zeros to the start of the
disk before newfs instead).


# 1.29 27-Jan-2020 martin

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


# 1.28 09-Jan-2020 martin

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


# 1.27 13-Dec-2019 martin

Remove bogus assert.


Revision tags: phil-wifi-20191119
# 1.26 18-Nov-2019 martin

Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


# 1.25 18-Nov-2019 martin

Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


# 1.24 16-Nov-2019 martin

On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


# 1.23 16-Nov-2019 martin

knf style adjustments


# 1.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 06-Feb-2020 martin

PR install/54934: always use -f on the installboot invocation. We come
here post-newfs (and maybe should have dd'd zeros to the start of the
disk before newfs instead).


# 1.29 27-Jan-2020 martin

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


# 1.28 09-Jan-2020 martin

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


# 1.27 13-Dec-2019 martin

Remove bogus assert.


Revision tags: phil-wifi-20191119
# 1.26 18-Nov-2019 martin

Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


# 1.25 18-Nov-2019 martin

Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


# 1.24 16-Nov-2019 martin

On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


# 1.23 16-Nov-2019 martin

knf style adjustments


# 1.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 27-Jan-2020 martin

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


# 1.28 09-Jan-2020 martin

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


# 1.27 13-Dec-2019 martin

Remove bogus assert.


Revision tags: phil-wifi-20191119
# 1.26 18-Nov-2019 martin

Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


# 1.25 18-Nov-2019 martin

Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


# 1.24 16-Nov-2019 martin

On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


# 1.23 16-Nov-2019 martin

knf style adjustments


# 1.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 09-Jan-2020 martin

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


# 1.27 13-Dec-2019 martin

Remove bogus assert.


Revision tags: phil-wifi-20191119
# 1.26 18-Nov-2019 martin

Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


# 1.25 18-Nov-2019 martin

Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


# 1.24 16-Nov-2019 martin

On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


# 1.23 16-Nov-2019 martin

knf style adjustments


# 1.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 13-Dec-2019 martin

Remove bogus assert.


Revision tags: phil-wifi-20191119
# 1.26 18-Nov-2019 martin

Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


# 1.25 18-Nov-2019 martin

Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


# 1.24 16-Nov-2019 martin

On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


# 1.23 16-Nov-2019 martin

knf style adjustments


# 1.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 18-Nov-2019 martin

Fix previous: not a good idea to try to copy files from the not yet
extracted sets.


# 1.25 18-Nov-2019 martin

Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


# 1.24 16-Nov-2019 martin

On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


# 1.23 16-Nov-2019 martin

knf style adjustments


# 1.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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.25 18-Nov-2019 martin

Fix previous: the install medium may not have /usr/mdec/prekern; it was
meant to copy the one from the just installed system.


# 1.24 16-Nov-2019 martin

On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


# 1.23 16-Nov-2019 martin

knf style adjustments


# 1.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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.24 16-Nov-2019 martin

On amd64 support installation with a KASLR kernel, via "custom install"
and selecting the GENERIC_KASLR kernel set.
Setup /prekern and boot.cfg accordingly.


# 1.23 16-Nov-2019 martin

knf style adjustments


# 1.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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.22 12-Nov-2019 martin

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


# 1.21 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

branches: 1.20.2;
Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 14-Aug-2019 martin

When we ask the user to select a partitioning scheme and they refuse
(that is: select "Exit" in the menu), abort installation.


Revision tags: netbsd-9-base
# 1.20 14-Jul-2019 martin

Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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

Work in progress UEFI boot support, don't try this at home yet!


# 1.19 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 13-Jul-2019 martin

We may call md_pre_mount() multiple times for the same install set,
so pass an additional index argument so MD code knows which part
of the install will be mounted next.


# 1.18 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 20-Jun-2019 christos

Use _fmt_ msg_ methods when formats are needed.


# 1.17 19-Jun-2019 martin

Deal with manualy set disk geometries more carefully to avoid a division
by zero.


# 1.16 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 17-Jun-2019 martin

whitespace


# 1.15 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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 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 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

branches: 1.11.2;
add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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.


Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226
# 1.14 27-Nov-2018 martin

Cosmetics: consistently use MEG and GIG defines for size calculations


Revision tags: pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930
# 1.13 15-Sep-2018 martin

When not using the serial console while installing with sysinst,
switch all ports in /etc/ttys over to wsvt25.

For mixed setups that sometims do serial console and otherwise
frambuffer console, it would be better to leave console and constty as
vt100, but switch console to off and ttyE0 to on, but we do not want
to bother the user with tricky questions here and everyone switching
console types should have no problem changing this setup later,
or even deal with a serial console and TERM=wsvt25.


# 1.12 15-Sep-2018 martin

Fix merge mishap in rev 1.9/1.10 - remove accidently duplicated
code. No functional change.


Revision tags: pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625
# 1.11 03-Jun-2018 christos

add missing brace.


# 1.10 03-Jun-2018 martin

Default console device and speed to that used by syinst


# 1.9 03-Jun-2018 martin

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.8 18-May-2018 joerg

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


Revision tags: pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.7 11-Sep-2017 gson

branches: 1.7.2;
Clear the screen after running installboot. If we don't, there will
be a leftover line saying "Status: Finished" at the top of the next
screen, along with some random punctuation in the left and right
margins. Inspired by ../landisk/md.c 1.3.


Revision tags: 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 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.6 10-May-2015 martin

branches: 1.6.8;
Backout the previous incorrect fix for PR 49440 and redo it more globaly:
get rid of the global "yesno", introduce utility functions "ask_yesno()"
and "ask_noyes()" instead, greatly simplifying a lot of code.
Pass in a pointer to the return value to various "set source" menus.


# 1.5 02-Jan-2015 abs

Rather than scatter set_swap() calls wrapped in ram size checks through
md_post_disklabel() and md_pre_update(), abstract them out to an MI
set_swap_if_low_ram() and call from the appropriate MI places.
Now all platforms add swap if the system has <= 32M of RAM.


# 1.4 11-Oct-2014 gson

When checking if the user chose to use the existing bootblocks, use
the appropriate variable, boottype.bp_consdev, not the uninitialized
bp.bp_consdev. Also remove bp and bootxx since their only use was in
the incorrect check. This should fix the problem of sysinst segfaulting
when you choose "Use existing bootblocks" on amd64.


Revision tags: tls-maxphys-base netbsd-7-base
# 1.3 11-Aug-2014 riz

branches: 1.3.2; 1.3.4;
Use installboot to install bootblocks for i386/amd64, now that
they are included on all boot media.

Some of the previous method of setting the console (and conspeed, when
using serial console) is retained, but it should probably be reworked.

Also, adapt to the fact that we may be installing to a disk wedge.

With this change, it is now possible (but still ugly) for sysinst to
create a bootable GPT-labeled disk.


Revision tags: tls-earlyentropy-base
# 1.2 03-Aug-2014 martin

branches: 1.2.2;
(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.