Source code of FreeBSD installer

Where do I find the logic behind the FreeBSD installer that is contained in a memstick image and is run when I boot from it?
 
If you have the source code installed you can use find:
find /usr/src -name 'bsdinstall*'
/usr/src/usr.sbin/bsdinstall
/usr/src/usr.sbin/bsdinstall/bsdinstall.8
/usr/src/usr.sbin/bsdinstall/bsdinstall
/usr/src/release/packages/bsdinstall.ucl
 
As you can see here:
The various phases are simply scripts.

Exactly, but I have imagined the installer to be some graphical application and skipped studying bsdinstall at all, (and in fact I see in the usr.sbin/bsdinstall/(distextract|partedit|distfetch)/Makefile that curses library is need as a dependency, so things add up).

But there is still this thing that I do not understand. If the various steps are scripts, then where is the logic that asks the user to select which of them to execute?
 
The application dialog is an offshoot of ncurses. It is what bsdinstall uses for gui.
Notice in the jail script the very first bsdinstaller screen.
Code:
dialog --backtitle "FreeBSD Installer" --title "Abort" \
        --no-label "Exit" --yes-label "Restart" --yesno \
        "${msg}An installation step has been aborted. Would you like to restart the installation or exit the installer?" 0 0
    if [ $? -ne 0 ]; then
exit
So dialog is creating --yesno type input.
 
Back
Top