This document describes how to build an ISO from the source code for Photon OS, the open-source minimalist Linux operating system from VMware that is optimized for cloud computing platforms, VMware vSphere deployments, and applications native to the cloud.
Here is the structure of the directories on GitHub that contain the source code for Photon OS:
photon/
├── Makefile
├── README
├── Dockerfile
├── Vagrantfile
├── SPECS # RPM SPEC files
├── common # Build, packaging config
├── docs # Documentation
├── installer # Installer used at runtime
├── support # Build scripts
└── tools
The following process for building the ISO assumes that the following prerequisites are in place:
- A build operating system running the 64-bit version of Ubuntu 14.04 or later
- Packages: bison, gawk, g++, createrepo, python-aptdaemon, genisoimage, texinfo, python-requests
- Docker
- Downloaded the source code from the Photon OS repository on GitHub into
$HOME/workspaces/photon
.
Here's how to install the packages on Ubuntu:
sudo apt-get -y install bison gawk g++ createrepo python-aptdaemon genisoimage texinfo python-requests libfuse-dev libssl-dev uuid-dev libreadline-dev kpartx git bc
Here's how to get Docker:
wget -qO- https://get.docker.com/ | sh
Here's how to make the ISO, assuming you checked out the workspace under $HOME/workspaces/photon
:
cd $HOME/workspaces/photon
sudo make iso
The ISO is created at $HOME/workspaces/photon/stage/photon.iso
mkdir $HOME/photon-cache
sudo make iso PHOTON_CACHE_PATH=$HOME/photon-cache
Directory format of PHOTON_CACHE_PATH
is as follows.
photon-cache/
├──tools-build.tar.gz
├──RPMS/x86-64/*.rpm
└──RPMX/noarch/*.rpm
mkdir $HOME/photon-sources
sudo make iso PHOTON_SOURCES_PATH=$HOME/photon-sources
Directory format of PHOTON_SOURCES_PATH
is as follows.
photon-sources/
├──src1.tar.gz
├──src2.tar.gz
└──...
$HOME/workspaces/photon/stage/LOGS
For instructions on how to install and build a package on Photon OS from the package's source RPM, see the Photon OS Administration Guide.
A Vagrantfile
is available to ensure a quick standup of a development or build environment for Photon. This Vagrantfile uses a box called photon-build-machine
that is created through a Packer template available under support/packer-templates
; see the README.md for more information on how to build photon-build-machine
.
As with the build-machine a Packer template is available under support/packer-templates
to build a Photon based Vagrant box running Docker, see the README.md for more information on how to build it.
Convenience make
targets also exist to build both the photon-build-machine
and the photon
Packer templates as well as building a fresh ISO using the photon-build-machine
. See the README.md for details.