|If anything on this page looks "too old" to you, check the "last edited" date above and be reassured that this page is still accurate and should still be followed exactly.|
SmartOS is self hosting. Make sure you are running the latest release of SmartOS to do your builds. If you're on a build from before the fake subset was killed – April 2013, there is a high likelihood the build will fail. Please update your platform.
SmartOS is built in a zone. Use the base-multiarch-lts 14.4.X zone image (e.g. 14.4.2 is UUID e69a0918-055d-11e5-8912-e3ceb6df4cf8)
Do not use any other zone image.
Import the zone image:
Your zone will need sufficient memory, space, space in tmpfs, and access to the ufs, pcfs, and tmpfs drivers. Below are some settings to make sure to include in your zone's json specification (make sure to set up a NIC as well... see How to create a zone ( OS virtualized machine ) in SmartOS for further details).
We recommend that you give your zone at least 2-4 Gb of DRAM and at least 25 Gb of disk space. These are lower bounds and you'll find that the build goes much faster if you are able to throw more memory to the zone. More memory allows more jobs to be run in parallel.
Use vmadm to create your zone, then you can use zlogin to log in.
vmadm validate create will fail with bad_value for fs_allowed, but this can be ignored, the zone will be created correctly.
You should generally be working on, and building, the software as an unprivileged user -- that is, a non-root user. Some of the steps of the configure script, and of the live image creation, require root privileges. The SmartOS build process will use pfexec(1) to obtain root privileges just for the commands that need them.
Configure your non-root user account to be able to escalate privileges to root with the usermod(1M) tool:
People have reported build errors using shells other than bash as their user shell. Please use bash as the shell for your build user.
Enable postfix service: svcadm enable postfix
If you don't you'll have error in logs at build time, like:
"postdrop: warning: mail_queue_enter: create file maildrop/810830.89198: No such file or directory"
SmartOS requires the illumos kernel source tree and a couple more repositories (kvm, ...) as well as various compilation tools to build. The following steps download the various source trees and binaries required for the build:
The configure script requires root privileges for a limited subset of its operation. Earlier, this document describes using usermod to grant those privileges to your build user account.
To create debug builds add the following line to configure.smartos before running ./configure.
If any git clone operation launched by configure hangs, it can be interrupted with Ctrl-C and configure can be restarted (it will pick up at the last unfinished step). After configure finishes successfully, the build zone is ready for the build. One can make a snapshot of the build zone at this point and rollback later if the build fails for any reason.
|Building on an "underpowered" system|
If your system doesn't actually have a lot of RAM or CPU, the build will automatically throttle down the number of concurrent jobs which are run. If you'd like to manually control it, for example, you know that you can run more, than you should set the following environment variable to the maximum number of jobs you'd be willing to run:
You are now ready to build.
Good luck! Build times for SmartOS on various hardware configurations should be similar to the build times for the illumos kernel itself which can be found in the illumos wiki, plus of course the time required to build the SmartOS-specific parts.
The default output of the SmartOS build is a platform file which is suitable for PXE booting. However, a bootable CD-ROM ISO image or a bootable USB key can also be generated. To generate those run one of the following Makefile targets: