Skip to content

Commit

Permalink
Make oz-examples a simple manpage.
Browse files Browse the repository at this point in the history
There is really no need anymore to have it generate
the manpage from separate examples; we are managing
the wiki by hand nowadays.  Simplify the man page stuff
by just having a standard man page.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Nov 24, 2012
1 parent cd86569 commit de98fc2
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 182 deletions.
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,7 @@ deb:

release: signed-rpm signed-tarball deb

examples-manpage:
echo "Generating oz-examples man page"
@(cat man/examples/header ; \
for example in man/examples/*.example ; do \
sed -e 's/^EXAMPLE \(.*\)/.SH EXAMPLE \1/' \
-e 's/^#\(.*\)/.RS\n#\1\n.RE/' $$example ; \
done ; \
cat man/examples/footer) > man/oz-examples.1

man2html: examples-manpage
man2html:
@for file in oz-install oz-customize oz-generate-icicle oz-cleanup-cache oz-examples; do \
echo "Generating $$file HTML page from man" ; \
groff -mandoc -mwww man/$$file.1 -T html > man/$$file.html ; \
Expand All @@ -55,4 +46,4 @@ pylint:
pylint --rcfile=pylint.conf oz oz-install oz-customize oz-cleanup-cache oz-generate-icicle

clean:
rm -rf MANIFEST build dist usr *~ oz.spec *.pyc oz/*~ oz/*.pyc examples/*~ oz/auto/*~ man/*~ docs/*~ man/*.html $(VENV_DIR) tests/tdl/*~ tests/factory/*~ man/oz-examples.1 tests/results.xml
rm -rf MANIFEST build dist usr *~ oz.spec *.pyc oz/*~ oz/*.pyc examples/*~ oz/auto/*~ man/*~ docs/*~ man/*.html $(VENV_DIR) tests/tdl/*~ tests/factory/*~ tests/results.xml
37 changes: 0 additions & 37 deletions man/examples/001.example

This file was deleted.

32 changes: 0 additions & 32 deletions man/examples/002.example

This file was deleted.

31 changes: 0 additions & 31 deletions man/examples/003.example

This file was deleted.

38 changes: 0 additions & 38 deletions man/examples/004.example

This file was deleted.

5 changes: 0 additions & 5 deletions man/examples/footer

This file was deleted.

20 changes: 0 additions & 20 deletions man/examples/header

This file was deleted.

173 changes: 173 additions & 0 deletions man/oz-examples.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
.TH OZ-EXAMPLES 1 "Aug 2011" "oz-examples"

.SH NAME
oz-examples - example TDL files for Oz.

.SH DESCRIPTION
The
.I oz-install(1)
,
.I oz-customize(1)
, and
.I oz-generate-icicle(1)
man pages explain the command-line usage of the Oz commands. One of
the required input parameters to all of the above commands is a TDL
(Template Description Language) file, which describes the OS the user
wants to install, where to get the media from, and any additional
packages or actions the user wants to take on the operating system.
This man page describes a number of TDL examples and what happens when
they are used. Since the TDL is XML, standard XPath notation is used
to describe various elements of the XML.
.SH EXAMPLE 1 - Minimal guest
Assume we want to install a minimal Fedora 13 x86_64 operating system from a Fedora 13 DVD ISO located at http://example.org/fedora-13-x86_64.iso

To do this install we first build a TDL XML file, then feed it to oz-install. The TDL file would look like:

.CDS
<template>
<name>fedora13_x86_64</name>
<os>
<name>Fedora</name>
<version>13</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://example.org/fedora-13-x86_64.iso</iso>
</install>
</os>
<description>My Fedora 13 x86_64 template</description>
</template>
.CDE

/template/name is a user-defined name. This can be anything the user wants, but must be unique among all TDLs the user wants to build.

/template/os/name is the name of the operating system we want to install, /template/os/version is the version we want, and /template/os/arch is the architecture we want. A full list of supported operating systems can be obtained by running:

.RS
# oz-install -h
.RE

/template/os/install tells Oz where to get the installation media from. In this example, we set type to 'iso' which means that we need an <iso> element in the XML pointing to the ISO install media (install methods other than ISO are supported, and described in other examples).

/template/description is an optional, human-readable description of the template. This can be anything the user wants, and is ignored by Oz.

That's all of the input that Oz needs. To actually do the installation, save the above to a file (say fedora13.tdl), and then run oz-install:

.RS
# oz-install /path/to/fedora13.tdl
.RE

(for the time being, all of the oz commands need to be run as root, although we are working on making it work for normal users)

Running this command will download and prepare the installation media, then run an automated install in a KVM guest. Assuming the install succeeds, the minimal operating system will be installed on a file in /var/lib/libvirt/images/fedora13_x86_64.dsk (by default, the output location can be overridden in the configuration file).
.SH EXAMPLE 2 - Guest with additional packages
Assume we want to install a Fedora 14 x86_64 operating system from a Fedora 14 DVD ISO located at http://example.org/fedora-14-x86_64.iso

Additionally assume we want to install the postgresql-server package on the operating system. To do this install, we first need to build a TDL XML file and then feed that to oz-install. The TDL file would look like:

.CDS
<template>
<name>fedora14_postgres</name>
<os>
<name>Fedora</name>
<version>14</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://example.org/fedora-14-x86_64.iso</iso>
</install>
</os>
<description>Fedora 14 x86_64 with postgres</description>
<packages>
<package name='postgresql-server'/>
</packages>
</template>
.CDE

Notice that this is very similar to Example 1, except we specified an additional package to be installed in the /packages/package portion of the TDL. Multiple packages can be specified here, and they will all be installed on the operating system. In this example, all packages are downloaded and installed from the default operating system package repositories. Running the installation is done the same way as in Example 1, except we have to add a command-line parameter to actually do the customization:

.RS
# oz-install -u /path/to/fedora14.tdl
.RE

Running this command will download and prepare the installation media, then run an automated install in a KVM guest.

Assuming the initial install succeeds, Oz will then boot the operating system and run native commands to install the additional packages. For more information about why this approach is used, please see the Oz Architecture document at http://aeolusproject.org/oz-architecture.html

Assuming this final step succeeds, the operating system with the additional packages will be installed on a file in /var/lib/libvirt/images/fedora14_postgres.dsk (by default, the output location can be overridden in the configuration file).
.SH EXAMPLE 3 - Generate a package manifest (ICICLE) after installation
Assume we want to install a RHEL-5 x86_64 operating system from a RHEL-5 DVD ISO located at http://example.org/rhel-5-x86_64.iso

Additionally assume we want to get a package manifest out of the operating system after the install is done. To do this install, we first need to build a TDL XML file and then feed that to oz-install. The TDL file would look like:

.CDS
<template>
<name>rhel5_x86_64</name>
<os>
<name>RHEL-5</name>
<version>U6</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://example.org/rhel-5-x86_64.iso</iso>
</install>
</os>
<description>RHEL-5 x86_64</description>
</template>
.CDE

This is essentially the same as Example 1, except we want to install RHEL-5 instead of Fedora-13.

Running the installation is done the same was as in Example 1, except we have to add a command-line parameter to generate the manifest at the end:

.RS
# oz-install -g /path/to/rhel5.tdl
.RE

Running this command will download and prepare the installation media, then run an automated install in a KVM guest.

Assuming the initial install succeeds, Oz will then boot the operating system and run native commands to query all of the packages in the system. It will then output an XML document (called an ICICLE) describing the entire manifest.

Assuming this step succeeds, the minimal operating system will be install on a feil in /var/lib/libvirt/images/rhel5_x86_64.dsk (by default, the output location can be overridden in the configuration file).
.SH EXAMPLE 4 - Install a package from an alternate repository
Assume we want to install a RHEL-6 x86_64 operating system from a RHEL-6 DVD ISO located at http://example.org/rhel-6-x86_64.iso

Additionally assume that we want to install the ccache package from the EPEL-6 repositories on the operating system. To do this install, we first need to build a TDL XML file and then feed that to oz-install. The TDL file would look like:

.CDS
<template>
<name>rhel6_ccache</name>
<os>
<name>RHEL-6</name>
<version>1</version>
<arch>x86_64</arch>
<install type='iso'>
<iso>http://example.org/rhel-6-x86_64.iso</iso>
</install>
</os>
<description>RHEL-6 x86_64 with ccache</description>
<repositories>
<repository name='epel-6'>
<url>http://download.fedoraproject.org/pub/epel/6/$basearch</url>
<signed>yes</signed>
</repository>
</repositories>
<packages>
<package name='ccache'/>
</packages>
</template>
.CDE

Notice that this is very similar to Example 2, except we have specified an additional repository from which to download packages. The /repositories/repository section of the TDL specified the URL to the package repository along with whether the packages in the repository are signed. Running the installation is done the same way as in Example 2:

.RS
# oz-install -u /path/to/rhel6_ccache.tdl
.RE

Running this command will download and prepare the installation media, then run an automated install in a KVM guest.

Assuming the initial install succeeds, Oz will then boot the operating system and run native commands to setup the additional repositories and install the additional packages. For more information about why this approach is used, please see the Oz Architecture document at http://aeolusproject.org/oz-architecture.html

Assuming this final step succeeds, the operating system with the additional packages will be installed on a file in /var/lib/libvirt/images/rhel6_ccache.dsk (by default, the output location can be overridden in the configuration file).
.SH SEE ALSO
oz-install(1), oz-generate-icicle(1), oz-customize(1), oz-cleanup-cache(1)

.SH AUTHOR
Chris Lalancette <[email protected]>
6 changes: 0 additions & 6 deletions oz.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ installations, with minimal input from the user.
python setup.py build

%install
# generate the oz-examples man page
python setup.py install --root=$RPM_BUILD_ROOT --skip-build

mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/oz/
Expand All @@ -58,11 +57,6 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/oz/kernels/
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/oz
cp oz.cfg $RPM_BUILD_ROOT%{_sysconfdir}/oz

# generate the oz-examples.1 man page and copy it into place
make examples-manpage
cp man/oz-examples.1 $RPM_BUILD_ROOT%{_mandir}/man1
gzip $RPM_BUILD_ROOT%{_mandir}/man1/oz-examples.1

%post
if [ ! -f %{_sysconfdir}/oz/id_rsa-icicle-gen ]; then
ssh-keygen -t rsa -b 2048 -N "" -f %{_sysconfdir}/oz/id_rsa-icicle-gen >& /dev/null
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
VERSION = '0.10.0'
RELEASE = '0'

datafiles = [('share/man/man1', ['man/oz-install.1', 'man/oz-customize.1',
'man/oz-generate-icicle.1',
datafiles = [('share/man/man1', ['man/oz-install.1', 'man/oz-generate-icicle.1',
'man/oz-customize.1', 'man/oz-examples.1',
'man/oz-cleanup-cache.1'])
]

Expand Down

0 comments on commit de98fc2

Please sign in to comment.