git: 03d66186f626 - main - bsdinstall: add hooks to allow for easier customizing the install

From: Brad Davis <brd_at_FreeBSD.org>
Date: Mon, 03 Oct 2022 15:51:02 UTC
The branch main has been updated by brd:

URL: https://cgit.FreeBSD.org/src/commit/?id=03d66186f626736ca0467965ac456371e7bd0c9c

commit 03d66186f626736ca0467965ac456371e7bd0c9c
Author:     Brad Davis <brd@FreeBSD.org>
AuthorDate: 2022-10-03 15:49:31 +0000
Commit:     Brad Davis <brd@FreeBSD.org>
CommitDate: 2022-10-03 15:50:42 +0000

    bsdinstall: add hooks to allow for easier customizing the install
    
    Approved by:    allanjude
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:  https://reviews.freebsd.org/D36459
---
 usr.sbin/bsdinstall/scripts/auto | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto
index 553c51b82287..fa433c68a82a 100755
--- a/usr.sbin/bsdinstall/scripts/auto
+++ b/usr.sbin/bsdinstall/scripts/auto
@@ -146,6 +146,8 @@ f_dprintf "Began Installation at %s" "$( date )"
 rm -rf $BSDINSTALL_TMPETC
 mkdir $BSDINSTALL_TMPETC
 
+[ -f /usr/libexec/bsdinstall/local.pre-everything ] && f_dprintf "Running local.pre-everything" && sh /usr/libexec/bsdinstall/local.pre-everything "$BSDINSTALL_CHROOT"
+
 trap true SIGINT	# This section is optional
 [ -z "$BSDINSTALL_SKIP_KEYMAP" ] && bsdinstall keymap
 
@@ -187,6 +189,8 @@ fi
 rm -f $PATH_FSTAB
 touch $PATH_FSTAB
 
+[ -f /usr/libexec/bsdinstall/local.pre-partition ] && f_dprintf "Running local.pre-partition" && sh /usr/libexec/bsdinstall/local.pre-partition "$BSDINSTALL_CHROOT"
+
 #
 # Try to detect known broken platforms and apply their workarounds
 #
@@ -334,6 +338,8 @@ case "$PARTMODE" in
 	;;
 esac
 
+[ -f /usr/libexec/bsdinstall/local.pre-fetch ] && f_dprintf "Running local.pre-fetch" && sh /usr/libexec/bsdinstall/local.pre-fetch "$BSDINSTALL_CHROOT"
+
 if [ -n "$FETCH_DISTRIBUTIONS" ]; then
 	exec 3>&1
 	export BSDINSTALL_DISTDIR=$(`dirname $0`/fetchmissingdists 2>&1 1>&3)
@@ -348,6 +354,8 @@ bsdinstall distextract || error "Distribution extract failed"
 # Set up boot loader
 bsdinstall bootconfig || error "Failed to configure bootloader"
 
+[ -f /usr/libexec/bsdinstall/local.pre-configure ] && f_dprintf "Running local.pre-configure" && sh /usr/libexec/bsdinstall/local.pre-configure "$BSDINSTALL_CHROOT"
+
 bsdinstall rootpass || error "Could not set root password"
 
 trap true SIGINT	# This section is optional
@@ -425,6 +433,8 @@ if [ ! -z "$BSDINSTALL_FETCHDEST" ]; then
 	rm -rf "$BSDINSTALL_FETCHDEST"
 fi
 
+[ -f /usr/libexec/bsdinstall/local.post-configure ] && f_dprintf "Running local.post-configure" && sh /usr/libexec/bsdinstall/local.post-configure "$BSDINSTALL_CHROOT"
+
 if [ -z "$BSDINSTALL_SKIP_MANUAL" ]; then
 	dialog --backtitle "$OSNAME Installer" --title "Manual Configuration" \
 		--default-button no --yesno \