BSDInstall: The Stopgap Installer
This is designed to be a lightweight replacement for sysinstall until future installers show up, but more modular and easily extended. It is scriptable from shell scripts. The full installer can be run by executing bsdinstall auto, and is intended to be run from a live environment (e.g. a live CD or PXE boot). As of Jan. 12, it has no dependencies outside of the base system.
SVN repository: svn://svn.freebsd.org/base/head/usr.sbin/bsdinstall
Test CDROM image
- Installs working, bootable systems on powerpc, sparc64, pc98, and x86 systems. ia64 is missing.
- Merged to HEAD as r218799 on 18 February, 2011
Missing features (as of 5 Feb. 2011):
- ZFS installation
- Reinvent as few wheels as possible
- Scriptability without a scripting language -- the installer itself is a shell script that links together a set of installer components
- Minimal grubbing around in outputs of shell commands with awk, sed, etc.
This installer takes a different approach to scriptability than sysinstall or pc-sysinstall. The main install program (bsdinstall auto) is a short shell script that calls the other parts of the installer in sequence. Any step can be replaced or embellished by doing something else from the shell script (e.g. the partedit partition editor could be replaced entirely by a sequence of gpart commands) instead of being limited to the constraints of the configuration syntax.
Eventually this will be adapted to use the backend from pc-sysinstall.
The installer consists of several steps, each a C executable or script:
keymap: User optionally sets their keymap, if running on a virtual terminal, which is written to rc.conf
hostname: User chooses a hostname for the new system, which is written to rc.conf
netconfig: Network configuration tool. Allows user to configure an interface and writes configuration to the new system's rc.conf
wlanconfig: Sets up wpa_supplicant. Scans for wireless networks and lets user select one and enter appropriate authentication info.
partedit: Partition editor. Uses gpart to create and modify partitions, and writes an fstab for the new system to a well-known temporary location
autopart: Wizard-based alter ago of partedit.
mount: Mounts all the file systems in the temporary location under a temporary root (/mnt by default)
distfetch: Fetch all of the files in $DISTRIBUTIONS from $BSDINSTALL_DISTSITE to $BSDINSTALL_DISTDIR (/usr/bsdinstall-dist by default)
distextract: Extracts $DISTRIBUTIONS from $BSDINSTALL_DISTDIR to the temporary root
rootpass: Sets root password for new system
time: Sets timezone for new system
adduser: Sets up users for new system
services: Prompts for system services (e.g. sshd) to enable
config: Copies temporary configuration files (fstab, rc.conf, resolv.conf) from temporary location to the new system.
- Shell commands used in scripts: dialog sh awk sort cp gpart ifconfig sysctl xargs mkdir mount cat uname netstat newfs dhclient arp kbdmap kbdcontrol
sysinstall takes great pains to make sure everything it does is floppy-sized, which is not relevant in 2011, so distfiles for this installer are single tarballs instead of many chunks:
- base.txz: Base system
- kernel.txz: Output of make installkernel. Choosing between multiple kernels is not important now that SMP is in GENERIC
- games.txz: Fortune, etc.
- doc.txz: Documentation (including handbook)
- ports.txz: Ports tree (optional)
- src.txz: System source code