bootstrap-vz/bootstrapvz
Jonas Bergler 8f03987593 Fix installation of vbox guest additions.
Credits for this idea go to @myhro who suggested emulating uname.

I cleaned his changes up somewhat and moved the script into a
separate file to make things easier to look at.

I did a test build of wheezy with my changes and the modules were
installed correctly.

root@localhost:/home/vagrant# dkms status
vboxguest, 4.3.20, 3.2.0-4-amd64, x86_64: installed

root@localhost:/home/vagrant# lsmod | egrep ^vbox
vboxsf                 33359  0
vboxvideo              12437  0
vboxguest             162115  1 vboxsf
2015-04-25 16:12:26 -03:00
..
base Revert 03efa0f (#210) 2015-04-16 22:22:49 +02:00
common Fix truncate arguments 2015-04-23 23:19:16 -03:00
plugins Repeat index/README pattern for plugins & providers 2015-04-16 23:52:07 +02:00
providers Fix installation of vbox guest additions. 2015-04-25 16:12:26 -03:00
remote Make bootstrap-vz-remote actually work 2015-04-23 23:30:39 +02:00
__init__.py Properly fix imports and make bootstrapvz work like a package 2014-04-02 21:32:10 +02:00
README.rst Move developers intro into bootstrapvz/ as README 2015-04-16 23:27:09 +02:00

How bootstrap-vz works
----------------------

Tasks
~~~~~
At its core bootstrap-vz is based on tasks that perform units of work.
By keeping those tasks small and with a solid structure built around
them a high degree of flexibility can be achieved. To ensure that
tasks are executed in the right order, each task is placed in a
dependency graph where directed edges dictate precedence. Each task is
a simple class that defines its predecessor tasks and successor tasks
via attributes. Here is an example:

::

    class MapPartitions(Task):
      description = 'Mapping volume partitions'
      phase = phases.volume_preparation
      predecessors = [PartitionVolume]
      successors = [filesystem.Format]

      @classmethod
      def run(cls, info):
         info.volume.partition_map.map(info.volume)

In this case the attributes define that the task at hand should run
after the ``PartitionVolume`` task — i.e. after volume has been
partitioned (``predecessors``) — but before formatting each
partition (``successors``).
It is also placed in the ``volume_preparation`` phase.
Phases are ordered and group tasks together. All tasks in a phase are
run before proceeding with the tasks in the next phase. They are a way
of avoiding the need to list 50 different tasks as predecessors and
successors.

The final task list that will be executed is computed by enumerating
all tasks in the package, placing them in the graph and
`sorting them topologically <http://en.wikipedia.org/wiki/Topological_sort>`_.
Subsequently the list returned is filtered to contain only the tasks the
provider and the plugins added to the taskset.


System abstractions
~~~~~~~~~~~~~~~~~~~
There are several abstractions in bootstrap-vz that make it possible
to generalize things like volume creation, partitioning, mounting and
package installation. As a rule these abstractions are located in the
``base/`` folder, where the manifest parsing and task ordering algorithm
are placed as well.