class

Bootstrap::SysrootWorkspace

Inherits Reference < Object

Rootfs workspace helpers anchored on the .bq2-rootfs marker.

Environment names (namespace):

  • host: used for initial invocation and building the workspace
  • seed: outer rootfs used for building the tools into /opt/sysroot to build the bq2 rootfs
  • bq2: the final inner rootfs as /

Stable path references:

  • host_workdir: directory on host used to store all of the working files (host: <host_workdir>)
  • seed_rootfs_path: directory containing the outer rootfs (host: <host_workdir>/seed-rootfs, outer rootfs: /).
  • sysroot_path: directory to target the initial tool build (host: <host_workdir>/seed-rootfs/opt/sysroot, outer rootfs: /opt/sysroot)
  • bq2_rootfs_path: directory that contains .bq2-rootfs and the inner rootfs (host: <host_workdir>/seed-rootfs/bq2-rootfs, outer rootfs: /bq2-rootfs, inner rootfs: /).
  • workspace_path: directory that contains the workspace root (host: <host_workdir>/seed-rootfs/bq2-rootfs/workspace, outer rootfs: /bq2-rootfs/workspace, inner rootfs: /workspace).
  • log_path: /var/lib under in the inner rootfs (host <host_workdir>/seed-rootfs/bq2-rootfs/var/lib, outer rootfs: /bq2-rootfs/var/lib, inner rootfs: /var/lib).

To simplify coordination of path changes from namespace changes, this class should be used instead of SysrootNamespace directly.

Constants

BQ2_DIR_NAME = "bq2-rootfs"
DEFAULT_HOST_WORKDIR = "data/sysroot"
LOG_DIR_NAME = "var/lib"
PROBE_PATHS_FOR_MARKER = [{namespace: Namespace::Host, path: Path["#{DEFAULT_HOST_WORKDIR}/#{SEED_DIR_NAME}/#{BQ2_DIR_NAME}/#{ROOTFS_MARKER_NAME}"]}, {namespace: Namespace::Seed, path: Path["/#{BQ2_DIR_NAME}/#{ROOTFS_MARKER_NAME}"]}, {namespace: Namespace::BQ2, path: Path["/#{ROOTFS_MARKER_NAME}"]}]
ROOTFS_MARKER_NAME = ".bq2-rootfs"
SEED_DIR_NAME = "seed-rootfs"
SYSROOT_DIR_NAME = "opt/sysroot"
WORKSPACE_DIR_NAME = "workspace"

Constructors

create(host_workdir : Path = Path["#{DEFAULT_HOST_WORKDIR}"], extra_binds : Array(Tuple(Path, Path)) = [] of Tuple(Path, Path)) : SysrootWorkspace

Create a workspace rooted at host_workdir, ensuring marker + dirs exist.

Source
new(host_workdir : Path | Nil = nil, extra_binds : Array(Tuple(Path, Path)) = [] of Tuple(Path, Path))
Source

Class methods

bq2_rootfs_from(namespace : Namespace, host_workdir : Path | Nil = nil)
Source
seed_rootfs_from(namespace : Namespace, host_workdir : Path | Nil = nil)
Source
sysroot_from(namespace : Namespace, host_workdir : Path | Nil = nil)
Source
workspace_from(namespace : Namespace, host_workdir : Path | Nil = nil)
Source

Instance methods

bq2_rootfs_path
Source
bq2_rootfs_path=(bq2_rootfs_path : Path)
Source
enter_bq2_rootfs_namespace

Enter the bq2 rootfs namespace, ensuring the sysroot toolchain is bound in.

Source
enter_namespace(requested_label : String) : Nil

Enter the requested namespace by label, if needed.

Source
enter_seed_rootfs_namespace

Enter the seed rootfs namespace and apply any configured bind mounts.

Source
extra_binds
Source
extra_binds=(extra_binds : Array(Tuple(Path, Path)))
Source
host_workdir
Source
host_workdir=(host_workdir : Path | Nil)
Source
log_path
Source
log_path=(log_path : Path)
Source
marker_path
Source
marker_path=(marker_path : Path)
Source
namespace
Source
namespace=(namespace : Namespace)
Source
namespace_switch_required?(requested : String)
Source
seed_rootfs_path
Source
seed_rootfs_path=(seed_rootfs_path : Path | Nil)
Source
sysroot_path
Source
sysroot_path=(sysroot_path : Path | Nil)
Source
workspace_path
Source
workspace_path=(workspace_path : Path)
Source

Nested types