Browse code

verified and edited build doc and edited and refined admin guide.

Change-Id: I97c7968471ec354b851a1030ba25ec8938846832
Reviewed-on: http://photon-jenkins.eng.vmware.com/1082
Reviewed-by: Sharath George
Tested-by: Sharath George

shoenisch authored on 2016/06/16 07:59:18
Showing 2 changed files
... ...
@@ -1,4 +1,11 @@
1
+# Building an ISO from the Source Code for Photon OS
2
+
3
+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. 
4
+
1 5
 ## Folder Layout
6
+
7
+Here is the structure of the directories on GitHub that contain the source code for Photon OS:
8
+
2 9
 ```
3 10
 photon/
4 11
 ├── Makefile
... ...
@@ -6,42 +13,46 @@ photon/
6 6
 ├── Dockerfile
7 7
 ├── Vagrantfile
8 8
 ├── SPECS        # RPM SPEC files
9
-├── common       # Build, Packaging config
9
+├── common       # Build, packaging config
10 10
 ├── docs         # Documentation
11 11
 ├── installer    # Installer used at runtime
12 12
 ├── support      # Build scripts
13 13
 └── tools
14 14
 ```
15 15
 
16
-## How to build the ISO?
16
+## How to Build the ISO
17
+
18
+The following process for building the ISO assumes that the following prerequisites are in place:
17 19
 
18
-Pre-requisites :
20
+* A build operating system running the 64-bit version of Ubuntu 14.04 or later
21
+* Packages: bison, gawk, g++, createrepo, python-aptdaemon, genisoimage, texinfo, python-requests
22
+* Docker
23
+* Downloaded the source code from the Photon OS repository on GitHub into `$HOME/workspaces/photon`.
24
+
25
+Here's how to install the packages on Ubuntu: 
19 26
 
20
- * Build O/S : Ubuntu 14.04 (or later) 64 bit
21
- * Packages: bison, gawk, g++, createrepo, python-aptdaemon, genisoimage, texinfo, python-requests
22 27
 ```
23 28
 sudo apt-get -y install bison gawk g++ createrepo python-aptdaemon genisoimage texinfo python-requests
24 29
 ```
25
- * Docker:
30
+Here's how to get Docker:
26 31
 ```
27 32
 wget -qO- https://get.docker.com/ | sh
28 33
 ```
29 34
 
30
-Make sure `/bin/sh` is a symbolic link pointing to `/bin/bash`
31
-
32
-If `/bin/sh` is pointing `/bin/dash`, execute the following:
35
+Make sure `/bin/sh` is a symbolic link pointing to `/bin/bash`. If `/bin/sh` is pointing `/bin/dash`, execute the following:
33 36
 ```
34 37
 sudo ln -sf /bin/bash /bin/sh
35 38
 ```
36 39
 
37
-Assuming you checked out the workspace under `$HOME/workspaces/photon`.
40
+Here's how to make the ISO, assuming you checked out the workspace under `$HOME/workspaces/photon`:
38 41
 ```
39 42
 cd $HOME/workspaces/photon
40 43
 sudo make iso
41 44
 ```
42
-Deliverable will be created at `$HOME/workspaces/photon/stage/photon.iso`
45
+The ISO is created at `$HOME/workspaces/photon/stage/photon.iso`
46
+
43 47
 
44
-## How to use cached toolchain and RPMS?
48
+## How to Use the Cached Toolchain and RPMS
45 49
 ```
46 50
 mkdir $HOME/photon-cache
47 51
 sudo make iso PHOTON_CACHE_PATH=$HOME/photon-cache
... ...
@@ -53,7 +64,7 @@ photon-cache/
53 53
 ├──RPMS/x86-64/*.rpm
54 54
 └──RPMX/noarch/*.rpm
55 55
 ```
56
-## How to use cached sources?
56
+## How to Use Cached Sources
57 57
 ```
58 58
 mkdir $HOME/photon-sources
59 59
 sudo make iso PHOTON_SOURCES_PATH=$HOME/photon-sources
... ...
@@ -66,16 +77,20 @@ photon-sources/
66 66
 └──...
67 67
 ```
68 68
 
69
-## Where are the build logs?
69
+## Where are the Build Logs?
70 70
 ```
71 71
 $HOME/workspaces/photon/stage/LOGS
72 72
 ```
73 73
 
