From cea95db3790bb98085288a4234c9dd9272c4e1ad Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 1 Apr 2017 14:39:10 +0200 Subject: Add bootstrap protocol version to build machine directory names --- doc/manual.cli | 56 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 29 insertions(+), 27 deletions(-) (limited to 'doc') diff --git a/doc/manual.cli b/doc/manual.cli index e5f9b55..6648eec 100644 --- a/doc/manual.cli +++ b/doc/manual.cli @@ -351,7 +351,7 @@ accessed via TFTP using predictable names). \h1#machines|Build Machines| -At the top level, a machine storage volume (\l{#config-storage-machines +At the top level, a machine storage volume (see \l{#config-storage-machines Machines}) contains machine directories, for example: \ @@ -361,30 +361,32 @@ Machines}) contains machine directories, for example: \ The layout inside a machine directory is as follows, where \c{} is -the machine name and \c{toolchain} is the toolchain name: +the machine name and \c{} is the toolchain name: \ / -├── -> -2 -├── -1/ -├── -2/ +├── -1 -> -1.1 +├── -1.0/ +├── -1.1/ ├── -/ └── --/ \ -The \c{-} entries are read-only \c{btrfs} subvolumes that contain -the initial (that is, \i{pre-bootstrap}) machine images. The numeric \c{} -part indicate the machine revision. +The \c{-

.} entries are read-only \c{btrfs} subvolumes that contain +the initial (that is, \i{pre-bootstrap}) machine images. The numeric \c{

} +part indicates the \i{bootstrap protocol version}. The numeric \c{} part +indicates the machine revision. -The \c{} entry is a symbolic link to the \c{-} that is +The \c{-

} entry is a symbolic link to \c{-

.} that is currently in effect. The \c{-} entry is the bootstrapped machine image for -\c{}. It is created by cloning \c{} and then bootstrapping +\c{}. It is created by cloning \c{-

} with a bootstrap +protocol version that matches this toolchain's \c{bbot} and then bootstrapping the \c{build2} toolchain inside. The \c{--} entries are the temporary snapshots of -\c{-} created for building packages. +\c{-} created by \c{bbot} for building packages. A machine can be added, upgraded, or deleted on a live Build OS instance. This needs to be done in a particular order to avoid inconsistencies and race @@ -392,7 +394,7 @@ conditions. \h#machines-add|Adding a Machine| -Let's assume you have a read-only \c{btrfs} \c{linux-gcc_6-1} subvolume on a +Let's assume you have a read-only \c{btrfs} \c{linux-gcc_6-1.0} subvolume on a development host (we will call it \c{devel}) that contains the initial version of our virtual machine. We would like to add it to the build host (running Build OS, we will call it \c{build}) into the default machine volume @@ -406,26 +408,26 @@ build$ mkdir /build/machines/default/linux-gcc_6 # Send the machine subvolume to build host. # -devel$ sudo btrfs send linux-gcc_6-1 | \ +devel$ sudo btrfs send linux-gcc_6-1.0 | \ ssh build@build sudo btrfs receive /build/machines/default/linux-gcc_6/ build$ cd /build/machines/default/linux-gcc_6 # Make user build the owner of the machine subvolume. # -build$ sudo btrfs property set -ts linux-gcc_6-1 ro false -build$ sudo chown build:build linux-gcc_6-1 -build$ btrfs property set -ts linux-gcc_6-1 ro true +build$ sudo btrfs property set -ts linux-gcc_6-1.0 ro false +build$ sudo chown build:build linux-gcc_6-1.0 +build$ btrfs property set -ts linux-gcc_6-1.0 ro true # Make the subvolume the current machine. # -build$ ln -s linux-gcc_6-1 linux-gcc_6 +build$ ln -s linux-gcc_6-1.0 linux-gcc_6-1 \ \h#machines-upgade|Upgrading a Machine| Continuing with the example started in the previous section, let's assume we -have created \c{linux-gcc_6-2} as a snapshot of \c{linux-gcc_6-1} and have +have created \c{linux-gcc_6-1.1} as a snapshot of \c{linux-gcc_6-1.0} and have made some modification to the virtual machine (all on the development host). We now would like to switch to this new revision of our machine on the build host. To achieve this in an atomic way we perform the following steps: @@ -433,26 +435,26 @@ build host. To achieve this in an atomic way we perform the following steps: \ # Send the new machine subvolume to build host incrementally. # -devel$ sudo btrfs send -p linux-gcc_6-1 linux-gcc_6-2 | \ +devel$ sudo btrfs send -p linux-gcc_6-1.0 linux-gcc_6-1.1 | \ ssh build@build sudo btrfs receive /build/machines/default/linux-gcc_6/ build$ cd /build/machines/default/linux-gcc_6 # Make user build the owner of the new machine subvolume. # -build$ sudo btrfs property set -ts linux-gcc_6-2 ro false -build$ sudo chown build:build linux-gcc_6-2 -build$ btrfs property set -ts linux-gcc_6-2 ro true +build$ sudo btrfs property set -ts linux-gcc_6-1.1 ro false +build$ sudo chown build:build linux-gcc_6-1.1 +build$ btrfs property set -ts linux-gcc_6-1.1 ro true # Switch the current machine atomically. # -build$ ln -s linux-gcc_6-2 new-linux-gcc_6 -build$ mv -T new-linux-gcc_6 linux-gcc_6 +build$ ln -s linux-gcc_6-1.1 new-linux-gcc_6-1 +build$ mv -T new-linux-gcc_6-1 linux-gcc_6-1 # Remove the old machine subvolume (optional). # -build$ btrfs property set -ts linux-gcc_6-1 ro false -build$ btrfs subvolume delete linux-gcc_6-1 +build$ btrfs property set -ts linux-gcc_6-1.0 ro false +build$ btrfs subvolume delete linux-gcc_6-1.0 \ \h#machines-delete|Deleting a Machine| @@ -467,7 +469,7 @@ build$ cd /build/machines/default/linux-gcc_6 # Delete the current machine symlink. # -build$ rm linux-gcc_6 +build$ rm linux-gcc_6-1 # Wait for all the linux-gcc_6-- subvolumes # to disappear. -- cgit v1.1