Add debug FUNCS_ONLY knob
Hacking on the installer while running it is a lot easier when you can
inspect or run functions directly without paging the whole script or
poking around in it with ed.
install.sub is already structured so that all functions come first,
then MD code, then actual commands.
Copy FUNCS_ONLY from rc.subr(8) so you can drop out any time and hack around
more conveniently:
Available disks are: sd0 sd1.
Which disk is the root disk? ('?' for details) [sd0] !
Type 'exit' to return to install.
test# FUNCS_ONLY=1 . /install.sub
test# typeset -f get_dkdevs
get_dkdevs() {
echo $(scan_disknames "${MDDKDEVS:-/^[sw]d[0-9][0-9]* /s/ .*//p}")
}
test# get_dkdevs
sd0 sd1
test#
This requires the sourcing shell to be ksh(1) or sh(1) with 'strict Bourne
shell mode' disabled. '!' is ksh now, but the initial (S)hell answer still
lands in a strict (default) sh(1) -- that can/should be fixed separately.
OK deraadt