bsdinstall

This is an old revision of the document!


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/user/nwhitehorn/bsdinstall

Status:

  • Installs working, bootable systems on powerpc, sparc64, and x86 systems. PC98 support is present, but untested. ia64 is missing.

Missing features (as of 5 Feb. 2011):

  • Distfile fetching not entirely hooked up (mirror selection is missing – there are no mirrors)
  • ZFS installation

Goals:

  • Reinvent as few wheels as possible
  • Extensability
  • 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. The distset splitting of the base done by sysinstall now is also somewhat confusing, and probably irrelevant with hard drives as large as they now are. At present, therefore, the distributions consist of four tarballs:

  • world.tgz: Output of make installworld
  • kernel.tgz: Output of make installkernel. Choosing between multiple kernels is not important now that SMP is in GENERIC
  • distribution.tgz: Output of make distrib-dirs distribution
  • ports.tgz: Ports tree (optional)
  • bsdinstall.1296943204.txt.gz
  • Last modified: 2011/02/05 22:00
  • by NathanWhitehorn