74
-## Complete build environment using Vagrant
75
-A `Vagrantfile` is available to ensure a quick standup of a development/build environment for Photon, this Vagrantfile uses a box called `photon-build-machine` box that is created through a [Packer](http://packer.io) template available under `support/packer-templates`, see the [README.md](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for more information on how to build `photon-build-machine`.
74
+## Building RPMs from their Source RPMs
75
+
76
+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](https://github.com/vmware/photon/blob/master/docs/photon-admin-guide.md#building-a-package-from-a-source-rpm).
77
+
78
+## Complete Build Environment Using Vagrant
79
+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](http://packer.io) template available under `support/packer-templates`; see the [README.md](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for more information on how to build `photon-build-machine`.
76 80
 
77
-## Photon Vagrant box
78
-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](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for more information on how to build.
81
+## Photon Vagrant Box
82
+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](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for more information on how to build it. 
79 83
 
80
-## Automated build environment and Vagrant boxes
81
-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](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for more details.
84
+## Automated Build Environment and Vagrant Boxes
85
+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](https://github.com/vmware/photon/blob/master/support/packer-templates/README.md) for details.
... ...
@@ -1,4 +1,4 @@
1
-# Photon Administration Guide
1
+# Photon OS Administration Guide
2 2
 
3 3
 -   [Introduction](#introduction)
4 4
     -   [Examining the Packages in the SPECS Directory on
... ...
@@ -80,9 +80,11 @@
80 80
 
81 81
 ## Introduction
82 82
 
83
-This guide covers managing packages, controlling services with systemd, setting up networking, initializing Photon OS with cloud-init, running Docker containers, and working with other technologies, such as Kubernetes. 
83
+This guide describes the fundamentals of administering Photon OS, the free, open-source minimalist Linux operating system from VMware that is optimized for cloud computing platforms, VMware vSphere deployments, and applications native to the cloud. 
84 84
 
85
-Photon OS is a Linux container host optimized for vSphere and cloud-computing platforms such as Amazon Elastic Compute and Google Compute Engine. Photon OS is lightweight and extensible. It supports the most common container formats, including Docker, Rocket, and Garden. Photon OS includes a yum-compatible, package-based lifecycle management system called tdnf and optionally works with RPM-OSTree for image-based system versioning. 
85
+The guide covers the basics of managing packages, controlling services with systemd, setting up networking, initializing Photon OS with cloud-init, running Docker containers, and working with other technologies, such as Kubernetes. The guide also includes a section to get you started using Photon OS quickly and easily. 
86
+
87
+Photon OS is a Linux container host optimized for vSphere and cloud-computing platforms such as Amazon Elastic Compute and Google Compute Engine. As a lightweight and extensible operating system, Photon OS works with the most common container formats, including Docker, Rocket, and Garden. Photon OS includes a yum-compatible, package-based lifecycle management system called tdnf and optionally works with RPM-OSTree for image-based system versioning. 
86 88
 
87 89
 When used with development tools and environments such as VMware Fusion, VMware Workstation, HashiCorp (Vagrant and Atlas), and production runtime environments (vSphere, vCloud Air), Photon OS lets you seamlessly migrate container-based applications from development to production. With a small footprint and fast boot and run times, Photon OS is optimized for cloud computing and cloud  applications.  
88 90
 
... ...
@@ -138,13 +140,13 @@ It contains the libraries files for Java runtime environment
138 138
 
139 139
 ### Looking at the Differences Between the Minimal and the Full Version
140 140
 
141
-The minimal version of Photon OS contains about 50 packages. The full version of Photon OS adds several hundred packages to those in the minimal version to create a more fully featured operating system. 
141
+The minimal version of Photon OS contains about 50 packages. As it is installed, the number of packages increases to nearly 100 to fulfill dependencies. The full version of Photon OS adds several hundred packages to those in the minimal version to deliver a more fully featured operating system. 
142 142
 
143 143
 You can view a list of the packages that appear in the minimal version by examining the following file: 
144 144
 
145 145
 [https://github.com/vmware/photon/blob/master/common/data/packages_minimal.json](https://github.com/vmware/photon/blob/master/common/data/packages_minimal.json)
146 146
 
147
-You can view a list of the packages that appear in the minimal version by examining the following file: 
147
+You can view a list of the packages that appear in the full version by examining the following file: 
148 148
 
149 149
 [https://github.com/vmware/photon/blob/master/common/data/packages_full.json](https://github.com/vmware/photon/blob/master/common/data/packages_full.json)
150 150
 
... ...
@@ -159,7 +161,7 @@ One notable difference between the two versions of Photon OS pertains to OpenJDK
159 159
 
160 160
 A later section covers tdnf. 
161 161
 
162
-### The Root Account and the sudo and su Commands
162
+### The Root Account and the `sudo` and `su` Commands
163 163
 
164 164
 This guide assumes that you are logged in to Photon OS with the root account and running commands as root. The sudo program comes with the full version of Photon OS. On the minimal version, you must install sudo with tdnf if you want to use it. As an alternative to installing sudo on the minimal version, you can switch users as needed with the `su` command to run commands that require root privileges. 
165 165
 
... ...
@@ -212,13 +214,13 @@ You can also build an ISO containing Photon OS from its source code on GitHub by
212 212
 
213 213
 ### Installing the OVA for the Minimal Version in vSphere
214 214
 
215
-You can download the OVA for the minimal version of Photon OS from Bintray and deploy it in vSphere in a matter of seconds. 
215
+You can download the OVA for the minimal version of Photon OS from Bintray and deploy it in vSphere in a matter of seconds. Here's how: 
216 216
 
217 217
 Download the OVA for the minimal version of Photon OS from the following URL: 
218 218
 
219 219
 	https://bintray.com/vmware/photon/ova
220 220
 
221
-To install the OVA in vSphere, on the File menu, click Deploy OVF Template, and then click Browse to locate the image that you downloaded. Move through the Deploy OVF Template dialog boxes by clicking Next to accept the default settings, and then click Finish. 
221
+To install the OVA in vSphere, on the `File` menu, click `Deploy OVF Template`, and then click `Browse` to locate the image that you downloaded. Move through the `Deploy OVF Template` dialog boxes by clicking `Next` to accept the default settings, and then click `Finish`. 
222 222
 
223 223
 In vSphere Client, turn on the power of the Photon OS virtual machine and open a console to it.
224 224
 
... ...
@@ -288,7 +290,7 @@ AppCatalyst is optimized for cloud-native application workloads. A common use ca
288 288
 
289 289
 By bundling Photon OS with AppCatalyst, VMware streamlines the workflow of getting a Docker engine running on a Linux machine inside a hypervisor on a Mac. 
290 290
 
291
-Here's how to install AppCatalyst, create a VM running Photon OS, and run a Docker container---all in a matter of minutes. The technology preview version of AppCatalyst requires Mac OS X 10.9 or later.
291
+Here's how to install AppCatalyst, create a VM running Photon OS, and run a Docker container--all in a matter of minutes. The technology preview version of AppCatalyst requires Mac OS X 10.9 or later.
292 292
 
293 293
 First, turn off Fusion if you are running it on your Mac. 
294 294
 
... ...
@@ -708,7 +710,7 @@ After establishing a new repository, you must run the following command to updat
708 708
 
709 709
 ## Managing Services with systemd
710 710
 
711
-Photon OS manages services with systemd. By using systemd, Photon OS adopts a contemporary Linux standard to bootstrap the user space and concurrently start services---an architecture that differs from traditional Linux systems such as SUSE Linux Enterprise Server. 
711
+Photon OS manages services with systemd. By using systemd, Photon OS adopts a contemporary Linux standard to bootstrap the user space and concurrently start services--an architecture that differs from traditional Linux systems such as SUSE Linux Enterprise Server. 
712 712
 
713 713
 A traditional Linux system contains an initialization system called SysVinit. With SLES 11, for instance, SysVinit-style init programs control how the system starts up and shuts down. Init implements system runlevels. A SysVinit runlevel defines a state in which a  process or service runs. 
714 714
 
... ...
@@ -1000,7 +1002,7 @@ To add a DNS server to your static network configuration file, insert a DNS key
1000 1000
 	Gateway=192.168.0.1
1001 1001
 	DNS=192.168.0.1
1002 1002
 
1003
-Another way of adding a DNS server is to modify /etc/systemd/resolved.conf --- a method that can be particularly useful when your machine is working with DHCP. For more information, see https://www.freedesktop.org/software/systemd/man/resolved.conf.html.
1003
+Another way of adding a DNS server is to modify /etc/systemd/resolved.conf--a method that can be particularly useful when your machine is working with DHCP. For more information, see https://www.freedesktop.org/software/systemd/man/resolved.conf.html.
1004 1004
 
1005 1005
 You can optionally activate the local DNS stub resolver of systemd-resolved by adding `dns` and `resolve` to /etc/nsswitch.conf. To do so, make a backup copy of /etc/nsswitch.conf and then execute the following command as root:
1006 1006
 
... ...
@@ -1374,7 +1376,7 @@ You can also add a cloud-init user-data file to an existing instance of a Photon
1374 1374
 
1375 1375
 ## Docker Containers
1376 1376
 
1377
-Photon OS includes the open source version of Docker. With Docker, Photon OS becomes a Linux run-time host for containers---that is, a Linux cloud container. A container is a process that runs on the Photon OS host with its own isolated application, file system, and networking.
1377
+Photon OS includes the open source version of Docker. With Docker, Photon OS becomes a Linux run-time host for containers--that is, a Linux cloud container. A container is a process that runs on the Photon OS host with its own isolated application, file system, and networking.
1378 1378
 
1379 1379
 On Photon OS, the Docker daemon is enabled by default. To view the status of the daemon, run this command: 
1380 1380
 
... ...
@@ -1468,7 +1470,7 @@ To build a package from its source RPM, or SRPM, Photon OS requires the followin
1468 1468
 * gcc. This package is also installed by default on the full version of Photon OS, so you should not have to install it. 
1469 1469
 * make, Cmake, automake, or another make package, depending on the package you are trying to install and build from its source RPM. Cmake is installed by default on Photon OS. You can install other make packages if need be by using tdnf or yum.  
1470 1470
 
1471
-Another requirement is a local unprivileged user account other than the root account. You should build RPMs as an unprivileged user. Do not build a package as root---building an RPM with the root account might damage your system. 
1471
+Another requirement is a local unprivileged user account other than the root account. You should build RPMs as an unprivileged user. Do not build a package as root--building an RPM with the root account might damage your system. 
1472 1472
 
1473 1473
 If you are building a package on a virtual machine running Photon OS in VMware vSphere, VMware Workstation, or VMware Fusion, take a snapshot of your virtual machine before building the package. 
1474 1474