Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bsdinstall/scripts/auto
Show First 20 Lines • Show All 141 Lines • ▼ Show 20 Lines | |||||
############################################################ MAIN | ############################################################ MAIN | ||||
f_dprintf "Began Installation at %s" "$( date )" | f_dprintf "Began Installation at %s" "$( date )" | ||||
rm -rf $BSDINSTALL_TMPETC | rm -rf $BSDINSTALL_TMPETC | ||||
mkdir $BSDINSTALL_TMPETC | mkdir $BSDINSTALL_TMPETC | ||||
trap true SIGINT # This section is optional | trap true SIGINT # This section is optional | ||||
bsdinstall keymap | [ -z "$BSDINSTALL_KEYMAP_SKIP" ] && bsdinstall keymap | ||||
trap error SIGINT # Catch cntrl-C here | trap error SIGINT # Catch cntrl-C here | ||||
bsdinstall hostname || error "Set hostname failed" | bsdinstall hostname || error "Set hostname failed" | ||||
: ${DISTRIBUTIONS:="base.txz kernel.txz"} | : ${DISTRIBUTIONS:="base.txz kernel.txz"} | ||||
if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then | if [ -f $BSDINSTALL_DISTDIR/MANIFEST ]; then | ||||
DISTMENU=`awk -F'\t' '!/^(kernel\.txz|base\.txz)/{print $1,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST` | DISTMENU=`awk -F'\t' '!/^(kernel\.txz|base\.txz)/{print $1,$5,$6}' $BSDINSTALL_DISTDIR/MANIFEST` | ||||
DISTMENU="$(echo ${DISTMENU} | sed -E 's/\.txz//g')" | DISTMENU="$(echo ${DISTMENU} | sed -E 's/\.txz//g')" | ||||
▲ Show 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | |||||
bsdinstall bootconfig || error "Failed to configure bootloader" | bsdinstall bootconfig || error "Failed to configure bootloader" | ||||
bsdinstall rootpass || error "Could not set root password" | bsdinstall rootpass || error "Could not set root password" | ||||
trap true SIGINT # This section is optional | trap true SIGINT # This section is optional | ||||
if [ "$NETCONFIG_DONE" != yes ]; then | if [ "$NETCONFIG_DONE" != yes ]; then | ||||
bsdinstall netconfig # Don't check for errors -- the user may cancel | bsdinstall netconfig # Don't check for errors -- the user may cancel | ||||
fi | fi | ||||
bsdinstall time | [ -z "$BSDINSTALL_TIME_SKIP" ] && bsdinstall time | ||||
bsdinstall services | [ -z "$BSDINSTALL_SERVICES_SKIP" ] && bsdinstall services | ||||
bsdinstall hardening | [ -z "$BSDINSTALL_HARDENING_SKIP" ] && bsdinstall hardening | ||||
dialog --backtitle "$OSNAME Installer" --title "Add User Accounts" --yesno \ | [ -z "$BSDINSTALL_USERS_SKIP" ] && dialog --backtitle "$OSNAME Installer" \ | ||||
--title "Add User Accounts" --yesno \ | |||||
"Would you like to add users to the installed system now?" 0 0 && \ | "Would you like to add users to the installed system now?" 0 0 && \ | ||||
bsdinstall adduser | bsdinstall adduser | ||||
finalconfig() { | finalconfig() { | ||||
exec 3>&1 | exec 3>&1 | ||||
REVISIT=$(dialog --backtitle "$OSNAME Installer" \ | REVISIT=$(dialog --backtitle "$OSNAME Installer" \ | ||||
--title "Final Configuration" --no-cancel --menu \ | --title "Final Configuration" --no-cancel --menu \ | ||||
"Setup of your $OSNAME system is nearly complete. You can now modify your configuration choices. After this screen, you will have an opportunity to make more complex changes using a shell." 0 0 0 \ | "Setup of your $OSNAME system is nearly complete. You can now modify your configuration choices. After this screen, you will have an opportunity to make more complex changes using a shell." 0 0 0 \ | ||||
▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
trap error SIGINT # SIGINT is bad again | trap error SIGINT # SIGINT is bad again | ||||
bsdinstall config || error "Failed to save config" | bsdinstall config || error "Failed to save config" | ||||
if [ ! -z "$BSDINSTALL_FETCHDEST" ]; then | if [ ! -z "$BSDINSTALL_FETCHDEST" ]; then | ||||
rm -rf "$BSDINSTALL_FETCHDEST" | rm -rf "$BSDINSTALL_FETCHDEST" | ||||
fi | fi | ||||
if [ -z "$BSDINSTALL_MANUAL_SKIP" ]; then | |||||
dialog --backtitle "$OSNAME Installer" --title "Manual Configuration" \ | dialog --backtitle "$OSNAME Installer" --title "Manual Configuration" \ | ||||
--default-button no --yesno \ | --default-button no --yesno \ | ||||
"The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 | "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 | ||||
if [ $? -eq 0 ]; then | if [ $? -eq 0 ]; then | ||||
clear | clear | ||||
echo This shell is operating in a chroot in the new system. \ | echo This shell is operating in a chroot in the new system. \ | ||||
When finished making configuration changes, type \"exit\". | When finished making configuration changes, type \"exit\". | ||||
chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1 | chroot "$BSDINSTALL_CHROOT" /bin/sh 2>&1 | ||||
fi | |||||
fi | fi | ||||
bsdinstall entropy | bsdinstall entropy | ||||
bsdinstall umount | bsdinstall umount | ||||
f_dprintf "Installation Completed at %s" "$( date )" | f_dprintf "Installation Completed at %s" "$( date )" | ||||
################################################################################ | ################################################################################ | ||||
# END | # END | ||||
################################################################################ | ################################################################################ |